Code

Updated CSV import.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 08:15:54 +0000 (08:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Jul 2010 08:15:54 +0000 (08:15 +0000)
-Fixed problem using some counter variable twice, $i was messed up.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19202 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/ldapmanager/addons/ldapmanager/class_csvimport.inc

index 39cd5fe3186c0d92f4273db08996a8c2d665db88..7565a656f183a9d6d9306086deba91dccb732326 100644 (file)
@@ -158,7 +158,7 @@ class csvimport extends plugin
                     $dat = $this->csvinfo['sorteddata'][$i];
 
                     /* If not all needed vars set .... */
-                    if(         ( empty($dat['sn']))||( empty($dat['givenName']))||( empty($dat['uid']))||
+                    if(( empty($dat['sn']))||( empty($dat['givenName']))||( empty($dat['uid']))||
                             (!isset($dat['sn']))||(!isset($dat['givenName']))||(!isset($dat['uid']))){
 
                         /* Output Error */
@@ -194,13 +194,12 @@ class csvimport extends plugin
                         }
 
                         // Setting user Password 
-                        if((isset($dat['userPassword']))&&(!empty($dat['userPassword'])))
+                        if((isset($dat['userPassword']))&&(!empty($dat['userPassword']))){
                             $password = $dat['userPassword']; 
-                        else
-                        {
+                        }else{
                             $rand_str="";
                             $feed = "0123456789abcdefghijklmnopqrstuvwxyz";
-                            for ($i=0; $i < 8; $i++)
+                            for ($e=0; $e < 8; $e++)
                             {
                                 $rand_str .= substr($feed, rand(0, strlen($feed)-1), 1);
                             }
@@ -218,6 +217,7 @@ class csvimport extends plugin
                             $this->usertab->save();
                             change_password($this->usertab->dn,$password); 
                         }
+                            $this->usertab->dn;
                     }
                 }