diff --git a/includes/functions.php b/includes/functions.php index 8e68eb2e64..833e832681 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -817,7 +817,10 @@ function eventlog($eventtext,$device_id = "", $interface_id = "") mysql_query($event_query); } -function log_event($text, $device = NULL, $type = NULL, $reference = NULL) { +function log_event($text, $device = NULL, $type = NULL, $reference = NULL) +{ + global $debug; + $event_query = "INSERT INTO eventlog (host, reference, type, datetime, message) VALUES (" . ($device['device_id'] ? $device['device_id'] : "NULL"); $event_query .= ", " . ($reference ? $reference : "NULL") . ", " . ($type ? $type : "NULL") . ", NOW(), '" . mres($text) . "')"; if ($debug) { echo($event_query . "\n"); }