X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_plugin.inc;h=953f18ddaab3023caf0e722c82c3ce6e4a25aa6e;hb=bc81ccefd133ead30e4d43c2be5896df4fb89486;hp=47dd20c517adc7de44330e857ac973e9059d537f;hpb=3fe808c869b803beca156831aac4489b107bb100;p=gosa.git diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 47dd20c51..953f18dda 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -141,10 +141,10 @@ class plugin /* Get LDAP descriptor */ $ldap= $this->config->get_ldap_link(); - if ($dn != NULL){ + if ($dn !== NULL){ /* Load data to 'attrs' and save 'dn' */ - if ($parent != NULL){ + if ($parent !== NULL){ $this->attrs= $parent->attrs; } else { $ldap->cat ($dn); @@ -175,7 +175,6 @@ class plugin } /* Is Account? */ - error_reporting(0); $found= TRUE; foreach ($this->objectclasses as $obj){ if (preg_match('/top/i', $obj)){ @@ -186,7 +185,6 @@ class plugin break; } } - error_reporting(E_ALL | E_STRICT); if ($found){ $this->is_account= TRUE; @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, @@ -402,15 +400,12 @@ class plugin $message= array(); /* Skip if we've no config object */ - if (!isset($this->config)){ + if (!isset($this->config) || !is_object($this->config)){ return $message; } /* Find hooks entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "CHECK"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "CHECK"); - } + $command= $this->config->search(get_class($this), "CHECK", array('menu', 'tabs')); if ($command != ""){ @@ -571,10 +566,7 @@ class plugin function postcreate($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTCREATE"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTCREATE"); - } + $command= $this->config->search(get_class($this), "POSTCREATE",array('menu', 'tabs')); if ($command != ""){ @@ -606,10 +598,7 @@ class plugin function postmodify($add_attrs= array()) { /* Find postcreate entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTMODIFY"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTMODIFY"); - } + $command= $this->config->search(get_class($this), "POSTMODIFY",array('menu','tabs')); if ($command != ""){ @@ -641,11 +630,7 @@ class plugin function postremove($add_attrs= array()) { /* Find postremove entries for this class */ - $command= search_config($this->config->data['MENU'], get_class($this), "POSTREMOVE"); - if ($command == "" && isset($this->config->data['TABS'])){ - $command= search_config($this->config->data['TABS'], get_class($this), "POSTREMOVE"); - } - + $command= $this->config->search(get_class($this), "POSTREMOVE",array('menu','tabs')); if ($command != ""){ /* Additional attributes */ @@ -760,7 +745,6 @@ class plugin } $r=ldap_bind($ds,$this->config->current['ADMIN'], $this->config->current['PASSWORD']); - error_reporting (0); $sr=ldap_read($ds, @LDAP::fix($src_dn), "objectClass=*"); /* Fill data from LDAP */ @@ -769,7 +753,7 @@ class plugin $ei=ldap_first_entry($ds, $sr); if ($ei) { foreach($attrs as $attr => $val){ - if ($info = ldap_get_values_len($ds, $ei, $attr)){ + if ($info = @ldap_get_values_len($ds, $ei, $attr)){ for ($i= 0; $i<$info['count']; $i++){ if ($info['count'] == 1){ $new[$attr]= $info[$i]; @@ -783,7 +767,6 @@ class plugin } /* close conncetion */ - error_reporting (E_ALL | E_STRICT); ldap_unbind($ds); /* Adapt naming attribute */ @@ -1426,7 +1409,7 @@ class plugin $this->snapDialog = NULL; } - if($this->snapDialog){ + if(is_object($this->snapDialog )){ $this->snapDialog->save_object(); return($this->snapDialog->execute()); }