mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/13119] Remove unused globals and use the request class
PHPBB3-13119
This commit is contained in:
parent
7efc624b0a
commit
6f66423de9
2 changed files with 24 additions and 32 deletions
|
@ -25,14 +25,13 @@ class acp_ban
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache, $phpbb_dispatcher;
|
global $user, $template, $request, $phpbb_dispatcher;
|
||||||
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
|
||||||
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
|
$bansubmit = $request->is_set_post('bansubmit');
|
||||||
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
|
$unbansubmit = $request->is_set_post('unbansubmit');
|
||||||
$current_time = time();
|
|
||||||
|
|
||||||
$user->add_lang(array('acp/ban', 'acp/users'));
|
$user->add_lang(array('acp/ban', 'acp/users'));
|
||||||
$this->tpl_name = 'acp_ban';
|
$this->tpl_name = 'acp_ban';
|
||||||
|
@ -48,12 +47,12 @@ class acp_ban
|
||||||
if ($bansubmit)
|
if ($bansubmit)
|
||||||
{
|
{
|
||||||
// Grab the list of entries
|
// Grab the list of entries
|
||||||
$ban = utf8_normalize_nfc(request_var('ban', '', true));
|
$ban = $request->variable('ban', '', true);
|
||||||
$ban_length = request_var('banlength', 0);
|
$ban_length = $request->variable('banlength', 0);
|
||||||
$ban_length_other = request_var('banlengthother', '');
|
$ban_length_other = $request->variable('banlengthother', '');
|
||||||
$ban_exclude = request_var('banexclude', 0);
|
$ban_exclude = $request->variable('banexclude', 0);
|
||||||
$ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
|
$ban_reason = $request->variable('banreason', '', true);
|
||||||
$ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
|
$ban_give_reason = $request->variable('bangivereason', '', true);
|
||||||
|
|
||||||
if ($ban)
|
if ($ban)
|
||||||
{
|
{
|
||||||
|
@ -120,7 +119,7 @@ class acp_ban
|
||||||
}
|
}
|
||||||
else if ($unbansubmit)
|
else if ($unbansubmit)
|
||||||
{
|
{
|
||||||
$ban = request_var('unban', array(''));
|
$ban = $request->variable('unban', array(''));
|
||||||
|
|
||||||
if ($ban)
|
if ($ban)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ class mcp_ban
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $config, $db, $user, $auth, $template, $cache, $phpbb_dispatcher;
|
global $db, $user, $auth, $template, $request, $phpbb_dispatcher;
|
||||||
global $phpbb_root_path, $phpEx;
|
global $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||||
|
@ -33,9 +33,8 @@ class mcp_ban
|
||||||
// Include the admin banning interface...
|
// Include the admin banning interface...
|
||||||
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
|
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
|
||||||
|
|
||||||
$bansubmit = (isset($_POST['bansubmit'])) ? true : false;
|
$bansubmit = $request->is_set_post('bansubmit');
|
||||||
$unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
|
$unbansubmit = $request->is_set_post('unbansubmit');
|
||||||
$current_time = time();
|
|
||||||
|
|
||||||
$user->add_lang(array('acp/ban', 'acp/users'));
|
$user->add_lang(array('acp/ban', 'acp/users'));
|
||||||
$this->tpl_name = 'mcp_ban';
|
$this->tpl_name = 'mcp_ban';
|
||||||
|
@ -44,18 +43,12 @@ class mcp_ban
|
||||||
if ($bansubmit)
|
if ($bansubmit)
|
||||||
{
|
{
|
||||||
// Grab the list of entries
|
// Grab the list of entries
|
||||||
$ban = request_var('ban', '', ($mode === 'user') ? true : false);
|
$ban = $request->variable('ban', '', $mode === 'user');
|
||||||
|
$ban_length = $request->variable('banlength', 0);
|
||||||
if ($mode === 'user')
|
$ban_length_other = $request->variable('banlengthother', '');
|
||||||
{
|
$ban_exclude = $request->variable('banexclude', 0);
|
||||||
$ban = utf8_normalize_nfc($ban);
|
$ban_reason = $request->variable('banreason', '', true);
|
||||||
}
|
$ban_give_reason = $request->variable('bangivereason', '', true);
|
||||||
|
|
||||||
$ban_length = request_var('banlength', 0);
|
|
||||||
$ban_length_other = request_var('banlengthother', '');
|
|
||||||
$ban_exclude = request_var('banexclude', 0);
|
|
||||||
$ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
|
|
||||||
$ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
|
|
||||||
|
|
||||||
if ($ban)
|
if ($ban)
|
||||||
{
|
{
|
||||||
|
@ -150,7 +143,7 @@ class mcp_ban
|
||||||
}
|
}
|
||||||
else if ($unbansubmit)
|
else if ($unbansubmit)
|
||||||
{
|
{
|
||||||
$ban = request_var('unban', array(''));
|
$ban = $request->variable('unban', array(''));
|
||||||
|
|
||||||
if ($ban)
|
if ($ban)
|
||||||
{
|
{
|
||||||
|
@ -226,9 +219,9 @@ class mcp_ban
|
||||||
}
|
}
|
||||||
|
|
||||||
// As a "service" we will check if any post id is specified and populate the username of the poster id if given
|
// As a "service" we will check if any post id is specified and populate the username of the poster id if given
|
||||||
$post_id = request_var('p', 0);
|
$post_id = $request->variable('p', 0);
|
||||||
$user_id = request_var('u', 0);
|
$user_id = $request->variable('u', 0);
|
||||||
$username = $pre_fill = false;
|
$pre_fill = false;
|
||||||
|
|
||||||
if ($user_id && $user_id <> ANONYMOUS)
|
if ($user_id && $user_id <> ANONYMOUS)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue