From: hickert Date: Tue, 23 Nov 2010 08:47:46 +0000 (+0000) Subject: Updated ARP dependencies! If ArpNewDevice wasn t avaiable, some plugins were broken. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b0296b8a7f4285451268daa7f06491b9d115c92b;p=gosa.git Updated ARP dependencies! If ArpNewDevice wasn t avaiable, some plugins were broken. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20331 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/systems/admin/systems/class_servGeneric.inc b/gosa-plugins/systems/admin/systems/class_servGeneric.inc index 332b49711..890fbf072 100644 --- a/gosa-plugins/systems/admin/systems/class_servGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_servGeneric.inc @@ -344,7 +344,14 @@ class servgeneric extends plugin if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ if ($attrs['dn'] != $this->orig_dn){ - if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i",$attrs['dn']) && preg_match("/,".preg_quote(get_ou("servgeneric", "serverRDN"), '/')."/i",$attrs['dn'])){ + + $matchesArp = FALSE; + if(class_available("ArpNewDevice")){ + $matchesArp = preg_match("/,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i",$attrs['dn']); + } + $matchesServer = preg_match("/,".preg_quote(get_ou("servgeneric", "serverRDN"), '/')."/i",$attrs['dn']); + + if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !$matchesArp && $matchesServer){ $message[]= msgPool::duplicated(_("Server name")); break; } @@ -354,7 +361,9 @@ class servgeneric extends plugin } /* Warn the user, that this host is currently installing */ - if($this->currently_installing && !$this->currently_installing_warned && !preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i",$this->orig_dn)){ + if($this->currently_installing && + !$this->currently_installing_warned && + !preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", $this->orig_dn)){ /* Force aborting without message dialog */ $message[] = "";