From: hickert Date: Wed, 5 Sep 2007 09:22:14 +0000 (+0000) Subject: Exlude dhcp entries from existence check in check() X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c0fd64a0d2bc4069d410ae157f01781507d8a3a9;p=gosa.git Exlude dhcp entries from existence check in check() git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7225 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_componentGeneric.inc b/plugins/admin/systems/class_componentGeneric.inc index 90614de98..9b890a547 100644 --- a/plugins/admin/systems/class_componentGeneric.inc +++ b/plugins/admin/systems/class_componentGeneric.inc @@ -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; diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc index 103f536e6..fc2ce9d60 100644 --- a/plugins/admin/systems/class_phoneGeneric.inc +++ b/plugins/admin/systems/class_phoneGeneric.inc @@ -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; diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 48c23aade..25a78d57f 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -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; diff --git a/plugins/admin/systems/class_servGeneric.inc b/plugins/admin/systems/class_servGeneric.inc index f136a1c16..37e4aef73 100644 --- a/plugins/admin/systems/class_servGeneric.inc +++ b/plugins/admin/systems/class_servGeneric.inc @@ -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; } diff --git a/plugins/admin/systems/class_terminalGeneric.inc b/plugins/admin/systems/class_terminalGeneric.inc index ec31c831f..775d95dca 100644 --- a/plugins/admin/systems/class_terminalGeneric.inc +++ b/plugins/admin/systems/class_terminalGeneric.inc @@ -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){ diff --git a/plugins/admin/systems/class_winGeneric.inc b/plugins/admin/systems/class_winGeneric.inc index dcf6e2051..97de3be8b 100644 --- a/plugins/admin/systems/class_winGeneric.inc +++ b/plugins/admin/systems/class_winGeneric.inc @@ -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; diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index e3900e931..4fbba7854 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -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){