From: skodak Date: Tue, 17 Feb 2009 17:15:47 +0000 (+0000) Subject: MDL-18293 exception and DML cleanup X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=68fbad441739a99854c577b73be32a2e97cdc96e;p=moodle.git MDL-18293 exception and DML cleanup --- diff --git a/lib/datalib.php b/lib/datalib.php index cd9562a9a7..3a04e29172 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1993,9 +1993,7 @@ function user_accesstime_log($courseid=0) { $last->lastip = getremoteaddr(); $last->lastaccess = $timenow; - if (!$DB->update_record_raw('user', $last)) { - debugging('Error: Could not update global user lastaccess information', DEBUG_ALL); // Don't throw an error - } + $DB->update_record_raw('user', $last); } if ($courseid == SITEID) { @@ -2016,9 +2014,7 @@ function user_accesstime_log($courseid=0) { $last->userid = $USER->id; $last->courseid = $courseid; $last->timeaccess = $timenow; - if (!$DB->insert_record_raw('user_lastaccess', $last, false)) { - debugging('Error: Could not insert course user lastaccess information', DEBUG_ALL); // Don't throw an error - } + $DB->insert_record_raw('user_lastaccess', $last, false); } else if ($timenow - $lastaccess < LASTACCESS_UPDATE_SECS) { // no need to update now, it was updated recently in concurrent login ;-) @@ -2027,9 +2023,7 @@ function user_accesstime_log($courseid=0) { // Update course lastaccess for next checks $USER->currentcourseaccess[$courseid] = $timenow; - if (!$DB->set_field('user_lastaccess', 'timeaccess', $timenow, array('userid'=>$USER->id, 'courseid'=>$courseid))) { - debugging('Error: Could not update course user lastacess information'); // Don't throw an error - } + $DB->set_field('user_lastaccess', 'timeaccess', $timenow, array('userid'=>$USER->id, 'courseid'=>$courseid)); } } }