From: <fr...@us...> - 2007-02-01 21:07:42
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv30885 Modified Files: Tag: BRANCH-1-9 tiki-adminusers.php Log Message: [FIX]batch upload users: improve syntax checking and record reading Index: tiki-adminusers.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-adminusers.php,v retrieving revision 1.34.2.32 retrieving revision 1.34.2.33 diff -u -d -r1.34.2.32 -r1.34.2.33 --- tiki-adminusers.php 16 Jan 2007 00:05:01 -0000 1.34.2.32 +++ tiki-adminusers.php 1 Feb 2007 21:07:38 -0000 1.34.2.33 @@ -33,8 +33,13 @@ $smarty->display("error.tpl"); die; } + if ($fields[0]!="login" && $fields[0]!="password" && $fields[0]!="email" && $fields[0]!="groups") { + $smarty->assign('msg', tra("The file does not have the required header:")." login, email, password, groups"); + $smarty->display("error.tpl"); + die; + } + $data = @fgetcsv($fhandle, 1000); while (!feof($fhandle)) { - $data = fgetcsv($fhandle, 1000); $temp_max = count($fields); for ($i = 0; $i < $temp_max; $i++) { if ($fields[$i] == "login" && function_exists("mb_detect_encoding") && mb_detect_encoding($data[$i], "ASCII, UTF-8, ISO-8859-1") == "ISO-8859-1") { @@ -43,6 +48,7 @@ @$ar[$fields[$i]] = $data[$i]; } $userrecs[] = $ar; + $data = fgetcsv($fhandle, 1000); } fclose ($fhandle); if (!is_array($userrecs)) { |