Commit 7a1aca77 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #4261 Fixed premodify hook system

parent f58fed73
......@@ -661,7 +661,6 @@ class management
// Check locking & lock entry if required
$this->displayApplyBtn = FALSE;
$this->dn = "new";
$this->is_new = TRUE;
$this->is_single_edit = FALSE;
set_object_info($this->dn);
......@@ -736,7 +735,6 @@ class management
// Single edit - we only got one object dn.
if (count($target) == 1) {
$this->is_new = FALSE;
$this->is_single_edit = TRUE;
// Get the dn of the object and creates lock
......
......@@ -104,7 +104,6 @@ class plugin
/* attribute list for save action */
var $attributes = array();
var $objectclasses = array();
var $is_new = TRUE;
var $saved_attributes = array();
var $acl_base = "";
......@@ -470,7 +469,7 @@ class plugin
unset($oc['count']);
}
}
$this->is_new = !empty($oc);
$is_new = empty($oc);
/* Load (minimum) attributes, add missing ones */
$this->attrs['objectClass'] = array_merge_unique($oc, $this->objectclasses);
......@@ -479,15 +478,15 @@ class plugin
foreach ($this->attributes as $val) {
if ($this->$val != "") {
$this->attrs["$val"] = $this->$val;
} elseif (!$this->is_new) {
} elseif (!$is_new) {
$this->attrs["$val"] = array();
}
}
if ($this->is_new) {
$this->handle_pre_events('add');
} else {
if ($this->initially_was_account) {
$this->handle_pre_events('modify');
} else {
$this->handle_pre_events('add');
}
}
......
......@@ -433,7 +433,6 @@ class simpleManagement extends management
$this->displayApplyBtn = FALSE;
$this->dn = 'new';
$this->is_new = TRUE;
$this->is_single_edit = FALSE;
set_object_info($this->dn);
......@@ -584,7 +583,6 @@ class simpleManagement extends management
$type = preg_replace('/^template_/', '', $type);
}
$this->is_new = FALSE;
$this->is_single_edit = TRUE;
// Get the dn of the object and creates lock
......
......@@ -666,11 +666,11 @@ class simplePlugin extends plugin
{
/* Propagate and log the event */
if ($this->initially_was_account) {
$this->handle_post_events("modify");
new log("modify", "plugin/".get_class($this), $this->dn, array_keys($this->attrs), $this->ldap_error);
$this->handle_post_events('modify');
new log('modify', 'plugin/'.get_class($this), $this->dn, array_keys($this->attrs), $this->ldap_error);
} else {
$this->handle_post_events("add");
new log("create", "plugin/".get_class($this), $this->dn, array_keys($this->attrs), $this->ldap_error);
$this->handle_post_events('add');
new log('create', 'plugin/'.get_class($this), $this->dn, array_keys($this->attrs), $this->ldap_error);
}
}
......
......@@ -33,7 +33,6 @@ class simpleTabs
var $config;
var $acl;
var $is_template;
var $is_new = FALSE;
public $objectType = FALSE;
protected $specialTabs = TRUE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment