diff --git a/public/settings.php b/public/settings.php index fe27f58d..54e0af2c 100644 --- a/public/settings.php +++ b/public/settings.php @@ -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')); $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.'; } @@ -168,4 +180,5 @@ echo tpl_render('user.settings', [ 'sessions' => $sessions, 'logins' => $logins, 'logs' => $logs, + 'roles' => $userRoles, ]); diff --git a/templates/user/settings.twig b/templates/user/settings.twig index c0c7054d..e328d423 100644 --- a/templates/user/settings.twig +++ b/templates/user/settings.twig @@ -86,6 +86,14 @@ {% endif %} +
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.
+