Code

Fix issues with broken dn's
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 17:06:32 +0000 (17:06 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 6 Nov 2009 17:06:32 +0000 (17:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14790 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/personal/posix/class_posixAccount.inc
gosa-plugins/gofon/admin/systems/gofon/class_phoneGeneric.inc
gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc
gosa-plugins/netatalk/personal/netatalk/class_netatalk.inc
gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc
gosa-plugins/systems/admin/systems/class_componentGeneric.inc

index 764dc1409bd770c2e0dded2b2dc6a6b30f07eb77..9ae31c78e8f69c3a6e98abefc202e336933dfacb 100644 (file)
@@ -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);
           }
         }
index 7889e6d10a3743d434544f8aaa1971fca8e9cf81..bb6bcad4ca7d90699e0586b091d7fa0417297ae8 100644 (file)
@@ -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 != ""){
index a4d8738ced737adccb4979ac1c8c6fc7842d69cc..aba310f90cb213ff46de04bb671160d7948d4905 100644 (file)
@@ -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'];
       }
index c09a13a9eb3221448d96b380eaefdf119ad4f99e..4a74b7451a0cc8872d4fbedc9c5ec04adf146b60 100644 (file)
@@ -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);
index ca4c9074f568a6049d3f036794740bd61d5c69a5..6a907f6a0f0d0b12845845650b537e7d490cd681 100644 (file)
@@ -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);
index 766fe3b4be20ecf1a831d370aac74f577650bc1d..13f61c8f68276e1f2e5bb7f0416060e55cd11d8b 100644 (file)
@@ -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;
           }