From: hickert Date: Tue, 4 Mar 2008 14:27:18 +0000 (+0000) Subject: Updated logview X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=29945bfc8caa8ed344b4c06c04cd953faf9b4345;p=gosa.git Updated logview git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9321 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc index 41e98269d..fa3f4729e 100644 --- a/gosa-plugins/log/addons/logview/class_gosa_logview.inc +++ b/gosa-plugins/log/addons/logview/class_gosa_logview.inc @@ -278,45 +278,42 @@ class gosa_logview extends plugin $result = @mysql_query($query); if(!$result){ new log("debug","logview","",array(),@mysql_error()); - } - - /* Display results */ - $mod= 0; - - /* Add entries to result str */ - while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){ - - /* Toggle background color */ - if ( ($mod++) & 1){ - $col= "background-color: #ECECEC;"; - } else { - $col= "background-color: #F5F5F5;"; - } + msg_dialog::display(_("Error"), _("Can not query log database."), ERROR_DIALOG); + }else{ - $base = ", ".substr($this->config->current['BASE'],0,5)."..."; - - if(isset($this->uid_map[$line['user']])){ - $user = $this->uid_map[$line['user']]; - }else{ - $user = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['user']); + /* Display results */ + $mod= 0; + + /* Add entries to result str */ + while ($line = mysql_fetch_array($result, MYSQL_ASSOC)){ + + /* Toggle background color */ + if ( ($mod++) & 1){ + $col= "background-color: #ECECEC;"; + } else { + $col= "background-color: #F5F5F5;"; + } + + $base = ", ".substr($this->config->current['BASE'],0,5)."..."; + + if(isset($this->uid_map[$line['user']])){ + $user = $this->uid_map[$line['user']]; + }else{ + $user = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['user']); + } + $object = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['object']); + + $res.=" \n"; + $res.=" ".$line['action'].""; + $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.=" ".$line['result'].""; + $res.=" \n"; } - $object = preg_replace("/,".normalizePreg($this->config->current['BASE'])."/",$base,$line['object']); - - $res.=" \n"; - $res.=" ".$line['action'].""; - $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.=" ".$line['result'].""; -# if($line['repeated'] == 1){ -# $res.=" -"; -# }else{ -# $res.=" ".($line['repeated']-1).""; -# } - $res.=" \n"; } - mysql_close($link); + @mysql_close($link); $smarty->assign("mode".$this->sort, $sort_sign); $smarty->assign("search_result", $res); }