From: cajus Date: Fri, 6 Nov 2009 16:48:26 +0000 (+0000) Subject: Updated a couple of files for case insensitivity X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c8f24c8399d96b407833e1d56c8ac2fd66cdc5c9;p=gosa.git Updated a couple of files for case insensitivity git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14787 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index aef3056f3..27ed27e18 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -491,7 +491,7 @@ class userManagement extends management // Adapt template values. $template_dn = $_POST['template']; $this->tabObject->adapt_from_template($template_dn, array("uid","cn","givenName","sn")); - $template_base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/')."/", '', $template_dn); + $template_base = preg_replace("/^[^,]+,".preg_quote(get_people_ou(), '/i')."/", '', $template_dn); $this->tabObject->by_object['user']->base= $template_base; // The user Tab object is already instantiated, so just go back and let the diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index 4dd7d36e1..698203dc0 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -166,7 +166,7 @@ class FAI { global $config; - if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",$dn)){ + if(!preg_match("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",$dn)){ $base = get_ou('faiBaseRDN').$dn; }else{ $base = $dn; @@ -178,7 +178,7 @@ class FAI $ldap->search("(objectClass=FAIbranch)",array("ou","dn")); while($attrs = $ldap->fetch()){ if($appendedName){ - $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/","",$attrs['dn'])); + $res[$attrs['dn']] = convert_department_dn(preg_replace("/,".preg_quote(get_ou('faiBaseRDN'), '/').".*$/i","",$attrs['dn'])); }else{ $res[$attrs['dn']] = $attrs['ou'][0]; } @@ -222,7 +222,7 @@ class FAI /* Dont't try to modify non FAIclasses */ - if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/",$obj_dn)){ + if(!preg_match("/[^,]+,".preg_quote(get_ou("faiBaseRDN"), '/')."/i",$obj_dn)){ trigger_error("PLEASE check fai class handling in ".__LINE__." -> ".__FILE__); echo "
-->".$Current_DN."
"; echo "
-->".$obj_dn."
"; @@ -923,7 +923,7 @@ class FAI $ldap->search("(objectClass=FAIbranch)",array("ou","FAIstate")); while($attrs = $ldap->fetch()){ foreach($sub_releases as $sub_rel){ - if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/",$attrs['dn'])){ + if(preg_match("/^".preg_quote($sub_rel.get_ou('faiBaseRDN'), '/')."/i",$attrs['dn'])){ $f_releases[$sub_rel.get_ou('faiBaseRDN')] = $attrs; } } diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index 5d41a5560..c9f3da869 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -554,9 +554,9 @@ class faiManagement extends plugin $ldap->cd($bb); $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/', ','.get_ou('applicationRDN'), $bb)); + $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou('applicationRDN'), $bb)); $ldap->recursive_remove(); - $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/', ','.get_ou('mimetypeRDN'), $bb)); + $ldap->cd(preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'/i', ','.get_ou('mimetypeRDN'), $bb)); $ldap->recursive_remove(); /* Search for all groups with configured application menus. @@ -564,7 +564,7 @@ class faiManagement extends plugin - The search für menu configuration for the specified release and collect all those dns. - Remove entries */ - $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN"), '/').".*$/","",$bb); + $release_ou = preg_replace("/".preg_quote(get_ou("faiBaseRDN"), '/').".*$/i","",$bb); $ldap->cd($this->config->current['BASE']); $ldap->search("(objectClass=posixGroup)",array("dn")); @@ -706,11 +706,11 @@ class faiManagement extends plugin } } - $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('applicationRDN'),$baseToUse); - $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; + $appsrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('applicationRDN'),$baseToUse); + $appdst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('applicationRDN'),"ou=".$name.",".$baseToUse) ; - $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('mimetypeRDN'),$baseToUse); - $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; + $mimesrc = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('mimetypeRDN'),$baseToUse); + $mimedst = preg_replace("/".preg_quote(get_ou('faiBaseRDN'), '/')."/i",get_ou('mimetypeRDN'),"ou=".$name.",".$baseToUse) ; /* Check if source depeartments exist */ foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){ diff --git a/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/gosa-plugins/fai/admin/fai/class_faiPackage.inc index a18c3c8ea..88fb15dc0 100644 --- a/gosa-plugins/fai/admin/fai/class_faiPackage.inc +++ b/gosa-plugins/fai/admin/fai/class_faiPackage.inc @@ -173,7 +173,7 @@ class faiPackage extends plugin /* Assemble release name */ $release = $this->parent->parent->fai_release; - $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $release); + $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $release); $tmp= preg_replace('/ou=/', '', $tmp); $rev= array_reverse(split(',', $tmp)); $this->FAIdebianRelease= "/"; @@ -571,7 +571,7 @@ class faiPackage extends plugin if($this->FAIdebianRelease == "ClearFromCopyPaste"){ $current_release = $this->parent->parent->fai_release; - $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $current_release); + $tmp= preg_replace('/,'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/i', '', $current_release); $tmp= preg_replace('/ou=/', '', $tmp); $rev= array_reverse(split(',', $tmp)); $this->FAIdebianRelease= ""; diff --git a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc index f322d0b6d..b706bd4d9 100644 --- a/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc +++ b/gosa-plugins/fai/admin/fai/class_faiSummaryTab.inc @@ -69,7 +69,7 @@ class faiSummaryTab extends plugin{ /* Get Classes and release */ $this->Classes = $this->parent->by_object['faiProfile']->FAIclasses; $this->base = $this->parent->by_object['faiProfile']->parent->parent->fai_release; - $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'), '/')."/","",$this->dn); + $str = preg_replace("/^.*".preg_quote(get_ou('faiProfileRDN'), '/')."/i","",$this->dn); $tmp = $this->parent->by_object['faiProfile']->parent->parent->getBranches(); $this->Release = $tmp[$this->base]; diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc index b6caa4d92..d5295027a 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -57,7 +57,7 @@ class application extends plugin $this->base= dn2base($ui->dn); } } else { - $this->base= preg_replace ("/^[^,]+,".get_ou('applicationRDN')."/", "", $this->dn); + $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou('applicationRDN'), '/')."/i", "", $this->dn); } $this->orig_cn = $this->cn; @@ -230,7 +230,7 @@ class application extends plugin restore_error_handler(); /* Parse release out of object dn */ - $release = preg_replace("/".get_ou("applicationRDN").preg_quote($this->base, '/')."$/","",$this->dn); + $release = preg_replace("/".preg_quote(get_ou("applicationRDN").$this->base, '/')."$/i","",$this->dn); $release = preg_replace("/^cn=[^,]+,/","",$release); /* Get a list of all groups diff --git a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc index ac4c810c6..1ceff18ae 100644 --- a/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc +++ b/gosa-plugins/goto/admin/devices/class_deviceGeneric.inc @@ -55,7 +55,7 @@ class deviceGeneric extends plugin $this->base= dn2base($ui->dn); } } else { - $this->base =preg_replace ("/^[^,]+,".get_ou('deviceRDN')."/","",$this->dn); + $this->base =preg_replace ("/^[^,]+,".preg_quote(get_ou('deviceRDN'), '/')."/i","",$this->dn); } $this->orig_base = $this->base; $this->orig_dn = $this->dn;