index bb5d80135f421177af7715334feaae413062f08e..ba5c715c72d8504c21f5a1e96a026576399a1f80 100644 (file)
*/
function plugin (&$config, $dn= NULL, $object= NULL)
{
+
+ $this->initTime = microtime(TRUE);
+
/* Configuration is fine, allways */
$this->config= &$config;
$this->dn= $dn;
}
}
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'open',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
+
/* Handle new accounts, don't read information from LDAP */
if ($dn == "new"){
return;
session::set('LOCK_VARS_USED_REQUEST',array());
pathNavigator::registerPlugin($this);
+
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'view',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
}
/*! \brief Removes object from parent
/*
$ldap->modify($this->attrs);
*/
+ if($this->initially_was_account){
+ $this->handle_pre_events('remove');
+
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'remove',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
+ }
}
/* Handle tagging */
$this->tag_attrs($this->attrs);
+
+ if($this->is_new){
+ $this->handle_pre_events('add');
+
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'create',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
+ }else{
+ $this->handle_pre_events('modify');
+
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'modify',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
+ }
+ }
+
+
+ /*! \brief Forward command execution requests
+ * to the hook execution method.
+ */
+ function handle_pre_events($mode, $addAttrs= array())
+ {
+ if(!in_array($mode, array('add','remove','modify'))){
+ trigger_error(sprintf("Invalid pre event type given %s! Valid types are [add,modify,remove].", $mode));
+ return;
+ }
+ switch ($mode){
+ case "add":
+ plugin::callHook($this,"PRECREATE", $addAttrs);
+ break;
+
+ case "modify":
+ plugin::callHook($this,"PREMODIFY", $addAttrs);
+ break;
+
+ case "remove":
+ plugin::callHook($this,"PREREMOVE", $addAttrs);
+ break;
+ }
}
return(TRUE);
}
-
+ // Create statistic table entry
+ stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'move',
+ $amount = 1, $duration = (microtime(TRUE) - $this->initTime));
+
/* Try to move the entry instead of copy & delete
*/
if(TRUE){