acl_get('a_auth')) ? $filename . $SID . '&mode=forum' : ''; $module['FORUM']['MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=mod' : ''; $module['FORUM']['SUPER_MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=supermod' : ''; $module['FORUM']['ADMINISTRATORS'] = ($auth->acl_get('a_authadmins')) ? $filename . $SID . '&mode=admin' : ''; $module['USER']['PERMISSIONS'] = ($auth->acl_get('a_authusers')) ? $filename . $SID . '&mode=user' : ''; $module['GROUP']['PERMISSIONS'] = ($auth->acl_get('a_authgroups')) ? $filename . $SID . '&mode=group' : ''; return; } define('IN_PHPBB', 1); // Include files $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // Grab and set some basic parameters // // 'mode' determines what we're altering; administrators, users, deps, etc. // 'type' is used primarily for deps and contains the original 'mode' $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; $type = (isset($_REQUEST['type'])) ? htmlspecialchars($_REQUEST['type']) : ''; $action = (isset($_REQUEST['action'])) ? htmlspecialchars($_REQUEST['action']) : ''; // Submitted setting data // // 'auth_settings' contains the submitted option settings assigned to options, should be an // associative array // 'auth_setting' contains the value of the submitted 'auth_option', an integer value used // mainly by deps mode // 'auth_option' contains a single auth_option string, used mainly by deps mode $auth_settings = (isset($_POST['settings'])) ? $_POST['settings'] : array(); $auth_option = (isset($_REQUEST['option'])) ? htmlspecialchars($_REQUEST['option']) : ''; $auth_setting = (isset($_REQUEST['setting'])) ? intval($_REQUEST['setting']) : ''; // Forum, User or Group information // // 'ug_type' is either user or groups used mainly for forum/admin/mod permissions // 'ug_data' contains the list of usernames, user_id's or group_ids for the 'ug_type' // 'forum_id' contains the list of forums, 0 is used for "All forums", must be an array $ug_type = (isset($_REQUEST['ug_type'])) ? htmlspecialchars($_REQUEST['ug_type']) : ''; $ug_data = (isset($_POST['ug_data'])) ? $_POST['ug_data'] : ''; $forum_id = (isset($_REQUEST['f'])) ? ((!is_array($_REQUEST['f'])) ? array(intval($_REQUEST['f'])) : array_filter($_REQUEST['f'], 'int')) : array(0); $username = (isset($_REQUEST['username'])) ? $_REQUEST['username'] : ''; $group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : ''; // What mode are we running? So we can output the correct title, explanation // and set the sql_option_mode/acl check switch ($mode) { case 'forum': $l_title = $user->lang['PERMISSIONS']; $l_title_explain = $user->lang['PERMISSIONS_EXPLAIN']; $which_acl = 'a_auth'; $sql_option_mode = 'f'; break; case 'mod': $l_title = $user->lang['MODERATORS']; $l_title_explain = $user->lang['MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; $sql_option_mode = 'm'; break; case 'supermod': $l_title = $user->lang['SUPER_MODERATORS']; $l_title_explain = $user->lang['SUPER_MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; $sql_option_mode = 'm'; break; case 'admin': $l_title = $user->lang['ADMINISTRATORS']; $l_title_explain = $user->lang['ADMINISTRATORS_EXPLAIN']; $which_acl = 'a_authadmins'; $sql_option_mode = 'a'; break; case 'user': $l_title = $user->lang['USER_PERMISSIONS']; $l_title_explain = $user->lang['USER_PERMISSIONS_EXPLAIN']; $which_acl = 'a_authusers'; $sql_option_mode = 'u'; break; case 'group': $l_title = $user->lang['GROUP_PERMISSIONS']; $l_title_explain = $user->lang['GROUP_PERMISSIONS_EXPLAIN']; $which_acl = 'a_authgroups'; $sql_option_mode = 'u'; break; case 'deps': $l_title = $user->lang['DEPENDENCIES']; $l_title_explain = $user->lang['DEPENDENCIES_EXPLAIN']; $which_acl = 'a_authdeps'; break; } // Permission check if (!$auth->acl_get($which_acl)) { trigger_error($user->lang['NO_ADMIN']); } // Are we setting deps? If we are we need to re-run the mode match above for the // relevant 'new' mode if ($mode == 'deps') { switch ($type) { case 'mod': case 'supermod': $which_acl = 'a_authmods'; $sql_option_mode = 'm'; break; case 'admin': $which_acl = 'a_authadmins'; $sql_option_mode = 'a'; break; } // Permission check if (!$auth->acl_get($which_acl)) { trigger_error($user->lang['NO_ADMIN']); } } // // // OUTPUT PAGE // // page_header($l_title); $auth_options = $auth_settings = array(); // Grab the list of options ... if we're in deps // mode we want all options, else we skip the master // options $sql_founder = ($user->data['user_founder']) ? ' AND founder_only <> 1' : ''; $sql_limit_option = ($mode == 'deps') ? '' : "AND auth_option <> '" . $sql_option_mode . "_'"; $sql = "SELECT auth_option_id, auth_option FROM " . ACL_OPTIONS_TABLE . " WHERE auth_option LIKE '" . $sql_option_mode . "_%' $sql_limit_option $sql_founder"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $auth_options[] = $row; } $db->sql_freeresult($result); unset($sql_limit_option); // Now we'll build a list of preset options ... $preset_options = $preset_js = $preset_update_options = ''; $holding = array(); // Do we have a parent forum? If so offer option to inherit from that if ($forum_info['parent_id'] != 0) { switch ($ug_type) { case 'group': $sql = "SELECT o.auth_option, a.auth_setting FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_option LIKE '" . $sql_option_mode . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.group_id IN ($where_sql)"; break; case 'user': $sql = "SELECT o.auth_option, a.auth_setting FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_option LIKE '" . $sql_option_mode . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.user_id IN ($where_sql)"; break; } $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { do { switch ($row['auth_setting']) { case ACL_ALLOW: $holding['allow'] .= $row['auth_option'] . ', '; break; case ACL_DENY: $holding['deny'] .= $row['auth_option'] . ', '; break; case ACL_INHERIT: $holding['inherit'] .= $row['auth_option'] . ', '; break; } } while ($row = $db->sql_fetchrow($result)); $preset_options .= ''; $preset_js .= "\tpresets['preset_0'] = new Array();" . "\n"; $preset_js .= "\tpresets['preset_0'] = new preset_obj('" . $holding['allow'] . "', '" . $holding['deny'] . "', '" . $holding['inherit'] . "');\n"; } $db->sql_freeresult($result); } // Look for custom presets $sql = "SELECT preset_id, preset_name, preset_data FROM " . ACL_PRESETS_TABLE . " WHERE preset_type = '$sql_option_mode' ORDER BY preset_id ASC"; $result = $db->sql_query($sql); if ($row = $db->sql_fetchrow($result)) { do { $preset_update_options .= ''; $preset_options .= ''; $preset_data = unserialize($row['preset_data']); foreach ($preset_data as $preset_type => $preset_type_ary) { $holding[$preset_type] = ''; foreach ($preset_type_ary as $preset_option) { $holding[$preset_type] .= "$preset_option, "; } } $preset_js .= "\tpresets['preset_" . $row['preset_id'] . "'] = new Array();" . "\n"; $preset_js .= "\tpresets['preset_" . $row['preset_id'] . "'] = new preset_obj('" . $holding['allow'] . "', '" . $holding['deny'] . "', '" . $holding['inherit'] . "');\n"; } while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); unset($holding); ?>

">' . ((!empty($user->lang['acl_' . $option['auth_option']])) ? $user->lang['acl_' . $option['auth_option']] : (($option['auth_option'] == $sql_option_mode . '_') ? 'Any option' : ucfirst(preg_replace('#.*?_#', '', $option['auth_option'])))) . ''; } unset($auth_options); unset($option); // Define the Yes, No, Unset selections $values = array(ACL_DENY => $user->lang['NO'], ACL_ALLOW => $user->lang['YES'], ACL_INHERIT => $user->lang['UNSET']); foreach ($values as $value => $option) { $dep_auth_values .= ''; } unset($values); unset($option); $dep_auth_forums = make_forum_select($forum_id, false, false); // We've grabbed the list of options for this mode now we need to // grab the list of options we can set dependencies for switch ($sql_option_mode) { case 'a': $sql_auth_option = "(auth_option LIKE 'a_%' AND auth_option <> 'a_') OR (auth_option LIKE 'm_%' AND auth_option <> 'm_')"; break; case 'm': $sql_auth_option = "auth_option LIKE 'm_%' AND auth_option <> 'm_'"; break; } $founder_sql = ($user->data['user_founder']) ? ' AND founder_only <> 1' : ''; $sql = "SELECT auth_option FROM " . ACL_OPTIONS_TABLE . " WHERE $sql_auth_option $founder_sql"; $result = $db->sql_query($sql); $auth_options = array(); while ($row = $db->sql_fetchrow($result)) { $auth_options[] = $row; } $db->sql_freeresult($result); ?>
">
 
Changing option:
To value:
Will set options in:

lang['PRESETS']; ?>:
lang['acl_' . $auth_options[$i]['auth_option']])) ? $user->lang['acl_' . $auth_options[$i]['auth_option']] : ucfirst(preg_replace('#.*?_#', '', $auth_options[$i]['auth_option'])); $selected_yes = $selected_no = $selected_unset = ''; if (!empty($_POST['presetsave']) || !empty($_POST['presetdel'])) { $selected_yes = ($_POST['option'][$auth_settings[$i]['auth_option']] == ACL_ALLOW) ? ' checked="checked"' : ''; $selected_no = ($_POST['option'][$auth_settings[$i]['auth_option']] == ACL_DENY) ? ' checked="checked"' : ''; $selected_unset = ($_POST['option'][$auth_settings[$i]['auth_option']] == ACL_INHERIT) ? ' checked="checked"' : ''; } else { $selected_yes = (isset($auth_settings[$auth_options[$i]['auth_option']]) && $auth_settings[$auth_options[$i]['auth_option']] == ACL_ALLOW) ? ' checked="checked"' : ''; $selected_no = (isset($auth_settings[$auth_options[$i]['auth_option']]) && $auth_settings[$auth_options[$i]['auth_option']] == ACL_DENY) ? ' checked="checked"' : ''; $selected_unset = (!isset($auth_settings[$auth_options[$i]['auth_option']]) || $auth_settings[$auth_options[$i]['auth_option']] == ACL_INHERIT) ? ' checked="checked"' : ''; } // Output dependency links? $dep_x_yes = $dep_x_no = $dep_x_unset = ''; if ($mode != 'deps') { $dep_x_open = ' X'; $dep_x_yes = $dep_x_open . ACL_ALLOW . $dep_x_close; $dep_x_no = $dep_x_open . ACL_DENY . $dep_x_close; $dep_x_unset = $dep_x_open . ACL_INHERIT . $dep_x_close; } ?> acl_gets('a_events', 'a_cron') && $mode != 'deps') { $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; ?>
 lang['OPTION']; ?>   lang['YES']; ?>   lang['NO']; ?>   lang['UNSET']; ?> 
  /> /> />
lang['ACL_SUBFORUMS']; ?>
lang['ACL_SUBFORUMS_EXPLAIN']; ?>
lang['MARK_ALL']; ?> :: lang['UNMARK_ALL']; ?>
  

lang['PRESETS']; ?>
lang['PRESETS_EXPLAIN']; ?>
lang['SELECT_PRESET']; ?>:
lang['PRESET_NAME']; ?>:
 

lang['USERS']; ?>

lang['GROUPS']; ?>

">sql_query($sql); $users = ''; while ($row = $db->sql_fetchrow($result)) { $users .= ''; } $db->sql_freeresult($result); ?>
lang['MANAGE_USERS']; ?>
 
">sql_query($sql); $groups = ''; while ($row = $db->sql_fetchrow($result)) { $groups .= ''; } $db->sql_freeresult($result); $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " ORDER BY group_type DESC, group_name"; $result = $db->sql_query($sql); $group_list = ''; while ($row = $db->sql_fetchrow($result)) { $group_list .= ''; } $db->sql_freeresult($result); ?>
lang['MANAGE_GROUPS']; ?>
 
">
lang['ADD_USERS']; ?>
    &mode=searchuser&form=2&field=entries', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" />
">
lang['ADD_GROUPS']; ?>
 

">sql_query($sql); $group_options = ''; if ($row = $db->sql_fetchrow($result)) { do { $group_options .= (($group_options != '') ? ', ' : '') . ''; } while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); ?>
lang['LOOK_UP_FORUM']; ?>
    
lang['Select_a_User']; ?>
', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;" />
lang['SELECT_A_GROUP']; ?>