So I made some changes to admin_users.php and user_show_center.tpl. Basically I made a function in the php:
Code:
function canIChangeUser($user_level) {
global $amIgod, $main_smarty;
//Don't want to let admins reset other admins or god
$viewer = $main_smarty->get_template_vars('user_logged_in');
$target = $_GET["user"];
if ($viewer != $target && !$amIgod && (($user_level == 'god') || ($user_level == 'admin'))) {
echo "Access denied";
die;
}
}
Also modified user_show_center.tpl to not show the edit panel if the user is an admin or a god (unless it's the viewer himself):
Code:
{* Only show edit panel if:
- user is god
- user is viewing him/herself
- viewed person is not an admin or god
*}
{if $amIgod || $user_logged_in eq $userdata[nr].user_login || ($userdata[nr].user_level neq 'admin' && $userdata[nr].user_level neq 'god')}
<div id="admin_view_user_edit">
etc...
Lemme know what u think.




Linear Mode

