[fix] #1550 Broken notice on multi user delete: only one reported

This commit is contained in:
alban 2014-03-26 19:00:00 +01:00
parent 832735209c
commit ab95ab4a4b
1 changed files with 10 additions and 9 deletions

View File

@ -42,26 +42,27 @@ getFields($fields);
if($del_confirm == "y"){ if($del_confirm == "y"){
if (!is_array($d)) { if (!is_array($accountList)) {
$d[]=$d; $accountList[] = $accountList;
} }
reset($d); reset($accountList);
while (list($key,$val)=each($d)) { while (list($key,$val)=each($accountList)) {
if (!$admin->checkcreator($val)) { if (!$admin->checkcreator($val)) {
__("This page is restricted to authorized staff"); __("This page is restricted to authorized staff");
exit(); exit();
} }
$error = "";
if (!($u=$admin->get($val)) || !$admin->del_mem($val)) { if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
$error=sprintf(_("Member '%s' does not exist"),$val)."<br />"; $error .= sprintf(_("Member '%s' does not exist"),$val)."<br />";
} else { } else {
$error=sprintf(_("Member %s successfully deleted"),$u["login"])."<br />"; $error .= sprintf(_("Member %s successfully deleted"),$u["login"])."<br />";
} }
} }
include("adm_list.php"); include("adm_list.php");
exit(); exit();
} else { } else {
if (!is_array($d) || count($d)==0) { if (!is_array($accountList) || count($accountList)==0) {
$error=_("Please check the accounts you want to delete"); $error=_("Please check the accounts you want to delete");
require("adm_list.php"); require("adm_list.php");
exit(); exit();
@ -77,8 +78,8 @@ if($del_confirm == "y"){
<p class="alert alert-warning"><?php __("WARNING : Confirm the deletion of the users"); ?></p> <p class="alert alert-warning"><?php __("WARNING : Confirm the deletion of the users"); ?></p>
<p> <p>
<?php <?php
foreach($d as $userid){ foreach($accountList as $userid){
$membre=$admin->get($userid); $membre = $admin->get($userid);
echo "<input type=\"hidden\" name=\"d[]\" value=\"$userid\" />".$membre['login']."<br/>"; echo "<input type=\"hidden\" name=\"d[]\" value=\"$userid\" />".$membre['login']."<br/>";
} }
?> ?>