summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dd858e5)
raw | patch | inline | side by side (parent: dd858e5)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Feb 2008 07:03:01 +0000 (07:03 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 28 Feb 2008 07:03:01 +0000 (07:03 +0000) |
-Uses location_id now. (This means it only displays messages for the current location)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9179 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9179 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/log/addons/logview/class_gosa_logview.inc | patch | blob | history |
diff --git a/gosa-plugins/log/addons/logview/class_gosa_logview.inc b/gosa-plugins/log/addons/logview/class_gosa_logview.inc
index 9079abe39444abd65e05a903f0069a4d500fd783..41e98269d6c41d21e973524062ce3e1e39859840 100644 (file)
var $fields = array("action","timestamp","user","objecttype","object","result","repeated");
var $range = 25;
var $view_logged = FALSE;
-
+ var $location = "";
+ var $location_id = -1;
var $timezone_offset = 0;
var $uid_map = array();
/* Include config object */
$this->config= &$config;
$this->ui = get_userinfo();
+ $this->location = $this->config->current['BASE'];
/* Restore last filter settings */
$logview = session::get('logview');
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
- /* check of log database is available */
+ /* check if log database is available */
if (! @mysql_select_db($cfg['DB'])){
msg_dialog::display(_("Error"), sprintf(_("Cannot select %s database!"), "GOsa LOG"), ERROR_DIALOG);
new log("debug","logview","",array(),@mysql_error());
return ($smarty->fetch (get_template_path('gosa_log_contents.tpl', TRUE)));
}
-
+
+ /****
+ * Get location_id.
+ ****/
+
+ if($this->location_id == -1){
+ $actions = array("!ALL" => _("All"));
+ $query = "SELECT id FROM gosa_locations WHERE location='".mysql_escape_string($this->location)."';";
+ $res = @mysql_query($query);
+ if($res){
+ $attrs = @mysql_fetch_assoc($res);
+ if(isset($attrs['id'])){
+ $this->location_id = $attrs['id'];
+ }
+ }
+ }
+
/****
* Get all action types
****/
$actions = array("!ALL" => _("All"));
- $query = "SELECT distinct(action) FROM gosa_log;";
+ $query = "SELECT distinct(action) FROM gosa_log WHERE location_id='".$this->location_id."'; ";
$res = @mysql_query($query);
while($attrs = @mysql_fetch_assoc($res)){
$actions[$attrs['action']] = $attrs['action'];
$query_base .=" AND ( result like '".$sql_regex."' OR user like '".$sql_regex."') ";
}
+ /* Appen location */
+ $query_base .= " AND location_id='".$this->location_id."' ";
+
/* Get number of entries */
$query= "SELECT COUNT(`user`) ".$query_base.";";
$result = mysql_query($query);