From: hickert Date: Tue, 23 Nov 2010 08:48:01 +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=3c9ae7b86a9a08d4ff2fabe13671f1ff103420c6;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@20335 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc index 46e8c297a..7aa13dfdb 100644 --- a/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc +++ b/gosa-plugins/goto/admin/systems/goto/class_workstationGeneric.inc @@ -141,7 +141,8 @@ class workgeneric extends plugin if ($this->dn == "new"){ $ui= get_userinfo(); $this->base= dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn); - } elseif(preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", $this->dn)){ + } elseif(class_available("ArpNewDevice") && + preg_match("/".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", $this->dn)){ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", "", $this->dn); }else{ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("workgeneric", "workstationRDN"), '/')."/i", "", $this->dn); @@ -463,7 +464,14 @@ class workgeneric extends plugin } if ($ldap->count() != 0){ while ($attrs= $ldap->fetch()){ - if (preg_match("/cn=dhcp,/",$attrs['dn']) || preg_match ("/,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", $ldap->getDN())){ + + $matchArp = FALSE; + if(class_available("ArpNewDevice") && + preg_match ("/,".preg_quote(get_ou("ArpNewDevice", "systemIncomingRDN"), '/')."/i", $ldap->getDN())){ + $matchArp = TRUE; + } + + if (preg_match("/cn=dhcp,/",$attrs['dn']) || $matchArp){ continue; } else { if ($attrs['dn'] != $this->orig_dn){