Removed manage.php.
This commit is contained in:
parent
6b7d9b6637
commit
4bdc00fac3
4 changed files with 396 additions and 397 deletions
public
|
@ -183,15 +183,61 @@ Template::set('user_menu', $msz->getUserMenu($userInfo ?? null, $inManageMode));
|
|||
Template::set('display_debug_info', MSZ_DEBUG || (!empty($userInfo) && $userInfo->isSuperUser()));
|
||||
|
||||
if($inManageMode) {
|
||||
$hasManageAccess = $msz->isLoggedIn() && !$msz->hasActiveBan()
|
||||
&& perms_check_user(MSZ_PERMS_GENERAL, $msz->getActiveUser()->getId(), MSZ_PERM_GENERAL_CAN_MANAGE);
|
||||
$hasManageAccess = false;
|
||||
|
||||
if($msz->isLoggedIn() && !$msz->hasActiveBan()) {
|
||||
$manageUser = $msz->getActiveUser();
|
||||
$manageUserId = $manageUser->getId();
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_GENERAL, $manageUserId, MSZ_PERM_GENERAL_CAN_MANAGE)) {
|
||||
$hasManageAccess = true;
|
||||
$manageMenu = [
|
||||
'General' => [
|
||||
'Overview' => url('manage-general-overview'),
|
||||
],
|
||||
];
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_GENERAL, $manageUserId, MSZ_PERM_GENERAL_VIEW_LOGS))
|
||||
$manageMenu['General']['Logs'] = url('manage-general-logs');
|
||||
if(perms_check_user(MSZ_PERMS_GENERAL, $manageUserId, MSZ_PERM_GENERAL_MANAGE_EMOTES))
|
||||
$manageMenu['General']['Emoticons'] = url('manage-general-emoticons');
|
||||
if(perms_check_user(MSZ_PERMS_GENERAL, $manageUserId, MSZ_PERM_GENERAL_MANAGE_CONFIG))
|
||||
$manageMenu['General']['Settings'] = url('manage-general-settings');
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_USER, $manageUserId, MSZ_PERM_USER_MANAGE_USERS))
|
||||
$manageMenu['Users & Roles']['Users'] = url('manage-users');
|
||||
if(perms_check_user(MSZ_PERMS_USER, $manageUserId, MSZ_PERM_USER_MANAGE_ROLES))
|
||||
$manageMenu['Users & Roles']['Roles'] = url('manage-roles');
|
||||
if(perms_check_user(MSZ_PERMS_USER, $manageUserId, MSZ_PERM_USER_MANAGE_NOTES))
|
||||
$manageMenu['Users & Roles']['Notes'] = url('manage-users-notes');
|
||||
if(perms_check_user(MSZ_PERMS_USER, $manageUserId, MSZ_PERM_USER_MANAGE_WARNINGS))
|
||||
$manageMenu['Users & Roles']['Warnings'] = url('manage-users-warnings');
|
||||
if(perms_check_user(MSZ_PERMS_USER, $manageUserId, MSZ_PERM_USER_MANAGE_BANS))
|
||||
$manageMenu['Users & Roles']['Bans'] = url('manage-users-bans');
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_NEWS, $manageUserId, MSZ_PERM_NEWS_MANAGE_POSTS))
|
||||
$manageMenu['News']['Posts'] = url('manage-news-posts');
|
||||
if(perms_check_user(MSZ_PERMS_NEWS, $manageUserId, MSZ_PERM_NEWS_MANAGE_CATEGORIES))
|
||||
$manageMenu['News']['Categories'] = url('manage-news-categories');
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_FORUM, $manageUserId, MSZ_PERM_FORUM_MANAGE_FORUMS))
|
||||
$manageMenu['Forum']['Permission Calculator'] = url('manage-forum-categories');
|
||||
if(perms_check_user(MSZ_PERMS_FORUM, $manageUserId, MSZ_PERM_FORUM_TOPIC_REDIRS))
|
||||
$manageMenu['Forum']['Topic Redirects'] = url('manage-forum-topic-redirs');
|
||||
|
||||
if(perms_check_user(MSZ_PERMS_CHANGELOG, $manageUserId, MSZ_PERM_CHANGELOG_MANAGE_CHANGES))
|
||||
$manageMenu['Changelog']['Changes'] = url('manage-changelog-changes');
|
||||
if(perms_check_user(MSZ_PERMS_CHANGELOG, $manageUserId, MSZ_PERM_CHANGELOG_MANAGE_TAGS))
|
||||
$manageMenu['Changelog']['Tags'] = url('manage-changelog-tags');
|
||||
|
||||
Template::set('manage_menu', $manageMenu);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$hasManageAccess) {
|
||||
echo render_error(403);
|
||||
exit;
|
||||
}
|
||||
|
||||
Template::set('manage_menu', manage_get_menu($userInfo->getId()));
|
||||
}
|
||||
|
||||
$mszRequestPath = $request->getPath();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue