From: cajus Date: Fri, 6 Nov 2009 17:06:32 +0000 (+0000) Subject: Fix issues with broken dn's X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=275d4257d0716889defc5fbbd5f59b5f8cc75917;p=gosa.git Fix issues with broken dn's git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14790 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 764dc1409..9ae31c78e 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -894,7 +894,7 @@ class posixAccount extends plugin if ($ldap->count() == 0){ $groupcn = $this->uid; - $groupdn= preg_replace ('/^'.$this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou().'/i', + $groupdn= preg_replace ('/^'.preg_quote($this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou(), '/').'/i', 'cn='.$groupcn.','.get_groups_ou(), $this->dn); /* Request a new and uniqe gidNumber, if required */ @@ -909,7 +909,7 @@ class posixAccount extends plugin while($ldap->dn_exists($groupdn)){ $cnt ++; $groupcn = $this->uid."_".$cnt; - $groupdn= preg_replace ('/^'.$this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou().'/i', + $groupdn= preg_replace ('/^'.preg_quote($this->config->get_cfg_value("accountPrimaryAttribute").'=[^,]+,'.get_people_ou(), '/').'/i', 'cn='.$groupcn.','.get_groups_ou(), $this->dn); } } diff --git a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc index 7889e6d10..bb6bcad4c 100644 --- a/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc +++ b/gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc @@ -63,7 +63,7 @@ class phoneGeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneRDN"), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("phoneRDN"), '/')."/i", "", $this->dn); } if($this->goFonMSN != ""){ diff --git a/gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc b/gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc index a4d8738ce..aba310f90 100644 --- a/gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc +++ b/gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc @@ -86,7 +86,7 @@ class csvimport extends plugin while($temp = $ldap->fetch($this->csvinfo['templates'])){ $tempvar ++; - $this->csvinfo['arrtemplates'][$tempvar] = $temp['sn'][0]." - ".$this->config->idepartments[preg_replace("/^[^,]+,".get_people_ou()."/i", "", $temp['dn'])]; + $this->csvinfo['arrtemplates'][$tempvar] = $temp['sn'][0]." - ".$this->config->idepartments[preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/i", "", $temp['dn'])]; $this->csvinfo['arrtempls'] [$tempvar]['name'] = $temp['sn'][0]; $this->csvinfo['arrtempls'] [$tempvar]['dn'] = $temp['dn']; } diff --git a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc index c09a13a9e..4a74b7451 100644 --- a/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc +++ b/gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc @@ -118,7 +118,7 @@ class netatalk extends plugin { if($this->dn === "new" || $this->dn === NULL) { $base = session::get('CurrentMainBase'); } else { - $base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/","",$this->dn); + $base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/i","",$this->dn); } $ldap->cd($base); diff --git a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc index ca4c9074f..6a907f6a0 100644 --- a/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc +++ b/gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc @@ -60,7 +60,7 @@ class wingeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= preg_replace ("/^[^,]+,".preg_quote(get_winstations_ou(), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_winstations_ou(), '/')."/i", "", $this->dn); } $this->cn= preg_replace("/\\\$\$/","",$this->cn); diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc index 766fe3b4b..13f61c8f6 100644 --- a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc +++ b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc @@ -50,7 +50,7 @@ class componentGeneric extends plugin $this->base= dn2base($ui->dn); $this->cn= ""; } else { - $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"), '/')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"), '/')."/i", "", $this->dn); } $this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true); /* Save dn for later references */ @@ -232,7 +232,7 @@ class componentGeneric extends plugin if(preg_match("/cn=dhcp,/",$attrs['dn'])){ continue; } - if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"), '/')."/",$attrs['dn'])){ + if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"), '/')."/i",$attrs['dn'])){ $message[]= msgPool::duplicated(_("Component name")); break; }