diff --git a/phpBB/admin/forumauth.php b/phpBB/admin/forumauth.php index a8799f979b..3b1a571213 100644 --- a/phpBB/admin/forumauth.php +++ b/phpBB/admin/forumauth.php @@ -235,7 +235,7 @@ for($i = 0; $i < count($forum_mods_list); $i++) // type // - $simple_auth[$i] = (isset($forum_id)) ? "" : ""; if(!$matched && empty($forum_id)) { $simple_auth[$i] .= "Custom"; @@ -254,7 +254,7 @@ for($i = 0; $i < count($forum_mods_list); $i++) $simple_auth[$i] .= ""; } } - $simple_auth[$i] .= (isset($forum_id)) ? "" : ""; + $simple_auth[$i] .= (isset($forum_id)) ? " " : ""; } @@ -268,21 +268,35 @@ for($i = 0; $i < count($forum_mods_list); $i++) for($j = 0; $j < count($forum_auth_fields); $j++) { - $custom_auth[$i][$j] = (isset($forum_id)) ? "" : ""; for($k = 0; $k < count($forum_auth_levels); $k++) { if($forum_rows[$i][$forum_auth_fields[$j]] == $forum_auth_const[$k]) { - $custom_auth[$i][$j] .= (isset($forum_id)) ? "" : ""; } else if(isset($forum_id)) - { - $custom_auth[$i][$j] .= ""; + { + $custom_auth[$i][$j] .= ""; } } - $custom_auth[$i][$j] .= (isset($forum_id)) ? "" : ""; + $custom_auth[$i][$j] .= (isset($forum_id)) ? " " : ""; } } diff --git a/phpBB/admin/userauth.php b/phpBB/admin/userauth.php new file mode 100644 index 0000000000..17dcbf8776 --- /dev/null +++ b/phpBB/admin/userauth.php @@ -0,0 +1,289 @@ + AUTH_VIEW, + "auth_read" => AUTH_READ, + "auth_post" => AUTH_POST, + "auth_reply" => AUTH_REPLY, + "auth_edit" => AUTH_EDIT, + "auth_delete" => AUTH_DELETE, + "auth_vote" => AUTH_VOTE, + "auth_votecreate" => AUTH_VOTECREATE, + "auth_attachments" => AUTH_ATTACH +); + +?> + + + +phpBB - auth testing + + + + +

User Authorisation Control

+ +sql_query($sql); + $forum_fields = $db->sql_fetchrow($f_result); + + $sql = "SELECT aa.*, g.group_name, u.user_id, u.username, u.user_level, f.forum_name + FROM ".AUTH_ACCESS_TABLE." aa, ".GROUPS_TABLE." g, ".USER_GROUP_TABLE." ug, ".USERS_TABLE." u, ".FORUMS_TABLE." f + WHERE f.forum_id = $forum_id + AND aa.forum_id = f.forum_id + AND ug.group_id = aa.group_id + AND g.group_id = ug.group_id + AND u.user_id = ug.user_id + ORDER BY u.user_id, aa.group_id"; + $aa_result = $db->sql_query($sql); + $user_list = $db->sql_fetchrowset($aa_result); + + + for($i = 0; $i < count($user_list); $i++) + { + $user_id = $user_list[$i]['user_id']; + $userinfo[$user_id]['username'] = $user_list[$i]['username']; + + $is_admin = ($user_list[$i]['user_level'] == ADMIN) ? 1 : 0; + + for($j = 0; $j < count($forum_field_name); $j++) + { + $this_field = $forum_field_name[$j]; + $is_auth[$this_field][$user_id] = auth_check_user($forum_fields[$this_field], $this_field, $user_list[$i], $is_admin); + } + } + + + echo "

Forum: ".$forum_fields['forum_name']."

\n"; + +?> +
+ + + + +\n"; + + echo "\t\t\n"; + + reset($is_auth); + $user_auth_ary = $is_auth[$forum_field_name[$i]]; + + if($forum_fields[$forum_field_name[$i]] == AUTH_ALL || $forum_fields[$forum_field_name[$i]] == AUTH_ALL) + { + if($forum_fields[$forum_field_name[$i]] == AUTH_ALL) + { + echo "\t\t"; + } + else + { + echo "\t\t"; + } + } + else + { + echo "\t\t\n"; + } + + echo "\t\n"; + + } + +?> +
Forum Auth FieldUsers with Access
" . $forum_field_name[$i] . " All Users  Registered Users      
+sql_query($sql); + + $sql = "SELECT af.*, g.*, f.forum_name + FROM ".AUTH_ACCESS_TABLE." af, ".GROUPS_TABLE." g, ".USER_GROUP_TABLE." ug, ".FORUMS_TABLE." f + WHERE ug.user_id = $userid + AND g.group_id = ug.group_id + AND af.forum_id = f.forum_id + ORDER BY g.group_id"; + $aa_result = $db->sql_query($sql); + + $user_inf = $db->sql_fetchrow($u_result); + $access_inf = $db->sql_fetchrowset($aa_result); + + // + // Show data + // + $userdata['user_id'] = $userid; + $userdata['username'] = $user_inf['username']; + $userdata['user_level'] = $user_inf['user_level']; + $userdata['session_logged_in'] = 1; + + $is_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + +?> + + + +phpBB - auth testing + + + + +

+ +
+ + + + + + + + + + + + +\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } +?> + +
GroupGroup NameForum TitleCan View?Can Read?Can Post?Can Reply?Can Edit?Can Delete?Is Moderator?
".$access_inf[$i]['group_id']."".$access_inf[$i]['group_name']."".$access_inf[$i]['forum_name']."".$auth_view."".$auth_read."".$auth_post."".$auth_reply."".$auth_edit."".$auth_delete."".$auth_mod."
+ + +
+
+Powered By phpBB 2.0 +
+ +Copyright © 2001 phpBB Group, All Rights Reserved +
+ + + \ No newline at end of file