From: hickert Date: Wed, 23 May 2007 12:26:02 +0000 (+0000) Subject: Udpated loggign X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b868e20368d036501ec2c97c67bc8362e00753cb;p=gosa.git Udpated loggign git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6456 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_log.inc b/include/class_log.inc index e10b25ad4..c2f056391 100644 --- a/include/class_log.inc +++ b/include/class_log.inc @@ -102,7 +102,7 @@ class log { # $msgs[] = "Currently active user is empty."; # } - if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security"))){ + if(!isset($entry['action']) || !in_array($entry['action'],array("modify","create","remove","copy","snapshot","view","security","debug"))){ $msgs[] = "Invalid option specified '".$entry['action']."'"; } diff --git a/plugins/addons/logview/class_logview.inc b/plugins/addons/logview/class_logview.inc index 1a00f4d1e..abf4af9f9 100644 --- a/plugins/addons/logview/class_logview.inc +++ b/plugins/addons/logview/class_logview.inc @@ -91,12 +91,14 @@ class logview extends plugin $link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']); if ($link === FALSE){ print_red(_("Can't connect to log database, no logs can be shown!")); + new log("debug","logview","",array(),@mysql_error()); return ($smarty->fetch (get_template_path('contents.tpl', TRUE))); } /* check of log database is available */ if (! @mysql_select_db("gomon")){ print_red(_("Can't select log database for log generation!")); + new log("debug","logview","",array(),@mysql_error()); return ($smarty->fetch (get_template_path('contents.tpl', TRUE))); } @@ -109,6 +111,7 @@ class logview extends plugin $result = @mysql_query($query); if ($result === false){ print_red(_("Query for log database failed!. Requesting host names failed.")); + new log("debug","logview","",array(),@mysql_error()); return ($smarty->fetch (get_template_path('contents.tpl', TRUE))); } @@ -129,6 +132,7 @@ class logview extends plugin @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__, $query, "Database query"); $result = @mysql_query($query); if ($result === false){ + new log("debug","logview","",array(),@mysql_error()); print_red(_("Query for log database failed!")); return ($smarty->fetch (get_template_path('contents.tpl', TRUE))); } @@ -187,9 +191,11 @@ class logview extends plugin /* Test connection object && create up query string */ if ($link === FALSE){ print_red(_("Can't connect to log database, no logs can be shown!")); + new log("debug","logview","",array(),@mysql_error()); } else { if (! @mysql_select_db("gomon")){ print_red(_("Can't select log database for log generation!")); + new log("debug","logview","",array(),@mysql_error()); } else { /* Assemble time query */ @@ -261,6 +267,9 @@ class logview extends plugin /* Get number of entries */ $query= "SELECT COUNT(*)".$query_base.";"; $result = @mysql_query($query); + if(!$result){ + new log("debug","logview","",array(),@mysql_error()); + } $line= mysql_fetch_array($result, MYSQL_ASSOC); $count= $line['COUNT(*)']; if ($count > 25){ @@ -273,7 +282,9 @@ class logview extends plugin $query= "SELECT *".$query_base." ORDER BY ".$this->fields[$this->sort]." $desc LIMIT ".$this->start.",".$this->range.";"; @DEBUG (DEBUG_MYSQL, __LINE__, __FUNCTION__, __FILE__, $query, "Database query"); $result = @mysql_query($query); - + if(!$result){ + new log("debug","logview","",array(),@mysql_error()); + } /* Display results */ $mod= 0;