From: hickert Date: Mon, 2 Aug 2010 10:07:13 +0000 (+0000) Subject: Ensure we either call the plugins constructor or manually set the initTime variable... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b089c82a888893c9319d161ae674b6ff571702ad;p=gosa.git Ensure we either call the plugins constructor or manually set the initTime variable for the new statistics plugin. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19304 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_management.inc b/gosa-core/include/class_management.inc index 4c7b0ed11..05070256b 100644 --- a/gosa-core/include/class_management.inc +++ b/gosa-core/include/class_management.inc @@ -94,8 +94,9 @@ class management $this->config = $config; $this->initTime = microtime(TRUE); - stats::log('management', $class = get_class($this), $action = 'open', $amount = 1, - $duration = (microtime(TRUE) - $this->initTime)); + // Create statistic table entry + stats::log('management', $class = get_class($this), $this->getAclCategories(), $action = 'open', + $amount = 1, $duration = (microtime(TRUE) - $this->initTime)); if($this->cpHandler) $this->headpage->setCopyPasteHandler($this->cpHandler); if($this->snapHandler) $this->headpage->setSnapshotHandler($this->snapHandler); @@ -133,6 +134,17 @@ class management #session::global_un_set(get_class($this)."_filter"); } + + /*! \brief Returns an array with all ACL-Categories we are responsible for. + */ + function getAclCategories() + { + $ret= $this->aclCategory; + if(!is_array($ret)) $ret = array($ret); + return($ret); + } + + /*! \brief Execute this plugin * Handle actions/events, locking, snapshots, dialogs, tabs,... */ @@ -441,8 +453,10 @@ class management if(isset($this->actions[$action['action']])){ $func = $this->actions[$action['action']]; if(!isset($action['targets']))$action['targets']= array(); - stats::log('management', $class = get_class($this), $action['action'], $amount = count($action['targets']), - $duration = (microtime(TRUE) - $this->initTime)); + + // Create statistic table entry + stats::log('management', $class = get_class($this), $this->getAclCategories(), $action['action'], + $amount = count($action['targets']), $duration = (microtime(TRUE) - $this->initTime)); return($this->$func($action['action'],$action['targets'],$action)); }