Code

Exlude dhcp entries from existence check in check()
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Sep 2007 09:22:14 +0000 (09:22 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Sep 2007 09:22:14 +0000 (09:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7225 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 90614de98bfdf32fd4e2a000fee0e9b6388fe02f..9b890a547b10fad692b226665785bd1a4d3df045 100644 (file)
@@ -197,6 +197,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 103f536e6869957c04eec5cb636680511ba7f6ec..fc2ce9d6095333faa52b59a352e0bd8556558ace 100644 (file)
@@ -343,6 +343,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 48c23aade67277be5bfcdffd9eaaae708ad04eee..25a78d57f0c03a984086360dee0e91f56e66a427 100644 (file)
@@ -679,6 +679,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 f136a1c16c66706210948358ef3a4ec29bce2936..37e4aef73e76c6ffa502a8d1a1f0d2edcc66ab1a 100644 (file)
@@ -297,7 +297,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 ec31c831f4db43b114485a9adcceed55111d48ea..775d95dca4202875202483a68cb8a3f2c9b7d6de 100644 (file)
@@ -461,7 +461,7 @@ class termgeneric 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){
index dcf6e205136b094d6d5faf40d5dbe15d2668ca6a..97de3be8bde7509911ed6c24fdd55fe3768d7098 100644 (file)
@@ -211,6 +211,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 e3900e931c2e1b098d02dd8be6be11886fd7e4c1..4fbba785479041a6a2905e24e5678af40bff1f43 100644 (file)
@@ -441,7 +441,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){