From 1405e47fc10bf75fb325e3e8e2978cc06ba1c261 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 9 Nov 2002 00:04:18 +0000 Subject: Mainly updates for additional/altered admin permission options ... note, you MUST empty your current auth_options table and insert the list from the mysql_basic, you will also need to empty the auth_user/auth_group tables and re-assign permissions, and you should clear the $acl_options array in config_cache git-svn-id: file:///svn/phpbb/trunk@3020 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_forums.php | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'phpBB/admin/admin_forums.php') diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 3e79720dff..17fea8fac4 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -21,45 +21,47 @@ if (!empty($setmodules)) { - if (!$auth->acl_get('a_forum')) + if (!$auth->acl_gets('a_forum', 'a_forumadd', 'a_forumdel')) { return; } - $file = basename(__FILE__); - $module['Forums']['Manage'] = $file . $SID; + $module['Forums']['Manage'] = basename(__FILE__) . $SID; return; } define('IN_PHPBB', 1); -// // Include files -// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -// -// Do we have forum admin permissions? -// -if (!$auth->acl_get('a_forum')) -{ - message_die(MESSAGE, $user->lang['No_admin']); -} +// Get mode +$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; -// -// Mode setting -// -if (isset($_POST['mode']) || isset($_GET['mode'])) -{ - $mode = (!empty($_POST['mode'])) ? $_POST['mode'] : $_GET['mode']; -} -else +// Do we have permissions? +switch ($mode) { - $mode = ''; + case 'add': + if (!$auth->acl_get('a_forumadd')) + { + trigger_error($user->lang['NO_ADMIN']); + } + case 'del': + if (!$auth->acl_get('a_forumdel')) + { + trigger_error($user->lang['NO_ADMIN']); + } + + default: + if (!$auth->acl_get('a_forum')) + { + trigger_error($user->lang['NO_ADMIN']); + } } +// Major routines switch ($mode) { case 'move_up': @@ -355,15 +357,13 @@ switch ($mode) break; case 'forum_sync': - sync('forum', intval($_GET[POST_FORUM_URL])); + sync('forum', intval($_GET['f'])); $show_index = TRUE; break; case 'add': case 'edit': - // // Show form to create/modify a forum - // if ($mode == 'edit') { $forum_id = intval($_GET['f']); -- cgit v1.2.1