array(0, 0, 0, 0, 1, 0, 3, 3, 0, 0, 0), 1 => array(0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3), 2 => array(0, 0, 1, 1, 1, 1, 3, 3, 1, 1, 1), 3 => array(1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1), 4 => array(0, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2), 5 => array(2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2), 6 => array(0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), 7 => array(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3), 8 => array(0, 0, 3, 0, 0, 0, 3, 3, 3, 3, 3), 9 => array(0, 0, 3, 1, 0, 0, 3, 3, 3, 3, 3) ); $simple_auth_types = array("Public", "Test Restricted", "Registered", "Registered [Hidden]", "Private", "Private [Hidden]", "Moderators", "Moderators [Hidden]", "Moderator Post + All Reply", "Moderator Post + Reg Reply"); $forum_auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_sticky", "auth_announce", "auth_votecreate", "auth_vote", "auth_attachments"); $forum_auth_levels = array("ALL", "REG", "ACL", "MOD", "ADMIN"); $forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN); if(isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL])) { $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? $HTTP_POST_VARS[POST_FORUM_URL] : $HTTP_GET_VARS[POST_FORUM_URL]; $forum_sql = "WHERE forum_id = $forum_id"; } else { unset($forum_id); $forum_sql = ""; } if(isset($HTTP_GET_VARS['adv'])) { $adv = $HTTP_GET_VARS['adv']; } else { $adv = -1; } if(isset($HTTP_POST_VARS['submit'])) { if(!empty($forum_id)) { $sql = "UPDATE " . FORUMS_TABLE . " SET "; if(isset($HTTP_POST_VARS['simpleauth'])) { $simple_ary = $simple_auth_ary[$HTTP_POST_VARS['simpleauth']]; for($i = 0; $i < count($simple_ary); $i++) { $sql .= $forum_auth_fields[$i] . " = " . $simple_ary[$i]; if($i < count($simple_ary) - 1) { $sql .= ", "; } } $sql .= " WHERE forum_id = $forum_id"; } else { $sql = "UPDATE " . FORUMS_TABLE . " SET "; for($i = 0; $i < count($forum_auth_fields); $i++) { $value = $HTTP_POST_VARS[$forum_auth_fields[$i]]; if($forum_auth_fields[$i] != 'auth_view') { if($HTTP_POST_VARS['auth_view'] > $value) { $value = $HTTP_POST_VARS['auth_view']; } } $sql .= $forum_auth_fields[$i] . " = " . $value; if($i < count($forum_auth_fields) - 1) { $sql .= ", "; } } $sql .= " WHERE forum_id = $forum_id"; } if(strlen($sql)) { if(!$db->sql_query($sql)) { error_die(QUERY_ERROR, "Couldn't update auth table!", __LINE__, __FILE__); } } unset($forum_id); $forum_sql = ""; $adv = 0; } } // // Start output // $sql = "SELECT * FROM ".FORUMS_TABLE." $forum_sql ORDER BY forum_id ASC"; $f_result = $db->sql_query($sql); $forum_rows = $db->sql_fetchrowset($f_result); // // Show data // ?> phpBB - auth testing

Forum Authorisation Control

Forum :

" . $forum_rows[$i]['forum_name'] . ""; reset($simple_auth_ary); while(list($key, $auth_levels) = each($simple_auth_ary)) { $matched = 1; for($k = 0; $k < count($auth_levels); $k++) { $matched_type = $key; if($forum_rows[$i][$forum_auth_fields[$k]] != $auth_levels[$k]) { $matched = 0; } } if($matched) break; } // // If we've got a custom setup // then we jump into advanced // mode by default // if($adv == -1 && !$matched) { $adv = 1; } if($adv <= 0 || empty($forum_id)) { // // Determine whether the current // forum auth fields match a preset 'simple' // type // $simple_auth[$i] = (isset($forum_id)) ? "  " : ""; } if($adv == 1 || empty($forum_id)) { // // Output values of individual // fields // for($j = 0; $j < count($forum_auth_fields); $j++) { $custom_auth[$i][$j] = (isset($forum_id)) ? "  " : ""; } } } ?> ".preg_replace("/auth_/", "", $forum_auth_fields[$j])."\n"; } } ?> "; } $moderators_links .= "" . $forum_mods['forum_'.$forum_rows[$i]['forum_id'] . '_name'][$mods] . ""; } echo "\n"; if(empty($forum_id)) { echo "\n"; $colspan = 2; } if($adv <= 0 || empty($forum_id)) { echo "\n"; $colspan ++; } if($adv == 1 || empty($forum_id)) { for($j = 0; $j < count($custom_auth[$i]); $j++) { echo "\n"; $colspan++; } } echo "\n"; } if(isset($forum_id)) { $switch_mode = "forumauth.php?" . POST_FORUM_URL . "=" . $forum_id . "&adv="; $switch_mode .= ($adv <= 0 ) ? "1" : "0"; $switch_mode_text = ($adv <= 0 ) ? "Advanced Mode" : "Simple Mode"; ?>
Forum Title Simple Auth
".$forum_name[$i]."".$simple_auth[$i]."".$custom_auth[$i][$j]."
Switch to
  
Return to Forum Auth Index

User Authorisation Admin

Powered By phpBB 2.0
Copyright © 2001 phpBB Group, All Rights Reserved