From b4d4053a2949c0de8e093ffeae0bf2a1af192b33 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 23 Aug 2012 17:01:13 +0000 Subject: [PATCH] Fix #1200 --- bureau/admin/ftp_del.php | 66 ++++++++++++++++++++++++++++++++------- bureau/admin/ftp_list.php | 4 ++- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/bureau/admin/ftp_del.php b/bureau/admin/ftp_del.php index 8fa254e3..c80d4168 100644 --- a/bureau/admin/ftp_del.php +++ b/bureau/admin/ftp_del.php @@ -32,17 +32,61 @@ require_once("../class/config.php"); $error=""; // On parcours les POST_VARS et on repere les del_. reset($_POST); +$lst_todel=array(); while (list($key,$val)=each($_POST)) { - if (substr($key,0,4)=="del_") { - // Effacement du compte ftp $val - $r=$ftp->delete_ftp($val); - if (!$r) { - $error.=$err->errstr()."
"; - } else { - $error.=sprintf(_("The ftp account %s has been successfully deleted"),$r)."
"; - } - } + if (substr($key,0,4)=="del_") { + $lst_todel[]=$val; + } } -include("ftp_list.php"); -exit(); + +if (empty($lst_todel)) { + header ("Location: /ftp_list.php"); + exit(); +} + +$fields = array ( + "confirm_del" => array ("post", "string", ""), + "names" => array ("post", "array", ""), +); +getFields($fields); + + +if(!empty($confirm_del)) { + foreach($lst_todel as $v) { + $r=$ftp->delete_ftp($v); + if (!$r) { + $error.=$err->errstr()."
"; + } else { + $error.=sprintf(_("The ftp account %s has been successfully deleted"),$r)."
"; + } + } + include("ftp_list.php"); + exit(); +} else { + include_once('head.php'); +?> +

+
+
+ + + +
+ \n"; + } ?> + " /> + " onclick="document.location='ftp_list.php'" /> +
+ + diff --git a/bureau/admin/ftp_list.php b/bureau/admin/ftp_list.php index b6bd43e8..435ff8cd 100644 --- a/bureau/admin/ftp_list.php +++ b/bureau/admin/ftp_list.php @@ -81,7 +81,9 @@ while (list($key,$val)=each($r)) " name="del_" value="" />
"><?php __(" />
- + + ]' value='' > +