index 3b87c5a39fe87d7d7540752aaef6ddf0c603a804..953f18ddaab3023caf0e722c82c3ce6e4a25aa6e 100644 (file)
--- a/include/class_plugin.inc
+++ b/include/class_plugin.inc
/* Get LDAP descriptor */
$ldap= $this->config->get_ldap_link();
/* Get LDAP descriptor */
$ldap= $this->config->get_ldap_link();
- if ($dn != NULL){
+ if ($dn !== NULL){
/* Load data to 'attrs' and save 'dn' */
/* Load data to 'attrs' and save 'dn' */
- if ($parent != NULL){
+ if ($parent !== NULL){
$this->attrs= $parent->attrs;
} else {
$ldap->cat ($dn);
$this->attrs= $parent->attrs;
} else {
$ldap->cat ($dn);
$message= array();
/* Skip if we've no config object */
$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 */
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 != ""){
if ($command != ""){
function postcreate($add_attrs= array())
{
/* Find postcreate entries for this class */
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 != ""){
if ($command != ""){
function postmodify($add_attrs= array())
{
/* Find postcreate entries for this class */
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 != ""){
if ($command != ""){
function postremove($add_attrs= array())
{
/* Find postremove entries for this class */
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 */
if ($command != ""){
/* Additional attributes */