Fix a minor bug with deletions

git-svn-id: file:///svn/phpbb/trunk@5568 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Graham Eames 2006-02-21 20:48:31 +00:00
parent d6c8a4a1ae
commit 5cffb39239

View file

@ -112,13 +112,13 @@ function mcp_notes_user_view($id, $mode, $action)
$deletemark = ($action == 'del_marked') ? true : false; $deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false; $deleteall = ($action == 'del_all') ? true : false;
$marked = request_var('marknote', 0); $marked = request_var('marknote', array(0));
$usernote = request_var('usernote', ''); $usernote = request_var('usernote', '');
// Handle any actions // Handle any actions
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
{ {
$where_sql = " AND reportee_id = $user_id"; $where_sql = '';
if ($deletemark && $marked) if ($deletemark && $marked)
{ {
$sql_in = array(); $sql_in = array();
@ -130,8 +130,11 @@ function mcp_notes_user_view($id, $mode, $action)
unset($sql_in); unset($sql_in);
} }
if ($where_sql || $deleteall)
{
$sql = 'DELETE FROM ' . LOG_TABLE . ' $sql = 'DELETE FROM ' . LOG_TABLE . '
WHERE log_type = ' . LOG_USERS . " WHERE log_type = ' . LOG_USERS . "
AND reportee_id = $user_id
$where_sql"; $where_sql";
$db->sql_query($sql); $db->sql_query($sql);
@ -142,6 +145,7 @@ function mcp_notes_user_view($id, $mode, $action)
meta_refresh(2, $redirect); meta_refresh(2, $redirect);
trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); trigger_error($user->lang[$msg] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
} }
}
if ($usernote && $action == 'add_feedback') if ($usernote && $action == 'add_feedback')
{ {