Code

Updated import
[gosa.git] / gosa-plugins / ldapmanager / addons / ldapmanager / class_csvimport.inc
index a4d8738ced737adccb4979ac1c8c6fc7842d69cc..4fac56880775c94670261cc793d1dab2d17ebe2e 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'];
       }
@@ -362,7 +362,7 @@ class csvimport extends plugin
             $str .= fread($handle,1024);
           }
 
-          $lines = split("\n",$str);
+          $lines = preg_split("/\n/",$str);
           $anz  = 0;
           $rest = 0;
           $data = array();
@@ -376,7 +376,7 @@ class csvimport extends plugin
               }
 
               $line= str_replace ("\t","",$line);
-              $cells  = split(",",$line )  ;
+              $cells  = explode(",",$line )  ;
 
               if(count($cells)> $anz ){
                 $anz = count($cells);
@@ -401,7 +401,7 @@ class csvimport extends plugin
                 $line= str_replace ("\t"  ,"" ,$line);
 
                 /* get all elements  */
-                $cells  = split(",",$line )  ;
+                $cells  = explode(",",$line )  ;
 
                 /* attach all elements to data array */
                 if(is_array($cells))