acl_get('a_auth')) ? $filename . $SID . '&mode=forums' : ''; $module['Forums']['MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=moderators' : ''; $module['Forums']['SUPER_MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=supermoderators' : ''; $module['General']['ADMINISTRATORS'] = ($auth->acl_get('a_authadmins')) ? $filename . $SID . '&mode=administrators' : ''; return; } define('IN_PHPBB', 1); // Include files $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); require($phpbb_root_path . 'includes/functions_admin.'.$phpEx); // Define some vars if (isset($_REQUEST['f'])) { $forum_id = intval($_REQUEST['f']); $forum_sql = " WHERE forum_id = $forum_id"; } else { $forum_id = 0; $forum_sql = ''; } $mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; // Start program proper switch ($mode) { case 'forums': $l_title = $user->lang['PERMISSIONS']; $l_title_explain = $user->lang['PERMISSIONS_EXPLAIN']; $which_acl = 'a_auth'; break; case 'moderators': $l_title = $user->lang['MODERATORS']; $l_title_explain = $user->lang['MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; break; case 'supermoderators': $l_title = $user->lang['SUPER_MODERATORS']; $l_title_explain = $user->lang['SUPER_MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; break; case 'administrators': $l_title = $user->lang['ADMINISTRATORS']; $l_title_explain = $user->lang['ADMINISTRATORS_EXPLAIN']; $which_acl = 'a_authadmins'; break; } // Permission check if (!$auth->acl_get($which_acl)) { trigger_error($user->lang['NO_ADMIN']); } // Call update or delete, both can take multiple user/group // ids. Additionally inheritance is handled (by the auth API) if (isset($_POST['update'])) { $auth_admin = new auth_admin(); // Admin wants subforums to inherit permissions ... so handle this if (!empty($_POST['inherit'])) { array_push($_POST['inherit'], $forum_id); $forum_id = $_POST['inherit']; } foreach ($_POST['entries'] as $id) { $auth_admin->acl_set($_POST['type'], $forum_id, $id, $_POST['option']); } trigger_error('Permissions updated successfully'); } else if (isset($_POST['delete'])) { $auth_admin = new auth_admin(); $option_ids = false; if (!empty($_POST['option'])) { $sql = "SELECT auth_option_id FROM " . ACL_OPTIONS_TABLE . " WHERE auth_value LIKE '" . $_POST['option'] . "_%'"; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { $option_ids = array(); do { $option_ids[] = $row['auth_option_id']; } while($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); } foreach ($_POST['entries'] as $id) { $auth_admin->acl_delete($_POST['type'], $forum_id, $id, $option_ids); } trigger_error('Permissions updated successfully'); } // Get required information, either all forums if no id was // specified or just the requsted if it was if (!empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators') { // Clear some vars, grab some info if relevant ... $s_hidden_fields = ''; if (!empty($forum_id)) { $sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $result = $db->sql_query($sql); $forum_info = $db->sql_fetchrow($result); $db->sql_freeresult($result); $l_title .= ' : ' . $forum_info['forum_name'] . ''; } // Generate header page_header($l_title); ?>
sql_query($sql); $group_list = ''; while ($row = $db->sql_fetchrow($result)) { $group_list .= ''; } $db->sql_freeresult($result); if (empty($_POST['advanced']) || empty($_POST['entries'])) { ?>lang['Users']; ?> |
lang['Groups']; ?> |
lang['ACL_EXPLAIN']; ?>