From 7313f147f90ba46281ff5c560161ee70ea5959e0 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 4 Jun 2001 00:46:12 +0000 Subject: More functionality ... some user auth info but no direct control yet git-svn-id: file:///svn/phpbb/trunk@424 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/userauth.php | 291 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 203 insertions(+), 88 deletions(-) (limited to 'phpBB/admin/userauth.php') diff --git a/phpBB/admin/userauth.php b/phpBB/admin/userauth.php index 17dcbf8776..ffd92d7e42 100644 --- a/phpBB/admin/userauth.php +++ b/phpBB/admin/userauth.php @@ -14,9 +14,6 @@ include('common.'.$phpEx); // End session management // - - - $auth_field_match = array( "auth_view" => AUTH_VIEW, "auth_read" => AUTH_READ, @@ -28,6 +25,9 @@ $auth_field_match = array( "auth_votecreate" => AUTH_VOTECREATE, "auth_attachments" => AUTH_ATTACH ); +$forum_auth_fields = array("auth_view", "auth_read", "auth_post", "auth_reply", "auth_edit", "auth_delete", "auth_votecreate", "auth_vote", "auth_attachments"); + + ?>
\n"; + echo "\t\n"; echo "\t\t" . $forum_field_name[$i] . "\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 || $forum_fields[$forum_field_name[$i]] == AUTH_REG) { if($forum_fields[$forum_field_name[$i]] == AUTH_ALL) { @@ -158,7 +158,7 @@ if(!empty($HTTP_GET_VARS[POST_FORUM_URL])) echo ""; } } - echo "    \n"; + echo "    \n"; } echo "\t
\n"; @@ -170,115 +170,230 @@ if(!empty($HTTP_GET_VARS[POST_FORUM_URL])) sql_query($sql); + $f_access = $db->sql_fetchrowset($af_result); + + $sql = "SELECT user_id, username, user_level + FROM " . USERS_TABLE . " + WHERE user_id = $user_id"; $u_result = $db->sql_query($sql); + $userinf = $db->sql_fetchrow($u_result); - $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 + $sql = "SELECT aa.forum_id, aa.auth_view, aa.auth_read, aa.auth_post, aa.auth_reply, aa.auth_edit, aa.auth_delete, aa.auth_votecreate, aa.auth_vote, aa.auth_attachments, aa.auth_mod, g.group_single_user + FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE. " g + WHERE ug.user_id = $user_id 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); + AND aa.group_id = ug.group_id"; + $au_result = $db->sql_query($sql); - // - // Show data - // - $userdata['user_id'] = $userid; - $userdata['username'] = $user_inf['username']; - $userdata['user_level'] = $user_inf['user_level']; - $userdata['session_logged_in'] = 1; + $num_u_access = $db->sql_numrows($au_result); + if($num_u_access) + { + $u_access = $db->sql_fetchrowset($au_result); + } - $is_auth = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata); + $is_admin = ($userinf['user_level'] == ADMIN) ? 1 : 0; -?> - - - -phpBB - auth testing - - - +?> -

+?> -
+

Restricted forums

+ +
- - - - - - - - - - - + \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\t\n"; } + echo "\t\n"; + + echo "\n"; + + $i = 0; + while(list($forumkey, $user_ary) = each($auth_user)) + { + if($is_forum_restricted[$forumkey]) + { + echo "\n"; + echo "\t\n"; + while(list($fieldkey, $value) = each($user_ary)) + { + $can_they = ($auth_user[$forumkey][$fieldkey]) ? "Yes" : "No"; + echo "\t\n"; + } + echo "\n"; + } + $i++; + } + reset($auth_user); + +?> +
GroupGroup NameForum TitleCan View?Can Read?Can Post?Can Reply?Can Edit?Can Delete?Is Moderator?
Forum Name ".$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."
".preg_replace("/auth_/", "", $forum_auth_fields[$j])."Moderator
".$f_access[$i]['forum_name']."$can_they
+ +

Forums with general (public or registered) access

+ +

The following forums are set to be generally accessible to most users, either everyone or just registered users. To limit these forums (or certain fields) to specific users you need to change the forum authorisation type via the Forum Authorisation Admin panel.

+ +
+ + +".preg_replace("/auth_/", "", $forum_auth_fields[$j])."\n"; + } + echo "\t\n"; + + echo "\n"; + + $i = 0; + while(list($forumkey, $user_ary) = each($auth_user)) + { + if(!$is_forum_restricted[$forumkey]) + { + echo "\n"; + echo "\t\n"; + while(list($fieldkey, $value) = each($user_ary)) + { + $can_they = ($auth_user[$forumkey][$fieldkey]) ? "Yes" : "No"; + echo "\t\n"; + } + echo "\n"; + } + $i++; + } + reset($auth_user); + ?> -
Forum NameModerator
".$f_access[$i]['forum_name']."$can_they
sql_query($sql); + $user_list = $db->sql_fetchrowset($u_result); + +?> +
+ + + + + + +
Select a User
   
+
-
+

Forum Authorisation Admin

+ Powered By phpBB 2.0
-- cgit v1.2.1