From 1405e47fc10bf75fb325e3e8e2978cc06ba1c261 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 9 Nov 2002 00:04:18 +0000 Subject: Mainly updates for additional/altered admin permission options ... note, you MUST empty your current auth_options table and insert the list from the mysql_basic, you will also need to empty the auth_user/auth_group tables and re-assign permissions, and you should clear the $acl_options array in config_cache git-svn-id: file:///svn/phpbb/trunk@3020 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/admin/admin_disallow.php | 39 +++++++++++++++------------------------ 1 file changed, 15 insertions(+), 24 deletions(-) (limited to 'phpBB/admin/admin_disallow.php') diff --git a/phpBB/admin/admin_disallow.php b/phpBB/admin/admin_disallow.php index 4bd6a88170..3061a069fa 100644 --- a/phpBB/admin/admin_disallow.php +++ b/phpBB/admin/admin_disallow.php @@ -21,43 +21,36 @@ define('IN_PHPBB', 1); -if( !empty($setmodules) ) +if(!empty($setmodules)) { - if ( !$auth->acl_get('a_user') ) + if (!$auth->acl_get('a_names')) { return; } - $filename = basename(__FILE__); - $module['Users']['Disallow'] = $filename . $SID; + $module['Users']['Disallow'] = basename(__FILE__) . $SID; return; } define('IN_PHPBB', 1); -// // Include files -// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); -// -// Do we have user admin permissions? -// -if ( !$auth->acl_get('a_user') ) +// Check permissions +if (!$auth->acl_get('a_names')) { - return; + trigger_error($user->lang['NO_ADMIN']); } -if( isset($_POST['add_name']) ) +if (isset($_POST['add_name'])) { - include($phpbb_root_path . 'includes/functions_validate.'.$phpEx); - - $disallowed_user = ( isset($_POST['disallowed_user']) ) ? $_POST['disallowed_user'] : $_GET['disallowed_user']; + $disallowed_user = (isset($_POST['disallowed_user'])) ? $_POST['disallowed_user'] : $_GET['disallowed_user']; $disallowed_user = str_replace('*', '%', $disallowed_user); - if ( !validate_username($disallowed_user) ) + if (validate_username($disallowed_user)) { $message = $user->lang['Disallowed_already']; } @@ -65,7 +58,7 @@ if( isset($_POST['add_name']) ) { $sql = "INSERT INTO " . DISALLOW_TABLE . " (disallow_username) VALUES('" . str_replace("\'", "''", $disallowed_user) . "')"; - $result = $db->sql_query( $sql ); + $result = $db->sql_query($sql); $message = $user->lang['Disallow_successful']; } @@ -76,9 +69,9 @@ if( isset($_POST['add_name']) ) message_die(MESSAGE, $message); } -else if( isset($_POST['delete_name']) ) +else if (isset($_POST['delete_name'])) { - $disallowed_id = ( isset($_POST['disallowed_id']) ) ? intval( $_POST['disallowed_id'] ) : intval( $_GET['disallowed_id'] ); + $disallowed_id = (isset($_POST['disallowed_id'])) ? intval($_POST['disallowed_id']) : intval($_GET['disallowed_id']); $sql = "DELETE FROM " . DISALLOW_TABLE . " WHERE disallow_id = $disallowed_id"; @@ -92,21 +85,19 @@ else if( isset($_POST['delete_name']) ) } -// // Grab the current list of disallowed usernames... -// $sql = "SELECT * FROM " . DISALLOW_TABLE; $result = $db->sql_query($sql); $disallow_select = ''; -if ( $row = $db->sql_fetchrow($result) ) +if ($row = $db->sql_fetchrow($result)) { do { $disallow_select .= ''; } - while ( $row = $db->sql_fetchrow($result) ); + while ($row = $db->sql_fetchrow($result)); } // @@ -133,7 +124,7 @@ page_header($user->lang['Users']); lang['Username']; ?>
lang['Delete_disallow_explain']; ?> -  lang['No_disallowed']; } ?> +  lang['No_disallowed']; } ?> -- cgit v1.2.1