aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_ban.php
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-04-28 15:22:14 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-04-28 15:22:14 +0000
commit38f9f25c9cd38aae07267f97122532d9f63a3eb8 (patch)
treebe8f4b61c3967df21fe25dc5aab7dcaff6ece4e8 /phpBB/includes/mcp/mcp_ban.php
parent69d77d685bd847ebe39b0aabf546133dfc52496e (diff)
downloadforums-38f9f25c9cd38aae07267f97122532d9f63a3eb8.tar
forums-38f9f25c9cd38aae07267f97122532d9f63a3eb8.tar.gz
forums-38f9f25c9cd38aae07267f97122532d9f63a3eb8.tar.bz2
forums-38f9f25c9cd38aae07267f97122532d9f63a3eb8.tar.xz
forums-38f9f25c9cd38aae07267f97122532d9f63a3eb8.zip
Adding confirm boxes.
git-svn-id: file:///svn/phpbb/trunk@7422 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/mcp/mcp_ban.php')
-rw-r--r--phpBB/includes/mcp/mcp_ban.php39
1 files changed, 33 insertions, 6 deletions
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index 5080ae08f2..c317260a2e 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -35,6 +35,7 @@ class mcp_ban
// Ban submitted?
if ($bansubmit)
{
+
// Grab the list of entries
$ban = request_var('ban', '');
$ban_len = request_var('banlength', 0);
@@ -42,12 +43,28 @@ class mcp_ban
$ban_exclude = request_var('banexclude', 0);
$ban_reason = request_var('banreason', '', true);
$ban_give_reason = request_var('bangivereason', '', true);
+
if ($ban)
{
- user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
-
- trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ if (confirm_box(true))
+ {
+ user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
+
+ trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ }
+ else
+ {
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ 'mode' => $mode,
+ 'ban' => $ban,
+ 'bansubmit' => true,
+ 'banlength' => $ban_len,
+ 'banlengthother' => $ban_len_other,
+ 'banexclude' => $ban_exclude,
+ 'banreason' => $ban_reason,
+ 'bangivereason' => $ban_give_reason)));
+ }
}
}
else if ($unbansubmit)
@@ -56,9 +73,19 @@ class mcp_ban
if ($ban)
{
- user_unban($mode, $ban);
-
- trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ if (confirm_box(true))
+ {
+ user_unban($mode, $ban);
+
+ trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
+ }
+ else
+ {
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ 'mode' => $mode,
+ 'unbansubmit' => true,
+ 'unban' => $ban)));
+ }
}
}