diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-04-11 15:29:06 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-04-11 15:29:06 +0000 |
commit | c12aaefc9c712434ba29e7d1cec7db82a2039a26 (patch) | |
tree | 3f508628834eca4dc21e095d53c6288f6bebae9d /phpBB/adm | |
parent | 4feb08390cbd72224b5d8147ba274f0558b6cbb5 (diff) | |
download | forums-c12aaefc9c712434ba29e7d1cec7db82a2039a26.tar forums-c12aaefc9c712434ba29e7d1cec7db82a2039a26.tar.gz forums-c12aaefc9c712434ba29e7d1cec7db82a2039a26.tar.bz2 forums-c12aaefc9c712434ba29e7d1cec7db82a2039a26.tar.xz forums-c12aaefc9c712434ba29e7d1cec7db82a2039a26.zip |
Very, very broken right now ... re-working it as we speak
git-svn-id: file:///svn/phpbb/trunk@3814 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
-rw-r--r-- | phpBB/adm/admin_permissions.php | 996 |
1 files changed, 334 insertions, 662 deletions
diff --git a/phpBB/adm/admin_permissions.php b/phpBB/adm/admin_permissions.php index c6c60429b5..e4750c4a0f 100644 --- a/phpBB/adm/admin_permissions.php +++ b/phpBB/adm/admin_permissions.php @@ -22,13 +22,12 @@ if (!empty($setmodules)) { $filename = basename(__FILE__); - $module['FORUM']['PERMISSIONS'] = ($auth->acl_get('a_auth')) ? $filename . $SID . '&mode=forums' : ''; - $module['FORUM']['MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=moderators' : ''; - $module['FORUM']['SUPER_MODERATORS'] = ($auth->acl_get('a_authmods')) ? $filename . $SID . '&mode=supermoderators' : ''; - $module['FORUM']['ADMINISTRATORS'] = ($auth->acl_get('a_authadmins')) ? $filename . $SID . '&mode=administrators' : ''; - $module['USER']['PERMISSIONS'] = ($auth->acl_get('a_authusers')) ? $filename . $SID . '&mode=users' : ''; - $module['GROUP']['PERMISSIONS'] = ($auth->acl_get('a_authgroups')) ? $filename . $SID . '&mode=groups' : ''; - $module['GENERAL']['DEPENDENCIES'] = ($auth->acl_get('a_authdeps')) ? $filename . $SID . '&mode=deps' : ''; + $module['FORUM']['PERMISSIONS'] = ($auth->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; } @@ -40,6 +39,37 @@ 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' +$ug_type = (isset($_REQUEST['ug_type'])) ? htmlspecialchars($_REQUEST['ug_type']) : ''; +$ug_data = (isset($_POST['ug_data'])) ? $_POST['ug_data'] : ''; + + + + + + // Define some vars $forum_id = 0; $forum_sql = ''; @@ -49,55 +79,64 @@ if (isset($_REQUEST['f'])) $forum_sql = " WHERE forum_id = $forum_id"; } -$mode = (isset($_REQUEST['mode'])) ? $_REQUEST['mode'] : ''; + $username = (isset($_REQUEST['username'])) ? $_REQUEST['username'] : ''; $group_id = (isset($_REQUEST['g'])) ? intval($_REQUEST['g']) : ''; -$entries = (isset($_POST['entries'])) ? $_POST['entries'] : ''; -// Start program proper + + + + + + + + + +// What mode are we running? So we can output the correct title, explanation +// and set the sql_option_mode/acl check switch ($mode) { - case 'forums': + case 'forum': $l_title = $user->lang['PERMISSIONS']; $l_title_explain = $user->lang['PERMISSIONS_EXPLAIN']; $which_acl = 'a_auth'; - $type_sql = 'f'; + $sql_option_mode = 'f'; break; - case 'moderators': + case 'mod': $l_title = $user->lang['MODERATORS']; $l_title_explain = $user->lang['MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; - $type_sql = 'm'; + $sql_option_mode = 'm'; break; - case 'supermoderators': + case 'supermod': $l_title = $user->lang['SUPER_MODERATORS']; $l_title_explain = $user->lang['SUPER_MODERATORS_EXPLAIN']; $which_acl = 'a_authmods'; - $type_sql = 'm'; + $sql_option_mode = 'm'; break; - case 'administrators': + case 'admin': $l_title = $user->lang['ADMINISTRATORS']; $l_title_explain = $user->lang['ADMINISTRATORS_EXPLAIN']; $which_acl = 'a_authadmins'; - $type_sql = 'a'; + $sql_option_mode = 'a'; break; - case 'users': + case 'user': $l_title = $user->lang['USER_PERMISSIONS']; $l_title_explain = $user->lang['USER_PERMISSIONS_EXPLAIN']; $which_acl = 'a_authusers'; - $type_sql = 'u'; + $sql_option_mode = 'u'; break; - case 'groups': + case 'group': $l_title = $user->lang['GROUP_PERMISSIONS']; $l_title_explain = $user->lang['GROUP_PERMISSIONS_EXPLAIN']; $which_acl = 'a_authgroups'; - $type_sql = 'u'; + $sql_option_mode = 'u'; break; case 'deps': @@ -114,597 +153,76 @@ 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) -//switch ($_POST['runas']) -//{ -// case 'now': - 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']); - } - - cache_moderators(); - - trigger_error($user->lang['AUTH_UPDATED']); - } - 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); - } - - cache_moderators(); - - trigger_error($user->lang['AUTH_UPDATED']); - } - else if (isset($_POST['presetsave'])) - { - $holding_ary = array(); - foreach ($_POST['option'] as $acl_option => $allow_deny) - { - switch ($allow_deny) - { - case ACL_ALLOW: - $holding_ary['allow'][] = $acl_option; - break; - case ACL_DENY: - $holding_ary['deny'][] = $acl_option; - break; - case ACL_INHERIT: - $holding_ary['inherit'][] = $acl_option; - break; - } - } - - $sql = array( - 'preset_user_id' => $user->data['user_id'], - 'preset_type' => $type_sql, - 'preset_data' => $db->sql_escape(serialize($holding_ary)) - ); - - if (!empty($_POST['presetname'])) - { - $sql['preset_name'] = $db->sql_escape($_POST['presetname']); - } - - if (!empty($_POST['presetname']) || $_POST['presetoption'] != -1) - { - $sql = ($_POST['presetoption'] == -1) ? 'INSERT INTO ' . ACL_PRESETS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql) : 'UPDATE ' . ACL_PRESETS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql) . ' WHERE preset_id =' . $_POST['presetoption']; - $db->sql_query($sql); - } - } - else if (isset($_POST['presetdel'])) - { - if (!empty($_POST['presetoption'])) - { - $sql = "DELETE FROM " . ACL_PRESETS_TABLE . " - WHERE preset_id = " . intval($_POST['presetoption']); - $db->sql_query($sql); - } - } -// break; -//} - - - - - - +// Are we setting deps? If we are we need to re-run the mode match above for the +// relevant 'new' mode if ($mode == 'deps') { - // Generate header - page_header($l_title); - - $dep_quick_access = (isset($_POST['dep_quick_access'])) ? htmlspecialchars($_POST['dep_quick_access']) : ''; - $dep_type = (isset($_POST['dep_type'])) ? htmlspecialchars($_POST['dep_type']) : -1; - $dep_option = (isset($_POST['dep_option'])) ? $_POST['dep_option'] : array(); - $dep_value = (isset($_POST['dep_value'])) ? intval($_POST['dep_value']) : -1; - $dep_forum_id = (isset($_POST['f'])) ? $_POST['f'] : array(0); - - $acl_types = $auth_options = $value_options = $forum_options = ''; - - $types = array('admin' => $user->lang['ADMINISTRATORS'], 'supermod' => $user->lang['SUPER_MODERATORS'], 'mod' => $user->lang['MODERATORS']); - - foreach ($types as $value => $option) - { - $acl_types .= '<option value="' . $value . '"' . (($dep_type == $value) ? ' selected="selected"' : '') . '>' . $option . '</option>'; - } - - if (!empty($dep_type)) - { - switch ($dep_type) - { - case 'admin': - $dep_type = 'a'; - break; - case 'supermod': - case 'mod': - $dep_type = 'm'; - break; - } - - $founder_sql = ($user->data['user_founder']) ? ' AND founder_only <> 1' : ''; - $sql = "SELECT auth_value - FROM " . ACL_OPTIONS_TABLE . " - WHERE auth_value LIKE '" . $dep_type . "_%' - $founder_sql"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $auth_options .= '<option value="' . $row['auth_value'] . '"' . ((in_array($row['auth_value'], $dep_option)) ? ' selected="selected"' : '') . '>' . ((!empty($user->lang['acl_' . $row['auth_value']])) ? $user->lang['acl_' . $row['auth_value']] : (($row['auth_value'] == $dep_type . '_') ? 'Any option' : ucfirst(preg_replace('#.*?_#', '', $row['auth_value'])))) . '</option>'; - } - $db->sql_freeresult($result); - } - - $values = array(ACL_DENY => $user->lang['NO'], ACL_ALLOW => $user->lang['YES'], ACL_INHERIT => $user->lang['UNSET']); - - foreach ($values as $value => $option) - { - $value_options .= '<option value="' . $value . '"' . (($dep_value === $value) ? ' selected="selected"' : '') . '>' . $option . '</option>'; - } - - $forum_options = make_forum_select($dep_forum_id, false, false); - - // Look for custom presets - $sql = "SELECT preset_id, preset_name, preset_data - FROM " . ACL_PRESETS_TABLE . " - WHERE preset_type = '$type_sql' - ORDER BY preset_id ASC"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $preset_update_options .= '<option value="' . $row['preset_id'] . '">' . $row['preset_name'] . '</option>'; - $preset_options .= '<option value="preset_' . $row['preset_id'] . '">' . $row['preset_name'] . '</option>'; - - $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)); - } - unset($holding); - - if ($dep_quick_access) - { - $sql = 'SELECT auth_deps - FROM ' . ACL_DEPS_TABLE . " - WHERE dep_name ='$dep_quick_access'"; - $result = $db->sql_query($sql); - - $auth_values = array(); - if ($row = $db->sql_fetchrow($result)) - { - $auth_values = unserialize($row); - } - $db->sql_freeresult($result); - } - -?> - -<script language="Javascript" type="text/javascript"> -<!-- - - var presets = new Array(); -<?php - - echo $preset_js; - -?> - - function preset_obj(allow, deny, inherit) - { - this.allow = allow; - this.deny = deny; - this.inherit = inherit; - } - - function use_preset(option) + switch ($type) { - if (option) - { - document.acl.set.selectedIndex = 0; - var expr = new RegExp(/\d+/); - for (i = 0; i < document.acl.length; i++) - { - var elem = document.acl.elements[i]; - if (elem.name.indexOf('aclopt') == 0) - { - switch (option) - { - case 'all_yes': - if (elem.value == <?php echo ACL_ALLOW; ?>) - elem.checked = true; - break; - case 'all_no': - if (elem.value == <?php echo ACL_DENY; ?>) - elem.checked = true; - break; - case 'all_unset': - if (elem.value == <?php echo ACL_INHERIT; ?>) - elem.checked = true; - break; - default: - option_name = elem.name.substr(7, elem.name.length - 8); + case 'mod': + case 'supermod': + $which_acl = 'a_authmods'; + $sql_option_mode = 'm'; + break; - if (presets[option].allow.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_ALLOW; ?>) - elem.checked = true; - else if (presets[option].deny.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_DENY; ?>) - elem.checked = true; - else if (presets[option].inherit.indexOf(option_name + ',') != -1 && elem.value == <?php echo ACL_INHERIT; ?>) - elem.checked = true; - break; - } - } - } - } + case 'admin': + $which_acl = 'a_authadmins'; + $sql_option_mode = 'a'; + break; } -//--> -</script> - -<h1><?php echo $l_title; ?></h1> -<p><?php echo $l_title_explain; ?></p> - -<table cellspacing="0" cellpadding="0" border="0" align="center"> - <tr> - <td align="right"><form method="post" name="deps" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><?php echo $user->lang['QUICK ACCESS']; ?>: <select name="set" onchange="use_preset(this.options[this.selectedIndex].value);"><option class="sep"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><?php - - echo ($preset_options) ? '<option class="sep">' . $user->lang['USER_PRESETS'] . ' ->' . '</option>' . $preset_options : ''; - -?></select><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0"> - <tr> - <th colspan="2"> </th> - </tr> - <tr> - <td class="row1" width="150">Permission type: </td> - <td class="row2"><select name="dep_type" onchange="if (this.options[this.selectedIndex].value != -1) this.form.submit();"><option value="-1"<?php - - echo ($dep_type == -1) ? ' selected="selected"' : ''; - -?>>Choose type</option><?php echo $acl_types; ?></select></td> - </tr> -<?php - - if ($dep_type != -1) + // Permission check + if (!$auth->acl_get($which_acl)) { - -?> - <tr> - <td class="row1" width="150">Changing option:</td> - <td class="row2"><select name="dep_option[]" multiple="4"><?php echo $auth_options; ?></select></td> - </tr> - <tr> - <td class="row1" width="150">To value:</td> - <td class="row2"><select name="dep_value"><option value="-1"<?php - - echo ($dep_value == -1) ? ' selected="selected"' : ''; - -?>>Choose value</option><?php echo $value_options; ?></select></td> - </tr> - <tr> - <td class="row1" width="150">Will set options in: <br /><span class="gensmall"></span></td> - <td class="row2"><select name="f[]" multiple="4"><option class="sep" value="0"<?php - - echo ($dep_forum_id == 0) ? ' selected="selected"' : ''; - -?>>All current forums</option><?php - - if ($dep_type == 'mod') - { - -?><option class="sep" value="-2">Affected forum</option><?php - - } - - echo $forum_options; ?></select></td> - </tr> - <tr> - <td class="row1">Quick access name:</td> - <td class="row2"><input class="post" type="text" name="dep_name" value="" /></td> - </tr> - <tr> - <td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="setdep" value="<?php echo $user->lang['SUBMIT']; ?>" /></td> - </tr> -<?php - + trigger_error($user->lang['NO_ADMIN']); } +} -?> - </table></form></td> - </tr> -<?php - - if (isset($_POST['setdep']) && $dep_option && $dep_value != -1) - { - -?> - <tr> - <td align="right"><form method="post" name="acl" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><?php echo $user->lang['PRESETS']; ?>: <select name="set" onchange="use_preset(this.options[this.selectedIndex].value);"><option class="sep"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><option value="all_yes"><?php echo $user->lang['ALL_YES']; ?></option><option value="all_no"><?php echo $user->lang['ALL_NO']; ?></option><option value="all_unset"><?php echo $user->lang['ALL_UNSET']; ?></option><?php - - echo ($preset_options) ? '<option class="sep">' . $user->lang['USER_PRESETS'] . ' ->' . '</option>' . $preset_options : ''; - -?></select></td> - </tr> - <tr> - <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0"> - <tr> - <th> <?php echo $user->lang['OPTION']; ?> </th> - <th width="50"> <?php echo $user->lang['YES']; ?> </th> - <th width="50"> <?php echo $user->lang['NO']; ?> </th> - <th width="50"> <?php echo $user->lang['UNSET']; ?> </th> - </tr> -<?php - - $founder_sql = ($user->data['user_founder']) ? ' AND founder_only <> 1' : ''; - $sql = "SELECT auth_option_id, auth_value - FROM " . ACL_OPTIONS_TABLE . " - WHERE auth_value LIKE 'f_%' - AND auth_value <> 'f_' - $founder_sql"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; - - $l_can_cell = (!empty($user->lang['acl_' . $row['auth_value']])) ? $user->lang['acl_' . $row['auth_value']] : ucfirst(preg_replace('#.*?_#', '', $row['auth_value'])); - - $allow_type = (isset($auth_values[$row['auth_value']]) && $auth_values[$row['auth_value']] == ACL_ALLOW) ? ' checked="checked"' : ''; - $deny_type = (isset($auth_values[$row['auth_value']]) && $auth_values[$row['auth_value']] == ACL_DENY) ? ' checked="checked"' : ''; - $inherit_type = (!isset($auth_values[$row['auth_value']]) || $auth_values[$row['auth_value']] == ACL_INHERIT) ? ' checked="checked"' : ''; - -?> - <tr> - <td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="aclopt[<?php echo $row['auth_value']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="aclopt[<?php echo $row['auth_value']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="aclopt[<?php echo $row['auth_value']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td> - </tr> -<?php - - } -?> - <tr> - <td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" /></td> - </tr> - </table></form></td> - </tr> -<?php - } - -?> -</table> -<?php - page_footer(); -} -else if (!empty($forum_id) || - !empty($group_id) || - !empty($username) || - $mode == 'administrators' || - $mode == 'supermoderators') -{ - // Get required information, either all forums if no id was - // specified or just the requsted if it was - // Clear some vars, grab some info if relevant ... - $s_hidden_fields = ''; - if (!empty($forum_id)) - { - $sql = "SELECT forum_name, parent_id - FROM " . FORUMS_TABLE . " - WHERE forum_id = $forum_id"; - $result = $db->sql_query($sql); - if (!($forum_info = $db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_FORUM']); - } - $db->sql_freeresult($result); - $l_title .= ' : <i>' . $forum_info['forum_name'] . '</i>'; - } - else if (!empty($username)) - { - $sql = "SELECT user_id - FROM " . USERS_TABLE . " - WHERE username IN ('$username')"; - $result = $db->sql_query($sql); - if (!($row = $db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_USER']); - } - $db->sql_freeresult($result); +// +// +// OUTPUT PAGE +// +// +page_header($l_title); - $entries = array($row['user_id']); - $l_title .= ' : <i>' . $username . '</i>'; - } - else if (!empty($group_id)) - { - $sql = "SELECT group_name - FROM " . GROUPS_TABLE . " - WHERE group_id IN ($group_id)"; - $result = $db->sql_query($sql); - if (!($row = $db->sql_fetchrow($result))) - { - trigger_error($user->lang['NO_GROUP']); - } - $db->sql_freeresult($result); - $entries = array($group_id); - $l_title .= ' : <i>' . $row['group_name'] . '</i>'; - } - // Generate header - page_header($l_title); -?> -<h1><?php echo $l_title; ?></h1> -<?php - switch ($mode) - { - case 'forums': - case 'moderators': - $forum_sql = "AND a.forum_id = $forum_id"; - break; + $auth_options = $auth_settings = array(); - case 'supermoderators': - case 'administrators': - case 'users': - case 'groups': - $forum_sql = 'AND a.forum_id = 0'; - break; - } - - if (!empty($entries)) - { - // Founder only operations ... these operations can - // only be altered by someone with founder status - $founder_sql = ($user->data['user_founder']) ? ' AND founder_only <> 1' : ''; - $sql = "SELECT auth_option_id, auth_value + // 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_value LIKE '" . $type_sql . "_%' - AND auth_value <> '" . $type_sql . "_' - $founder_sql"; + WHERE auth_option LIKE '" . $sql_option_mode . "_%' + $sql_limit_option + $sql_founder"; $result = $db->sql_query($sql); - $auth_options = array(); while ($row = $db->sql_fetchrow($result)) { $auth_options[] = $row; } $db->sql_freeresult($result); - if ($_POST['type'] == 'user' && !empty($_POST['new'])) - { - $entries = explode("\n", $entries); - } - - $where_sql = ''; - foreach ($entries as $value) - { - $where_sql .= (($where_sql != '') ? ', ' : '') . (($_POST['type'] == 'user' && !empty($_POST['new'])) ? "'$value'" : intval($value)); - } - - $ug = '';; - $ug_hidden = ''; - $auth_values = array(); - - switch ($_POST['type']) - { - case 'group': - $l_type = 'Group'; - - $sql = "SELECT g.group_id AS id, g.group_name AS name, o.auth_value, a.auth_allow_deny FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id $forum_sql AND g.group_id = a.group_id AND g.group_id IN ($where_sql) ORDER BY g.group_name ASC"; - break; - - case 'user': - $l_type = 'User'; - - $sql = "SELECT u.user_id AS id, u.username AS name, u.user_founder, o.auth_value, a.auth_allow_deny FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id $forum_sql AND u.user_id = a.user_id AND u.user_id IN ($where_sql) ORDER BY u.username, u.user_regdate ASC"; break; - } - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $ug_test = (!empty($user->lang[$row['name']])) ? $user->lang[$row['name']] : $row['name']; - $ug .= (!strstr($ug, $ug_test)) ? $ug_test . "\n" : ''; - - $ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />'; - $ug_hidden .= (!strstr($ug_hidden, $ug_test)) ? $ug_test : ''; - - $auth_values[$row['auth_value']] = (isset($auth_group[$row['auth_value']])) ? min($auth_group[$row['auth_value']], $row['auth_allow_deny']) : $row['auth_allow_deny']; - } - while ($row = $db->sql_fetchrow($result)); - } - else - { - $db->sql_freeresult($result); - - $sql = ($_POST['type'] == 'group') ? "SELECT group_id AS id, group_name AS name, group_type FROM " . GROUPS_TABLE . " WHERE group_id IN ($where_sql) ORDER BY group_name ASC" : "SELECT user_id AS id, username AS name FROM " . USERS_TABLE . " WHERE username IN ($where_sql) ORDER BY username, user_regdate ASC"; - $result = $db->sql_query($sql); - - if ($row = $db->sql_fetchrow($result)) - { - do - { - $ug_test = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang[$row['name']] : $row['name']; - $ug .= (!strstr($ug, $ug_test)) ? $ug_test . "\n" : ''; - - $ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />'; - $ug_hidden .= (!strstr($ug_hidden, $ug_test)) ? $ug_test : ''; - - $auth_values[$row['auth_value']] = (isset($auth_group[$row['auth_value']])) ? min($auth_group[$row['auth_value']], $row['auth_allow_deny']) : $row['auth_allow_deny']; - } - while ($row = $db->sql_fetchrow($result)); - } - else - { - } - } - $db->sql_freeresult($result); + unset($sql_limit_option); // Now we'll build a list of preset options ... $preset_options = $preset_js = $preset_update_options = ''; @@ -713,14 +231,14 @@ else if (!empty($forum_id) || // Do we have a parent forum? If so offer option to inherit from that if ($forum_info['parent_id'] != 0) { - switch ($_POST['type']) + switch ($ug_type) { case 'group': - $sql = "SELECT o.auth_value, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.group_id IN ($where_sql)"; + $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_value, a.auth_allow_deny FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE o.auth_value LIKE '" . $type_sql . "_%' AND a.auth_option_id = o.auth_option_id AND a.forum_id = " . $forum_info['parent_id'] . " AND a.user_id IN ($where_sql)"; + $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); @@ -729,18 +247,18 @@ else if (!empty($forum_id) || { do { - switch ($row['auth_allow_deny']) + switch ($row['auth_setting']) { case ACL_ALLOW: - $holding['allow'] .= $row['auth_value'] . ', '; + $holding['allow'] .= $row['auth_option'] . ', '; break; case ACL_DENY: - $holding['deny'] .= $row['auth_value'] . ', '; + $holding['deny'] .= $row['auth_option'] . ', '; break; case ACL_INHERIT: - $holding['inherit'] .= $row['auth_value'] . ', '; + $holding['inherit'] .= $row['auth_option'] . ', '; break; } } @@ -756,7 +274,7 @@ else if (!empty($forum_id) || // Look for custom presets $sql = "SELECT preset_id, preset_name, preset_data FROM " . ACL_PRESETS_TABLE . " - WHERE preset_type = '$type_sql' + WHERE preset_type = '$sql_option_mode' ORDER BY preset_id ASC"; $result = $db->sql_query($sql); @@ -783,6 +301,8 @@ else if (!empty($forum_id) || } while ($row = $db->sql_fetchrow($result)); } + $db->sql_freeresult($result); + unset($holding); ?> @@ -853,109 +373,241 @@ else if (!empty($forum_id) || document.acl.elements[i].checked = status; } } + + function open_win(url, width, height) + { + aclwin = window.open(url, '_phpbbacl', 'HEIGHT=' + height + ',resizable=yes, scrollbars=yes,WIDTH=' + width); + if (window.focus) + aclwin.focus(); + } //--> </script> -<p><?php echo $user->lang['ACL_EXPLAIN']; ?></p> +<h1><?php echo $l_title; ?></h1> + +<p><?php echo $l_title_explain; ?></p> <form method="post" name="acl" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table cellspacing="2" cellpadding="0" border="0" align="center"> +<?php + + // The above query grabs the list of options for the required mode ... + // however for the deps system we need to grab the set of options for + // which dependencies are to be set + if ($mode == 'deps') + { + // Turn auth_options array above into the dep_auth_options list + $dep_auth_options = $dep_auth_values = $dep_auth_forums = ''; + foreach ($auth_options as $option) + { + $dep_auth_options .= '<option value="' . $option['auth_option'] . '"' . (($option['auth_option'] == $auth_option) ? ' selected="selected"' : '') . '>' . ((!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'])))) . '</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 .= '<option value="' . $value . '"' . (($value === $auth_setting) ? ' selected="selected"' : '') . '>' . $option . '</option>'; + } + 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); + +?> + <tr> + <td align="right"><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0"> + <tr> + <th colspan="2"> </th> + </tr> + <tr> + <td class="row1" width="150">Changing option:</td> + <td class="row2"><select name="dep_option"><?php echo $dep_auth_options; ?></select></td> + </tr> + <tr> + <td class="row1" width="150">To value:</td> + <td class="row2"><select name="dep_value"><option value="-1"<?php + + echo ($dep_value == -1) ? ' selected="selected"' : ''; + +?>>Choose value</option><?php echo $dep_auth_values; ?></select></td> + </tr> + <tr> + <td class="row1" width="150">Will set options in: <br /><span class="gensmall"></span></td> + <td class="row2"><select name="f[]" multiple="4" onchange="this.form.submit"><option class="sep" value="0"<?php + + echo (in_array(0, $dep_forum_id)) ? ' selected="selected"' : ''; + +?>>Current forums</option><?php + + if ($dep_type == 'mod') + { + +?><option class="sep" value="-2">Affected forum</option><?php + + } + + echo $dep_auth_forums; + +?></select></td> + </tr> + </table></td> + </tr> +<?php + + unset($dep_auth_options); + unset($dep_auth_values); + unset($dep_forum_options); + + } + // End deps output + + // This is the main listing of options + +?> <tr> <td align="right"><?php echo $user->lang['PRESETS']; ?>: <select name="set" onchange="use_preset(this.options[this.selectedIndex].value);"><option class="sep"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><option value="all_yes"><?php echo $user->lang['ALL_YES']; ?></option><option value="all_no"><?php echo $user->lang['ALL_NO']; ?></option><option value="all_unset"><?php echo $user->lang['ALL_UNSET']; ?></option><?php echo ($preset_options) ? '<option class="sep">' . $user->lang['USER_PRESETS'] . ' ->' . '</option>' . $preset_options : ''; ?></select></td> - </tr> - <tr> - <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> - <tr> - <th> <?php echo $user->lang['OPTION']; ?> </th> - <th width="50"> <?php echo $user->lang['YES']; ?> </th> - <th width="50"> <?php echo $user->lang['NO']; ?> </th> - <th width="50"> <?php echo $user->lang['UNSET']; ?> </th> - </tr> + </tr> + <tr> + <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> + <tr> + <th> <?php echo $user->lang['OPTION']; ?> </th> + <th width="50"> <?php echo $user->lang['YES']; ?> </th> + <th width="50"> <?php echo $user->lang['NO']; ?> </th> + <th width="50"> <?php echo $user->lang['UNSET']; ?> </th> + </tr> <?php for($i = 0; $i < sizeof($auth_options); $i++) { $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; - $l_can_cell = (!empty($user->lang['acl_' . $auth_options[$i]['auth_value']])) ? $user->lang['acl_' . $auth_options[$i]['auth_value']] : ucfirst(preg_replace('#.*?_#', '', $auth_options[$i]['auth_value'])); + $l_auth_option = (!empty($user->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'])) { - $allow_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_ALLOW) ? ' checked="checked"' : ''; - $deny_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_DENY) ? ' checked="checked"' : ''; - $inherit_type = ($_POST['option'][$auth_options[$i]['auth_value']] == ACL_INHERIT) ? ' checked="checked"' : ''; + $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 { - $allow_type = (isset($auth_values[$auth_options[$i]['auth_value']]) && $auth_values[$auth_options[$i]['auth_value']] == ACL_ALLOW) ? ' checked="checked"' : ''; - $deny_type = (isset($auth_values[$auth_options[$i]['auth_value']]) && $auth_values[$auth_options[$i]['auth_value']] == ACL_DENY) ? ' checked="checked"' : ''; - $inherit_type = (!isset($auth_values[$auth_options[$i]['auth_value']]) || $auth_values[$auth_options[$i]['auth_value']] == ACL_INHERIT) ? ' checked="checked"' : ''; + $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 = ' <a class="gensmall" style="vertical-align:top" href="javascript:open_win(\'' . "admin_permissions.$phpEx$SID&mode=deps&type=$mode&option=" . $auth_options[$i]['auth_option'] . "&setting="; + $dep_x_close = '\', 500, 500)" title="Set Dependency">X</a>'; + + $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; } ?> - <tr> - <td class="<?php echo $row_class; ?>" nowrap="nowrap"><?php echo $l_can_cell; ?> </td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td> - <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_value']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td> - </tr> + <tr> + <td class="<?php echo $row_class; ?>" nowrap="nowrap"><?php echo $l_auth_option; ?> </td> + + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $selected_yes; ?> /><?php echo $dep_x_yes; ?></td> + + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $selected_no; ?> /><?php echo $dep_x_no; ?></td> + + <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $selected_unset; ?> /><?php echo $dep_x_unset; ?></td> + </tr> <?php } // Subforum inheritance - if ($type_sql == 'f' || $type_sql == 'm') + if (($sql_option_mode == 'f' || $sql_option_mode == 'm') && $mode != 'deps') { $children = get_forum_branch($forum_id, 'children', 'descending', false); if (!empty($children)) { ?> - <tr> - <th colspan="4"><?php echo $user->lang['ACL_SUBFORUMS']; ?></th> - </tr> - <tr> - <td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0"> <tr> - <td class="gensmall" colspan="4" height="16" align="center"><?php echo $user->lang['ACL_SUBFORUMS_EXPLAIN']; ?></td> + <th colspan="4"><?php echo $user->lang['ACL_SUBFORUMS']; ?></th> </tr> + <tr> + <td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0"> + <tr> + <td class="gensmall" colspan="4" height="16" align="center"><?php echo $user->lang['ACL_SUBFORUMS_EXPLAIN']; ?></td> + </tr> <?php foreach ($children as $row) { ?> - <tr> - <td><input type="checkbox" name="inherit[]" value="<?php echo $row['forum_id']; ?>" /> <?php echo $row['forum_name']; ?></td> - </tr> + <tr> + <td><input type="checkbox" name="inherit[]" value="<?php echo $row['forum_id']; ?>" /> <?php echo $row['forum_name']; ?></td> + </tr> <?php } ?> - <tr> - <td height="16" align="center"><a class="gensmall" href="javascript:marklist('inherit', true);"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('inherit', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></td> + <tr> + <td height="16" align="center"><a class="gensmall" href="javascript:marklist('inherit', true);"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('inherit', false);" class="gensmall"><?php echo $user->lang['UNMARK_ALL']; ?></a></td> + </tr> + </table></td> </tr> - </table></td> - </tr> <?php } } // Display event/cron radio buttons - if ($auth->acl_gets('a_events', 'a_cron')) + if ($auth->acl_gets('a_events', 'a_cron') && $mode != 'deps') { $row_class = ($row_class == 'row1') ? 'row2' : 'row1'; ?> - <!-- tr> - <th colspan="4"><?php echo $user->lang['RUN_HOW']; ?></th> - </tr> - <tr> - <td class="<?php echo $row_class; ?>" colspan="4" align="center"><input type="radio" name="runas" value="now" checked="checked" /> <?php echo $user->lang['RUN_AS_NOW']; ?><?php + <!-- tr> + <th colspan="4"><?php echo $user->lang['RUN_HOW']; ?></th> + </tr> + <tr> + <td class="<?php echo $row_class; ?>" colspan="4" align="center"><input type="radio" name="runas" value="now" checked="checked" /> <?php echo $user->lang['RUN_AS_NOW']; ?><?php if ($auth->acl_get('a_events')) { @@ -974,53 +626,66 @@ else if (!empty($forum_id) || } ?></td> - </tr --> + </tr --> <?php } ?> - <tr> - <td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['UPDATE']; ?>" /> <input class="liteoption" type="submit" name="cancel" value="<?php echo $user->lang['CANCEL']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td> - </tr> -</table> + <tr> + <td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['UPDATE']; ?>" /> <input class="liteoption" type="submit" name="cancel" value="<?php echo $user->lang['CANCEL']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td> + </tr> + </table> -<br clear="all" /> + <br clear="all" /> -<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> - <tr> - <th colspan="4"><?php echo $user->lang['PRESETS']; ?></th> - </tr> - <tr> - <td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0"> + <table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> - <td colspan="2" height="16"><span class="gensmall"><?php echo $user->lang['PRESETS_EXPLAIN']; ?></span></td> + <th colspan="4"><?php echo $user->lang['PRESETS']; ?></th> </tr> <tr> - <td nowrap="nowrap"><?php echo $user->lang['SELECT_PRESET']; ?>: </td> - <td><select name="presetoption"><option class="sep" value="-1"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><?php - - echo $preset_update_options; - -?></select></td> + <td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0"> + <tr> + <td colspan="2" height="16"><span class="gensmall"><?php echo $user->lang['PRESETS_EXPLAIN']; ?></span></td> + </tr> + <tr> + <td nowrap="nowrap"><?php echo $user->lang['SELECT_PRESET']; ?>: </td> + <td><select name="presetoption"><option class="sep" value="-1"><?php echo $user->lang['SELECT'] . ' ->'; ?></option><?php + + echo $preset_update_options; + + ?></select></td> + </tr> + <tr> + <td nowrap="nowrap"><?php echo $user->lang['PRESET_NAME']; ?>: </td> + <td><input type="text" name="presetname" maxlength="25" /> </td> + </tr> + </table></td> </tr> <tr> - <td nowrap="nowrap"><?php echo $user->lang['PRESET_NAME']; ?>: </td> - <td><input type="text" name="presetname" maxlength="25" /> </td> + <td class="cat" colspan="4" align="center"><input class="liteoption" type="submit" name="presetsave" value="<?php echo $user->lang['SAVE']; ?>" /> <input class="liteoption" type="submit" name="presetdel" value="<?php echo $user->lang['DELETE']; ?>" /><input type="hidden" name="advanced" value="true" /></td> </tr> </table></td> </tr> - <tr> - <td class="cat" colspan="4" align="center"><input class="liteoption" type="submit" name="presetsave" value="<?php echo $user->lang['SAVE']; ?>" /> <input class="liteoption" type="submit" name="presetdel" value="<?php echo $user->lang['DELETE']; ?>" /><input type="hidden" name="advanced" value="true" /></td> - </tr> -</table></td> - </tr> </table></form> <?php - page_footer(); - } + +page_footer(); + + + + + + + + +// +// +// Add/Remove/Alter user/group settings +// +// ?> @@ -1038,7 +703,7 @@ else if (!empty($forum_id) || $sql = "SELECT DISTINCT u.user_id, u.username FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o - WHERE o.auth_value LIKE '" . $type_sql . "_%' + WHERE o.auth_option LIKE '" . $sql_option_mode . "_%' AND a.auth_option_id = o.auth_option_id $forum_sql AND u.user_id = a.user_id @@ -1060,7 +725,7 @@ else if (!empty($forum_id) || <td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td> </tr> <tr> - <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['SET_OPTIONS']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td> + <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['SET_OPTIONS']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $sql_option_mode; ?>" /></td> </tr> </table></form></td> @@ -1069,7 +734,7 @@ else if (!empty($forum_id) || $sql = "SELECT DISTINCT g.group_id, g.group_name FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o - WHERE o.auth_value LIKE '" . $type_sql . "_%' + WHERE o.auth_option LIKE '" . $sql_option_mode . "_%' $forum_sql AND a.auth_option_id = o.auth_option_id AND g.group_id = a.group_id @@ -1103,7 +768,7 @@ else if (!empty($forum_id) || <td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td> </tr> <tr> - <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['SET_OPTIONS']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td> + <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['DELETE']; ?>" /> <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['SET_OPTIONS']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $sql_option_mode; ?>" /></td> </tr> </table></form></td> @@ -1140,13 +805,20 @@ else if (!empty($forum_id) || page_footer(); -} -// Output appropriate front end page; forums, user or group selector -page_header($l_title); + + +// +// +// Select a forum, user or group +// +// + + + ?> |