From e1dc0d3c99217504de2ac8467156274786efc0bd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 9 Oct 2014 16:01:11 +0200 Subject: Big load of changes - Added callback functionality for taskmanager tasks. You can launch a task and define a callback function to be run when the task finished. This requires activating the cronjob - Added cron functionality: Add cronjob that calls the cron api every 5 minutes to use it. (See cron.inc.php) - Added eventlog - Added missing translations - Merged main-menu-login and main-menu-logout --- inc/eventlog.inc.php | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'inc/eventlog.inc.php') diff --git a/inc/eventlog.inc.php b/inc/eventlog.inc.php index dadccdd7..181f8d38 100644 --- a/inc/eventlog.inc.php +++ b/inc/eventlog.inc.php @@ -3,28 +3,31 @@ class EventLog { - private static function log($type, $message) + private static function log($type, $message, $details) { - Database::exec("INSERT INTO eventlog (dateline, logtypeid, description)" - . " VALUES (UNIX_TIMESTAMP(), :type, :message)", array( + Database::exec("INSERT INTO eventlog (dateline, logtypeid, description, extra)" + . " VALUES (UNIX_TIMESTAMP(), :type, :message, :details)", array( 'type' => $type, - 'message' => $message + 'message' => $message, + 'details' => $details )); } - public static function failure($message) + public static function failure($message, $details = '') { - self::log('failure', $message); + self::log('failure', $message, $details); } - public static function warning($message) + public static function warning($message, $details = '') { - self::log('warning', $message); + self::log('warning', $message, $details); + Property::setLastWarningId(Database::lastInsertId()); } - public static function info($message) + public static function info($message, $details = '') { - self::log('info', $message); + self::log('info', $message, $details); + Property::setLastWarningId(Database::lastInsertId()); } } -- cgit v1.2.3-55-g7522