From 8d5953f1c4559fcc2ac3b968ab8ed1f886aafbbe Mon Sep 17 00:00:00 2001
From: quenenni
Date: Tue, 15 Aug 2017 20:05:02 +0200
Subject: [PATCH] =?UTF-8?q?classe=20ftp=20+=20fichiers=20section=20admin?=
=?UTF-8?q?=20associ=C3=A9s?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
bureau/admin/ftp_del.php | 11 ++---
bureau/admin/ftp_doedit.php | 21 +++-----
bureau/admin/ftp_edit.php | 24 +++++----
bureau/admin/ftp_list.php | 29 +++++------
bureau/admin/ftp_switch_enable.php | 7 ++-
bureau/class/m_ftp.php | 78 +++++++++++++++---------------
6 files changed, 78 insertions(+), 92 deletions(-)
diff --git a/bureau/admin/ftp_del.php b/bureau/admin/ftp_del.php
index 7843791a..65253a86 100755
--- a/bureau/admin/ftp_del.php
+++ b/bureau/admin/ftp_del.php
@@ -29,7 +29,6 @@
*/
require_once("../class/config.php");
-$error="";
// On parcours les POST_VARS et on repere les del_.
reset($_POST);
$lst_todel=array();
@@ -54,10 +53,9 @@ 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)."
";
+ if ($r) {
+ $success=true;
+ $msg->raise("Ok", "ftp", _("The ftp account %s has been successfully deleted"),$r);
}
}
include("ftp_list.php");
@@ -71,7 +69,7 @@ if(!empty($confirm_del)) {
".$names[$t]."\n";
+ echo "- ".$names[$t]."
\n";
} ?>
@@ -87,7 +85,6 @@ if(!empty($confirm_del)) {
diff --git a/bureau/admin/ftp_doedit.php b/bureau/admin/ftp_doedit.php
index 4cee5a72..2c270484 100755
--- a/bureau/admin/ftp_doedit.php
+++ b/bureau/admin/ftp_doedit.php
@@ -39,16 +39,8 @@ $fields = array (
);
getFields($fields);
-if ($pass != $passconf) {
- $error = _("Passwords do not match");
- include_once("head.php");
- echo ""._("Create a FTP account")."
$error
";
- include("foot.php");
- exit();
-}
-
if (! $id && !$create) { //not a creation and not an edit
- $error=_("Error: neither a creation nor an edition");
+ $msg->raise("Error", "ftp", _("Error: neither a creation nor an edition"));
include("ftp_list.php");
exit();
}
@@ -60,7 +52,6 @@ if (! $id ) { //create
}
if (!$r) {
- $error=$err->errstr();
$is_include=true;
$rr[0]["prefixe"]=$prefixe;
$rr[0]["login"]=$login;
@@ -68,11 +59,11 @@ if (!$r) {
include_once("ftp_edit.php");
exit();
} else {
-if ($create) {
- $error=_("The ftp account has been successfully created");
-} else {
- $error=_("The ftp account has been successfully saved");
-}
+ if ($create)
+ $msg->raise("Ok", "ftp", _("The ftp account has been successfully created"));
+ else
+ $msg->raise("Ok", "ftp", _("The ftp account has been successfully saved"));
+
include("ftp_list.php");
exit();
}
diff --git a/bureau/admin/ftp_edit.php b/bureau/admin/ftp_edit.php
index 8925f45a..d5999827 100755
--- a/bureau/admin/ftp_edit.php
+++ b/bureau/admin/ftp_edit.php
@@ -40,29 +40,27 @@ if ( !isset($is_include) ) {
}
if (!$id && !$create) {
- $error=_("Neither a creation nor a edition");
+ $msg->raise("Error", "ftp", _("Neither a creation nor a edition"));
echo ""._("Create a FTP account")."
";
- echo "$error
";
+ echo $msg->msg_html_all();
include_once("foot.php");
exit();
}
if (!$id && $create) { //creation
echo ""._("Create a FTP account")."
";
- $rr=false;
+ if ( !isset($is_include) )
+ $rr=false;
} else {
- echo ""._("Editing a FTP account")."
";
+ echo ""._("Editing a FTP account")."
";
$rr=$ftp->get_ftp_details($id);
- if (!$rr) {
- $error=$err->errstr();
- }
}
-?>
-$error
";
-}
+echo $msg->msg_html_all();
+
+$c=$admin->listPasswordPolicies();
+$passwd_classcount = $c['ftp']['classcount'];
+
?>