From b1c94c60182b594b0e4fb8512035388ca06de339 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 4 Jun 2007 12:34:42 +0000 Subject: [PATCH] Added repeated field git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6533 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/addons/logview/class_gosa_logview.inc | 8 +++++--- plugins/addons/logview/gosa_log_contents.tpl | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/addons/logview/class_gosa_logview.inc b/plugins/addons/logview/class_gosa_logview.inc index 92c572559..41903b60e 100644 --- a/plugins/addons/logview/class_gosa_logview.inc +++ b/plugins/addons/logview/class_gosa_logview.inc @@ -20,7 +20,7 @@ class gosa_logview extends plugin var $sort = 2; var $sort_direction = "down"; - var $fields = array("action","timestamp","user","result"); + var $fields = array("action","timestamp","user","result","repeated"); var $range = 25; var $view_logged = FALSE; @@ -83,6 +83,7 @@ class gosa_logview extends plugin $smarty->assign("mode1", ""); $smarty->assign("mode2", ""); $smarty->assign("mode3", ""); + $smarty->assign("mode4", ""); /* Assign select option content */ foreach( array("server", "action", "time", "regex") as $type){ @@ -234,7 +235,7 @@ class gosa_logview extends plugin } /* Query results */ - $query= "SELECT *".$query_base." ORDER BY ".$this->fields[$this->sort]." $desc LIMIT ".$this->start.",".$this->range.";"; + $query= "SELECT count(`action`) as 'repeated',`user`,`result`,`timestamp`,`action`,`action`,`objecttype`,`object`".$query_base." GROUP BY `action`,`result`,`timestamp` 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); @@ -259,6 +260,7 @@ class gosa_logview extends plugin $res.=" ".date("H:i:s d.m.Y",$line['timestamp']).""; $res.=" ".preg_replace("/,/",", ",$line['user']).""; $res.=" ".$line['result'].""; + $res.=" ".$line['repeated'].""; $res.=" \n"; } mysql_close($link); @@ -326,7 +328,7 @@ class gosa_logview extends plugin } $this->sort= (int)$_GET['sort']; - if ($this->sort < 0 || $this->sort > 3){ + if ($this->sort < 0 || $this->sort > 4){ $this->sort= 0; } } diff --git a/plugins/addons/logview/gosa_log_contents.tpl b/plugins/addons/logview/gosa_log_contents.tpl index f2c4b3408..992aef986 100644 --- a/plugins/addons/logview/gosa_log_contents.tpl +++ b/plugins/addons/logview/gosa_log_contents.tpl @@ -83,6 +83,7 @@ {t}Date{/t} {$mode2} {t}User{/t} {$mode1} {t}Message{/t} {$mode3} + {t}Repeated{/t} {$mode4} {$search_result} -- 2.30.2