Code

Updated ARP dependencies! If ArpNewDevice wasn t avaiable, some plugins were broken.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Nov 2010 08:47:46 +0000 (08:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Nov 2010 08:47:46 +0000 (08:47 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20331 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_servGeneric.inc

index 332b497118ab0871ef19e3ae8ad771ad386512ed..890fbf07279b46b2ea48fcf4b57153a2311e4ade 100644 (file)
@@ -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[] = "";