From efcc291e3a7e1413bf6340ba76ae1ae11b62b05f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20T=C3=A4nzer?= Date: Wed, 2 Apr 2014 01:02:23 +0200 Subject: bug 1138: Error handling when inserting to the admin log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Tänzer --- pages/account/43.php | 36 +++++++++++++++++++++++++----------- pages/account/59.php | 7 ++++++- 2 files changed, 31 insertions(+), 12 deletions(-) (limited to 'pages') diff --git a/pages/account/43.php b/pages/account/43.php index b055add..b4f2465 100644 --- a/pages/account/43.php +++ b/pages/account/43.php @@ -127,16 +127,20 @@ if(intval($_REQUEST['userid']) > 0) { //deletes an assurance if(array_key_exists('assurance',$_REQUEST) && $_REQUEST['assurance'] > 0 && $ticketvalidation == true) { - $assurance = mysql_escape_string(intval($_REQUEST['assurance'])); - $trow = 0; - $res = mysql_query("select `to` from `notary` where `id`='$assurance'"); - if ($res) { - $trow = mysql_fetch_assoc($res); - } - mysql_query("update `notary` set `deleted`=NOW() where `id`='$assurance'"); - if ($trow) { - fix_assurer_flag($trow['to']); - write_se_log($userid, $_SESSION['profile']['id'], 'SE assurance revoke', $ticketno); + if (!write_se_log($userid, $_SESSION['profile']['id'], 'SE assurance revoke', $ticketno)) { + $ticketmsg=_("Writing to the admin log failed. Can't continue."); + } else { + $assurance = mysql_escape_string(intval($_REQUEST['assurance'])); + $trow = 0; + $res = mysql_query("select `to` from `notary` where `id`='$assurance'"); + if ($res) { + $trow = mysql_fetch_assoc($res); + } + + mysql_query("update `notary` set `deleted`=NOW() where `id`='$assurance'"); + if ($trow) { + fix_assurer_flag($trow['to']); + } } } elseif(array_key_exists('assurance',$_REQUEST) && $_REQUEST['assurance'] > 0 && $ticketvalidation == FALSE) { $ticketmsg=_('No assurance revoked. Ticket number is missing!'); @@ -314,7 +318,16 @@ if(intval($_REQUEST['userid']) > 0) { + + + + + + + - Q1: @@ -357,6 +370,7 @@ if(intval($_REQUEST['userid']) > 0) { diff --git a/pages/account/59.php b/pages/account/59.php index ae9ec09..e9643d0 100644 --- a/pages/account/59.php +++ b/pages/account/59.php @@ -52,7 +52,12 @@ if (!valid_ticket_number($ticketno) && $support == 1) { exit; } if ( $support == 1) { - write_se_log($userid, $_SESSION['profile']['id'], 'SE View account history', $_REQUEST['ticketno']); + if (!write_se_log($userid, $_SESSION['profile']['id'], 'SE View account history', $_REQUEST['ticketno'])) { + echo _("Writing to the admin log failed. Can't continue."); + printf('
' . _('Back to previous page.') .''); + showfooter(); + exit; + } } ?> -- cgit v1.2.1