array(0, 0, 0, 0, 0, 0, 0, 0, 0), 1 => array(0, 0, 1, 1, 1, 1, 1, 1, 1), 2 => array(1, 1, 1, 1, 1, 1, 1, 1, 1), 3 => array(0, 2, 2, 2, 2, 2, 2, 2, 2), 4 => array(2, 2, 2, 2, 2, 2, 2, 2, 2), 5 => array(0, 3, 3, 3, 3, 3, 3, 3, 3), 6 => array(3, 3, 3, 3, 3, 3, 3, 3, 3), 7 => array(0, 0, 3, 0, 0, 0, 3, 3, 3), 8 => array(0, 0, 3, 1, 0, 0, 3, 3, 3) ); $simple_auth_types = array("Public", "Registered", "Registered [Hidden]", "Private", "Private_[Hidden]", "Moderators", "Moderators [Hidden]", "Mod Post, All Reply", "Mod Post, Reg Reply"); $forum_auth_levels = array("ALL", "REG", "ACL", "MOD", "ADMIN"); $forum_auth_const = array(AUTH_ALL, AUTH_REG, AUTH_ACL, AUTH_MOD, AUTH_ADMIN); $forum_auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_votecreate", "auth_vote", "auth_attachments"); if(isset($HTTP_GET_VARS[POST_FORUM_URL])) { $forum_id = $HTTP_GET_VARS[POST_FORUM_URL]; $forum_sql = "WHERE forum_id = $forum_id"; } else { $forum_sql = ""; } // // 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); $sql = "SELECT f.forum_id, u.username, u.user_id FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa WHERE aa.forum_id = f.forum_id AND aa.auth_mod = 1 AND ug.group_id = aa.group_id AND u.user_id = ug.user_id ORDER BY f.forum_id, u.user_id"; if(!$q_forum_mods = $db->sql_query($sql)) { error_die(SQL_QUERY, "Could not query forum moderator information.", __LINE__, __FILE__); } $forum_mods_list = $db->sql_fetchrowset($q_forum_mods); for($i = 0; $i < count($forum_mods_list); $i++) { $forum_mods['forum_'.$forum_mods_list[$i]['forum_id'].'_name'][] = $forum_mods_list[$i]['username']; $forum_mods['forum_'.$forum_mods_list[$i]['forum_id'].'_id'][] = $forum_mods_list[$i]['user_id']; } // // Show data // ?> phpBB - auth testing

Forum Authorisation Control

Forum :

".preg_replace("/auth_/", "", $forum_auth_fields[$j])."\n"; } ?> " . $forum_rows[$i]['forum_name'] . ""; unset($moderators_links); for($mods = 0; $mods < count($forum_mods['forum_'.$forum_rows[$i]['forum_id'].'_id']); $mods++) { if(isset($moderators_links)) { $moderators_links .= ", "; } if(!($mods % 2) && $mods != 0) { $moderators_links .= "
"; } $moderators_links .= "".$forum_mods['forum_'.$forum_rows[$i]['forum_id'].'_name'][$mods].""; } 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; } // // Determine whether the current // forum auth fields match a preset 'simple' // type // $simple_auth = (isset($forum_id)) ? "" : ""; // // Output values of individual // fields // for($j = 0; $j < count($forum_auth_fields); $j++) { $custom_auth[$j] = (isset($forum_id)) ? "" : ""; } echo "\n"; if(empty($forum_id)) { echo "\n"; echo "\n"; } echo "\n"; for($j = 0; $j < count($custom_auth); $j++) { echo "\n"; } echo "\n"; } if(isset($forum_id)) { ?>
Forum Title Moderator/s Simple Auth
".$forum_name."".$moderators_links."".$simple_auth."".$custom_auth[$j]."

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