Code

Exclude dhcp settings from existence check for given cn when creating new objects .
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Sep 2007 09:20:51 +0000 (09:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Sep 2007 09:20:51 +0000 (09:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7224 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_componentGeneric.inc
plugins/admin/systems/class_phoneGeneric.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_servGeneric.inc
plugins/admin/systems/class_terminalGeneric.inc
plugins/admin/systems/class_winGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc

index 5b100d469a608e837e4aaf2e53a5eda3c38f31b1..2e65dccb06dd49077e326a59ea1ad929d0ae1ffd 100644 (file)
@@ -170,6 +170,9 @@ class componentGeneric extends plugin
       $ldap->search ("(cn=".$this->cn.")", array("cn"));
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
+          if(preg_match("/cn=dhcp,/",$attrs['dn'])){
+            continue;
+          }
           if ($attrs['dn'] != $this->orig_dn){
             $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
             break;
index 2c0eaaf879b18ad208f0159187cf8cb7425ee5a7..5faf9ce2ba038d2617332b733c35eeb207d2ac79 100644 (file)
@@ -316,6 +316,11 @@ class phoneGeneric extends plugin
       $ldap->search ("(cn=".$this->cn.")", array("cn"));
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
+
+          if(preg_match("/cn=dhcp,/",$attrs['dn'])){
+            continue;
+          }
+  
           if ($attrs['dn'] != $this->orig_dn){
             $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
             break;
index 12c043c258e51362bbe1a64735f2ee43bd5f22ab..12b80670eaf80058aeb026814318fb5ff09c6023 100644 (file)
@@ -665,6 +665,9 @@ class printgeneric extends plugin
       $ldap->ls("(cn=".$this->cn.")","ou=printers,ou=systems,".$this->base, array("cn"));
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
+          if(preg_match("/cn=dhcp,/",$attrs['dn'])){
+            continue;
+          }
           if ($attrs['dn'] != $this->orig_dn){
             $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
             break;
index 55c4f425ca81c2b7722072c3e13d0f2d228fc71d..d730adafecfc220ee460ed65de51ab61afac623f 100644 (file)
@@ -259,7 +259,7 @@ class servgeneric extends plugin
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
           if ($attrs['dn'] != $this->orig_dn){
-            if(!preg_match("/,ou=incoming,/",$attrs['dn']) && preg_match("/,ou=servers,ou=systems,/",$attrs['dn'])){
+            if(!preg_match("/cn=dhcp,/",$attrs['dn']) && !preg_match("/,ou=incoming,/",$attrs['dn']) && preg_match("/,ou=servers,ou=systems,/",$attrs['dn'])){
               $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
               break;
             }
index e415287910f20279559941968cab06bf6c8692a7..dcfce668c29693af556020d05854451cbff0c0ba 100644 (file)
@@ -436,7 +436,7 @@ class termgeneric extends plugin
       /* Check if there are some other terminals found */
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
-          if (preg_match ("/,ou=incoming,/", $ldap->getDN())){
+          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,ou=incoming,/", $ldap->getDN())){
             continue;
           } else {
             if ($attrs['dn'] != $this->orig_dn){
index 6fe4b7608bbe27932f06707093a355c0f6be2a33..d73f766a809f32c3156dc92ea425755040600d5a 100644 (file)
@@ -181,6 +181,9 @@ class wingeneric extends plugin
       $ldap->search ("(cn=".$this->cn.")", array("cn"));
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
+          if(preg_match("/cn=dhcp,/",$attrs['dn'])){
+            continue;
+          }
           if ($attrs['dn'] != $this->orig_dn){
             $message[]= sprintf (_("There is already an entry '%s' in the base choosen by you"), $this->cn);
             break;
index 37742181ff5df3ef2eac247714b3ab81f8911809..341dc15a86b0b2cfe285a0ca0cb18c0b4516020c 100644 (file)
@@ -397,7 +397,7 @@ class workgeneric extends plugin
       }
       if ($ldap->count() != 0){
         while ($attrs= $ldap->fetch()){
-          if (preg_match ("/,ou=incoming,/", $ldap->getDN())){
+          if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,ou=incoming,/", $ldap->getDN())){
             continue;
           } else {
             if ($attrs['dn'] != $this->orig_dn){