From fad21bcb01bdabaad234d812622555873fd48c4c Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 14 Jul 2002 14:51:03 +0000 Subject: Hard-coded HTML into admin modules ... no point in continuing to template this stuff since no one (or few) rarely bother to make use of the feature. Lots of changes for permissions, sessions, etc. some new styling stuff present (inc. editing templates though not complete), lots of bugs and non-functioning stuff ... any 'existing' modules will cause the right hand panel to fail ... remove them. If I catch anyone nicking graphics from here I'll kill 'em ... git-svn-id: file:///svn/phpbb/trunk@2675 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_permissions.php | 253 +++++++++++++++++++++++++++++++++++--- 1 file changed, 235 insertions(+), 18 deletions(-) (limited to 'phpBB/admin/admin_permissions.php') diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 7dfa0b597e..0c90f8aa34 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -21,14 +21,15 @@ if ( !empty($setmodules) ) { - if ( !$acl->get_acl_admin('forums') ) + if ( !$acl->get_acl_admin('auth') ) { return; } $filename = basename(__FILE__); $module['Forums']['Permissions'] = $filename . $SID . '&mode=forums'; - $module['General']['Set_Administrators'] = $filename . $SID . '&mode=admins'; + $module['Forums']['Moderators'] = $filename . $SID . '&mode=moderators'; + $module['General']['Administrators'] = $filename . $SID . '&mode=administrators'; return; } @@ -44,7 +45,7 @@ require('pagestart.' . $phpEx); // // Do we have forum admin permissions? // -if ( !$acl->get_acl_admin('forums') ) +if ( !$acl->get_acl_admin('auth') ) { message_die(MESSAGE, $lang['No_admin']); } @@ -55,7 +56,6 @@ if ( !$acl->get_acl_admin('forums') ) if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) ) { $forum_id = ( isset($HTTP_POST_VARS['f']) ) ? intval($HTTP_POST_VARS['f']) : intval($HTTP_GET_VARS['f']); - $forum_sql = " WHERE forum_id = $forum_id"; } else @@ -64,31 +64,248 @@ else $forum_sql = ''; } +$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; + // // Start program proper // +switch ( $mode ) +{ + case 'forums': + $l_title = $lang['Permissions']; + $l_title_explain = $lang['Permissions_explain']; + break; + case 'moderators': + $l_title = $lang['Moderators']; + $l_title_explain = $lang['Moderators_explain']; + break; + case 'administrators': + $l_title = $lang['Administrators']; + $l_title_explain = $lang['Administrators_explain']; + break; +} // // Get required information, either all forums if // no id was specified or just the requsted if it // was // -if ( !empty($forum_id) ) +if ( !empty($forum_id) || $mode == 'administrators' ) { // - // Output the selection table if no forum id was - // specified + // Clear some vars, grab some info if relevant ... // - $template->set_filenames(array( - "body" => "admin/auth_select_body.tpl") - ); + $s_hidden_fields = ''; + if ( !empty($forum_id) ) + { + $sql = "SELECT forum_name + FROM " . FORUMS_TABLE . " + WHERE forum_id = $forum_id"; + $result = $db->sql_query($sql); + + $forum_info = $db->sql_fetchrow($result); + + $l_title .= ' : ' . $forum_info['forum_name'] . ''; + $s_hidden_fields = ''; + } + + // + // Generate header + // + page_header($lang['Forums']); - $select_list = ' + +

[ ]

+ +

+ + + +

[ ]

+ +

+ + + +

[ ]

+ +

+ + + +

[ ]

+ +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
+ +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 '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); + + $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 'admin' + AND ag.auth_option_id = ao.auth_option_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
  
+'; + + +?> + + + + -

+

-

+

-
"> +">
- +
        
-- cgit v1.2.1