acl_get('a_names'))
{
return;
}
$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);
// Check permissions
if (!$auth->acl_get('a_names'))
{
trigger_error($user->lang['NO_ADMIN']);
}
if (isset($_POST['add_name']))
{
$disallowed_user = (isset($_POST['disallowed_user'])) ? $_POST['disallowed_user'] : $_GET['disallowed_user'];
$disallowed_user = str_replace('*', '%', $disallowed_user);
if (validate_username($disallowed_user))
{
$message = $user->lang['Disallowed_already'];
}
else
{
$sql = "INSERT INTO " . DISALLOW_TABLE . " (disallow_username)
VALUES('" . str_replace("\'", "''", $disallowed_user) . "')";
$result = $db->sql_query($sql);
$message = $user->lang['Disallow_successful'];
}
$message .= '
' . sprintf($user->lang['Click_return_disallowadmin'], '', '') . '
' . sprintf($user->lang['Click_return_admin_index'], '', '');
add_admin_log('log_disallow_add', str_replace('%', '*', $disallowed_user));
message_die(MESSAGE, $message);
}
else if (isset($_POST['delete_name']))
{
$disallowed_id = (isset($_POST['disallowed_id'])) ? intval($_POST['disallowed_id']) : intval($_GET['disallowed_id']);
$sql = "DELETE FROM " . DISALLOW_TABLE . "
WHERE disallow_id = $disallowed_id";
$db->sql_query($sql);
$message .= $user->lang['Disallowed_deleted'] . '
' . sprintf($user->lang['Click_return_disallowadmin'], '', '') . '
' . sprintf($user->lang['Click_return_admin_index'], '', '');
add_admin_log('log_disallow_delete');
message_die(MESSAGE, $message);
}
// 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))
{
do
{
$disallow_select .= '';
}
while ($row = $db->sql_fetchrow($result));
}
//
// Output page
//
page_header($user->lang['Users']);
?>
lang['Disallow_explain']; ?>