mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
Prevent warning self
git-svn-id: file:///svn/phpbb/trunk@6108 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -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')
|
||||
|
Reference in New Issue
Block a user