//user role stuff
This commit is contained in:
parent
b84121e277
commit
3cb971aa03
3 changed files with 28 additions and 3 deletions
|
@ -157,7 +157,19 @@ $sessions['list'] = user_session_list($sessions['offset'], $sessions['take'], us
|
||||||
$logins['list'] = user_login_attempts_list($sessions['offset'], $sessions['take'], user_session_current('user_id'));
|
$logins['list'] = user_login_attempts_list($sessions['offset'], $sessions['take'], user_session_current('user_id'));
|
||||||
$logs['list'] = audit_log_list($logs['offset'], $logs['take'], user_session_current('user_id'));
|
$logs['list'] = audit_log_list($logs['offset'], $logs['take'], user_session_current('user_id'));
|
||||||
|
|
||||||
if (empty($errors)) {
|
$getUserRoles = db_prepare('
|
||||||
|
SELECT r.`role_id`, r.`role_name`
|
||||||
|
FROM `msz_user_roles` as ur
|
||||||
|
LEFT JOIN `msz_roles` as r
|
||||||
|
ON r.`role_id` = ur.`role_id`
|
||||||
|
WHERE ur.`user_id` = :user_id
|
||||||
|
');
|
||||||
|
$getUserRoles->bindValue('user_id', user_session_current('user_id'));
|
||||||
|
$userRoles = $getUserRoles->execute() ? $getUserRoles->fetchAll(PDO::FETCH_ASSOC) : [];
|
||||||
|
|
||||||
|
var_dump($userRoles);
|
||||||
|
|
||||||
|
if (empty($errors)) { // delete this in 2019
|
||||||
$errors[] = 'A few of the elements on this page have been moved to the on-profile editor. To find them, go to your profile and hit the "Edit Profile" button below your avatar.';
|
$errors[] = 'A few of the elements on this page have been moved to the on-profile editor. To find them, go to your profile and hit the "Edit Profile" button below your avatar.';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,4 +180,5 @@ echo tpl_render('user.settings', [
|
||||||
'sessions' => $sessions,
|
'sessions' => $sessions,
|
||||||
'logins' => $logins,
|
'logins' => $logins,
|
||||||
'logs' => $logs,
|
'logs' => $logs,
|
||||||
|
'roles' => $userRoles,
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -86,6 +86,14 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div class="container settings__container" id="roles">
|
||||||
|
{{ container_title('<i class="fas fa-toilet-paper"></i> Roles', '', true) }}
|
||||||
|
|
||||||
|
<div class="settings__description">
|
||||||
|
<p>This is a listing of the user roles you're a part of, you can select which you want to leave or which one you want to boast as your main role which will change your username colour accordingly.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="container settings__container" id="sessions">
|
<div class="container settings__container" id="sessions">
|
||||||
{{ container_title('<i class="fas fa-key fa-fw"></i> Sessions', '', true) }}
|
{{ container_title('<i class="fas fa-key fa-fw"></i> Sessions', '', true) }}
|
||||||
{% set spagination = pagination(
|
{% set spagination = pagination(
|
||||||
|
|
|
@ -3,19 +3,23 @@
|
||||||
|
|
||||||
|
|
||||||
"@fortawesome/fontawesome-free@^5.3.1":
|
"@fortawesome/fontawesome-free@^5.3.1":
|
||||||
version "5.4.1"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.4.1.tgz#6194786c1a705ab84253e06429834466670e3c3f"
|
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.5.0.tgz#0c6c53823d04457ae669cd19567b8a21dbb4fcfd"
|
||||||
|
integrity sha512-p4lu0jfj5QN013ddArh99r3OXZ/fp9rbovs62LfaO70OMBsAXxtNd0lAq/97fitrscR0fqfd+/a5KNcp6Sh/0A==
|
||||||
|
|
||||||
"@types/jquery@^2.0.40":
|
"@types/jquery@^2.0.40":
|
||||||
version "2.0.51"
|
version "2.0.51"
|
||||||
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-2.0.51.tgz#d0c728663de8905457a26c8891ac08ad2b3539c9"
|
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-2.0.51.tgz#d0c728663de8905457a26c8891ac08ad2b3539c9"
|
||||||
|
integrity sha512-+vtCjz+pzr5KkaX/GMnVF0YtQqkm+oVcdBH0Q7zCxdwk42c71xJ9hT1b6Mbn4Kf7CAxSHvkWF1LRdpYwUM+pcg==
|
||||||
|
|
||||||
highlightjs@^9.10.0:
|
highlightjs@^9.10.0:
|
||||||
version "9.12.0"
|
version "9.12.0"
|
||||||
resolved "https://registry.yarnpkg.com/highlightjs/-/highlightjs-9.12.0.tgz#9b84eb42a7aa8488eb69ac79fec44cf495bf72a1"
|
resolved "https://registry.yarnpkg.com/highlightjs/-/highlightjs-9.12.0.tgz#9b84eb42a7aa8488eb69ac79fec44cf495bf72a1"
|
||||||
|
integrity sha512-eAhWMtDZaOZIQdxIP4UEB1vNp/CVXQPdMSihTSuaExhFIRC0BVpXbtP3mTP1hDoGOyh7nbB3cuC3sOPhG5wGDA==
|
||||||
|
|
||||||
timeago.js@^3.0.2:
|
timeago.js@^3.0.2:
|
||||||
version "3.0.2"
|
version "3.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/timeago.js/-/timeago.js-3.0.2.tgz#32a67e7c0d887ea42ca588d3aae26f77de5e76cc"
|
resolved "https://registry.yarnpkg.com/timeago.js/-/timeago.js-3.0.2.tgz#32a67e7c0d887ea42ca588d3aae26f77de5e76cc"
|
||||||
|
integrity sha1-MqZ+fA2IfqQspYjTquJvd95edsw=
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/jquery" "^2.0.40"
|
"@types/jquery" "^2.0.40"
|
||||||
|
|
Loading…
Add table
Reference in a new issue