From: <sy...@us...> - 2005-10-04 10:53:42
|
Update of /cvsroot/tikiwiki/tiki In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17101 Modified Files: tiki-adminusers.php Log Message: fix nb of dicarded when only group pb Index: tiki-adminusers.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/tiki-adminusers.php,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- tiki-adminusers.php 3 Oct 2005 21:45:47 -0000 1.55 +++ tiki-adminusers.php 4 Oct 2005 10:53:34 -0000 1.56 @@ -50,21 +50,27 @@ die; } $added = 0; + $discards = 0; foreach ($userrecs as $u) { $exist = false; if (empty($u['login'])) { - if (!empty($u['password']) || !empty($u['email'])) // not empty line + if (!empty($u['password']) || !empty($u['email'])) { // not empty line $discarded[] = discardUser($u, tra("User login is required")); + ++$discards; + } continue; } elseif (empty($u['password'])) { $discarded[] = discardUser($u, tra("Password is required")); + ++$discards; continue; } elseif (empty($u['email'])) { $discarded[] = discardUser($u, tra("Email is required")); + ++$discards; continue; } elseif ($userlib->user_exists($u['login'])) { if ($_REQUEST['overwrite'] == 'n') { $discarded[] = discardUser($u, tra("User is duplicated")); + ++$discards; continue; } $exist = true; @@ -81,6 +87,7 @@ $u['login'] = $uu; } else if ($_REQUEST['overwrite'] == 'n') { $discarded[] = discardUser($u, tra("User is duplicated").': '.$uu); + ++$discards; continue; } } @@ -103,10 +110,10 @@ $added++; } $smarty->assign('added', $added); - if (@is_array($discarded)) { - $smarty->assign('discarded', count($discarded)); - } - @$smarty->assign('discardlist', $discarded); + if ($discards > 0) + $smarty->assign('discarded', $discards); + if (count($discarded) > 0) + $smarty->assign('discardlist', $discarded); } $cookietab = "1"; |