From ce793d37698e925dc6a1bf18de8dd74ae916d621 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 30 Jun 2008 13:51:43 +0000 Subject: [PATCH] Fixed gosa_log encoding problem, fixed initial search git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11483 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/log/addons/logview/class_gosa_logview.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc index 7863936f5..cb36d6973 100644 --- a/gosa-plugins/log/addons/logview/class_gosa_logview.inc +++ b/gosa-plugins/log/addons/logview/class_gosa_logview.inc @@ -143,6 +143,7 @@ class gosa_logview extends plugin * Connect to currently selected server ****/ $cfg = $list_of_servers[$this->server]; + $link = @mysql_pconnect($this->server, $cfg['USER'], $cfg['PWD']); if ($link === FALSE){ msg_dialog::display(_("Error"), msgPool::dbconnect($this->server,@mysql_error(),"GOsa LOG"), ERROR_DIALOG); @@ -280,6 +281,7 @@ class gosa_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){ msg_dialog::display(_("Error"), msgPool::dbquery("gosa_log",@mysql_error(), "GOsa LOG"), ERROR_DIALOG); new log("debug","gosa_logging","querydb",array(),@mysql_error()); @@ -314,7 +316,7 @@ class gosa_logview extends plugin $res.=" ".date("H:i:s d.m.Y",($line['timestamp'] + $this->timezone_offset)).""; $res.=" ".preg_replace("/,/",", ",$user).""; $res.=" ".$line['objecttype'].""; - $res.=" ".preg_replace("/,/",", ",$object).""; + $res.=" ".preg_replace("/,/",", ",LDAP::fix($object)).""; $res.=" ".$line['result'].""; $res.=" \n"; } @@ -350,7 +352,10 @@ class gosa_logview extends plugin $logfilter_changed = FALSE; foreach( array("server", "action","time","regex") as $type){ if(isset($_POST[$type])){ - $this->$type = $_POST[$type]; + if($type == "server" && $this->server != $_POST['server']){ + $this->location_id = -1; + } + $this->$type = $_POST[$type]; } } @@ -390,6 +395,7 @@ class gosa_logview extends plugin /* Save attributes in Sessiob, so we are able to recontruct filter on plugin reload */ $logview = session::get('logview'); $logview['gosa_log'] = array(); + foreach(array("action","server","time","regex") as $attr){ $logview['gosa_log'][$attr] = $this->$attr; } -- 2.30.2