aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/mcp/mcp_warn.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/mcp/mcp_warn.php')
-rwxr-xr-xphpBB/includes/mcp/mcp_warn.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index a8ee952c93..281b5d6410 100755
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -210,6 +210,12 @@ function mcp_warn_post_view($id, $mode, $action)
trigger_error($user->lang['CANNOT_WARN_ANONYMOUS']);
}
+ // Prevent someone from warning themselves
+ if ($userrow['user_id'] == $user->data['user_id'])
+ {
+ trigger_error($user->lang['CANNOT_WARN_SELF']);
+ }
+
// Check if there is already a warning for this post to prevent multiple
// warnings for the same offence
$sql = 'SELECT post_id
@@ -321,6 +327,12 @@ function mcp_warn_user_view($id, $mode, $action)
trigger_error('NO_USER');
}
+ // Prevent someone from warning themselves
+ if ($userrow['user_id'] == $user->data['user_id'])
+ {
+ trigger_error($user->lang['CANNOT_WARN_SELF']);
+ }
+
$user_id = $userrow['user_id'];
if ($warning && $action == 'add_warning')