From 8ff2db064ebc2e3579864e137914a5fe887451cb Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Mon, 29 Jul 2002 23:28:01 +0000 Subject: Permission updates ... again it's mainly layout rather than actual capability ... git-svn-id: file:///svn/phpbb/trunk@2791 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_permissions.php | 528 +++++++++++++------------------------- 1 file changed, 180 insertions(+), 348 deletions(-) (limited to 'phpBB/admin/admin_permissions.php') diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index f7c1a42c8c..f83a203abc 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -74,14 +74,17 @@ switch ( $mode ) case 'forums': $l_title = $lang['Permissions']; $l_title_explain = $lang['Permissions_explain']; + $l_can = '_can'; break; case 'moderators': $l_title = $lang['Moderators']; $l_title_explain = $lang['Moderators_explain']; + $l_can = '_can'; break; case 'administrators': $l_title = $lang['Administrators']; $l_title_explain = $lang['Administrators_explain']; + $l_can = '_can_admin'; break; } @@ -106,13 +109,12 @@ if ( !empty($forum_id) || $mode == 'administrators' ) $forum_info = $db->sql_fetchrow($result); $l_title .= ' : ' . $forum_info['forum_name'] . ''; - $s_hidden_fields = ''; } // // Generate header // - page_header($lang['Forums']); + page_header($l_title); ?> @@ -126,379 +128,225 @@ if ( !empty($forum_id) || $mode == 'administrators' ) { case 'forums': -?> - -
"> - - - - - - - - - -

[ ]
 
- -
- - - - - - - - - - - -

[ ]
 
- -
+ $type_sql = 'forum'; + $forum_sql = "AND a.forum_id = $forum_id"; - - - - - - - - - - -

[ ]
 
- -
- - - - - - - - - - - -

[ ]
 
- -sql_query($sql); - - $auth_options = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_options[] = $row; - } - - $sql = "SELECT u.user_id, u.username, ao.auth_option - FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'mod' - AND au.auth_option_id = ao.auth_option_id - AND au.forum_id = $forum_id - AND u.user_id = au.user_id - ORDER BY u.username, u.user_regdate ASC"; - $result = $db->sql_query($sql); - - $auth_users = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_users[$row['auth_option']] .= ''; - } - - $sql = "SELECT g.group_id, g.group_name, ao.auth_option - FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'mod' - AND ag.auth_option_id = ao.auth_option_id - AND ag.forum_id = $forum_id - AND g.group_id = ag.group_id - ORDER BY g.group_name ASC"; - $result = $db->sql_query($sql); - - $auth_groups = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_groups[$row['auth_option']] .= ''; - } - -?> - - - - - - - - - - - - - - - -
SettingUsersGroups
+ $type_sql = 'mod'; + $forum_sql = "AND a.forum_id = $forum_id"; -sql_query($sql); - - $group_list = ''; - while ( $row = $db->sql_fetchrow($result) ) - { - $group_list .= ''; - } - -?> - -

+ $type_sql = 'admin'; + $forum_sql = ''; -"> -sql_query($sql); - $sql = "SELECT DISTINCT u.user_id, u.username - FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'admin' - AND au.auth_option_id = ao.auth_option_id - AND u.user_id = au.user_id - ORDER BY u.username, u.user_regdate ASC"; - $result = $db->sql_query($sql); + $group_list = ''; + while ( $row = $db->sql_fetchrow($result) ) + { + $group_list .= ''; + } + $db->sql_freeresult($result); - $users = ''; - while ( $row = $db->sql_fetchrow($result) ) - { - $users .= ''; - } + if ( empty($HTTP_POST_VARS['advanced']) || empty($HTTP_POST_VARS['entries']) ) + { ?> + +
- - - - + + - - -sql_query($sql); - - $auth_options = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_options[] = $row; - } - - $sql = "SELECT u.user_id, u.username, ao.auth_option, au.auth_allow_deny - FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " au, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'admin' - AND au.auth_option_id = ao.auth_option_id - AND u.user_id = au.user_id - $where_user_sql - ORDER BY u.username, u.user_regdate ASC"; - $result = $db->sql_query($sql); - $users = array(); - $auth_user = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $users[] = ''; + + + -?> - - - -?> -

 
"> +sql_query($sql); - $users = implode('', array_unique($users)); + $users = ''; + while ( $row = $db->sql_fetchrow($result) ) + { + $users .= ''; + } + $db->sql_freeresult($result); ?> - - - - - + + + + + + + + + +
      
 
">sql_query($sql); - $can_type = ( !empty($auth_user[$auth_options[$i]['auth_option']]) ) ? ' checked="checked"' : ''; - $cannot_type = ( empty($auth_user[$auth_options[$i]['auth_option']]) ) ? ' checked="checked"' : ''; + $groups = ''; + while ( $row = $db->sql_fetchrow($result) ) + { + $groups .= ''; + } + $db->sql_freeresult($result); ?> - - - - - - + + + + + + + + +
/> />
 
  
+
"> + + + + + + + + + +
    &mode=searchuser&form=2&field=newuser', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" />
+ +
"> + + + + + + + + + +
 
-
"> - - - - - - - -
    &mode=searchuser&form=1&field=newuser', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" />
-

- -">sql_query($sql); - - $groups = ''; - while ( $row = $db->sql_fetchrow($result) ) - { - $groups .= ''; - } + } + else + { -?> - - - - - - - - - -sql_query($sql); - } - else - { - $where_groups_sql = ''; - if ( !empty($HTTP_POST_VARS['groups']) ) - { - if ( is_array($HTTP_POST_VARS['groups']) ) - { - foreach ($HTTP_POST_VARS['groups'] as $group_id) - { - $where_groups_sql .= ( ( $where_groups_sql != '' ) ? ', ' : '' ) . intval($group_id); - } - } - else - { - $where_groups_sql = intval($HTTP_POST_VARS['groups']); - } - - $where_groups_sql = " AND g.group_id IN ($where_groups_sql)"; - } - - $sql = "SELECT auth_option - FROM " . ACL_OPTIONS_TABLE . " - WHERE auth_type LIKE 'admin'"; - $result = $db->sql_query($sql); - - $auth_options = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $auth_options[] = $row; - } - - $sql = "SELECT g.group_id, g.group_name, ao.auth_option, ag.auth_allow_deny - FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " ag, " . ACL_OPTIONS_TABLE . " ao - WHERE ao.auth_type LIKE 'admin' - AND ag.auth_option_id = ao.auth_option_id - AND g.group_id = ag.group_id - $where_groups_sql + $auth_options = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $auth_options[] = $row; + } + $db->sql_freeresult($result); + + $where_sql = ''; + foreach ( $HTTP_POST_VARS['entries'] as $id ) + { + $where_sql .= ( ( $where_sql != '' ) ? ', ' : '' ) . intval($id); + } + + switch ( $HTTP_POST_VARS['type'] ) + { + case 'group': + $l_type = 'Group'; + + $sql = "SELECT g.group_id, g.group_name, o.auth_option, a.auth_allow_deny + FROM " . GROUPS_TABLE . " g, " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o + WHERE o.auth_type 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"; - $result = $db->sql_query($sql); + break; + + case 'user': + $l_type = 'User'; + + $sql = "SELECT u.user_id, u.username, o.auth_option, a.auth_allow_deny + FROM " . USERS_TABLE . " u, " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o + WHERE o.auth_type 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; + } - $groups = array(); - $auth_group = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - $groups[] = ''; + $result = $db->sql_query($sql); - $auth_group[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; - } + $ug = '';; + $auth = array(); + while ( $row = $db->sql_fetchrow($result) ) + { + $ug_name = ( ( $row['group_name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : ( ( $HTTP_POST_VARS['type'] == 'user' ) ? $row['username'] : $row['group_name'] ) ); + $ug .= ( !strstr($ug, $ug_name) ) ? $ug_name . "\n" : ''; - $groups = implode('', array_unique($groups)); + $auth[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; + } + $db->sql_freeresult($result); ?> + +">
 
- + @@ -507,41 +355,25 @@ if ( !empty($forum_id) || $mode == 'administrators' ) - - - - -
          
/>
  
- -
"> - - + + - - + + - - + + -
 
  
- - - -
+ sql_freeresult($result); - page_header($lang['Forums']); + page_header($l_title); ?> -- cgit v1.2.1