permissions logic for janitors

This commit is contained in:
Michael Save 2012-01-07 11:42:10 +11:00
parent 1311bc977c
commit 3a16a570dd

View File

@ -147,6 +147,8 @@
} }
if(hasPermission($config['mod']['manageusers'])) { if(hasPermission($config['mod']['manageusers'])) {
$fieldset['Administration'] .= '<li><a href="?/users">' . _('Manage users') . '</a></li>'; $fieldset['Administration'] .= '<li><a href="?/users">' . _('Manage users') . '</a></li>';
} elseif(hasPermission($config['mod']['change_password'])) {
$fieldset['Administration'] .= '<li><a href="?/users/' . $user['id'] . '">' . _('Change own password') . '</a></li>';
} }
if(hasPermission($config['mod']['modlog'])) { if(hasPermission($config['mod']['modlog'])) {
$fieldset['Administration'] .= '<li><a href="?/log">' . _('Moderation log') . '</a></li>'; $fieldset['Administration'] .= '<li><a href="?/log">' . _('Moderation log') . '</a></li>';
@ -1243,7 +1245,10 @@
setCookies(); setCookies();
} }
header('Location: ?/users', true, $config['redirect_http']); if(hasPermission($config['mod']['manageusers']))
header('Location: ?/users', true, $config['redirect_http']);
else
header('Location: ?/', true, $config['redirect_http']);
exit; exit;
} }