Alternc  latest
Alternc logiel libre pour l'hébergement
ftp_doedit.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * change settings of an FTP account
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 $fields = array (
28  "id" => array ("post", "integer", ""),
29  "create" => array ("post", "integer", ""),
30  "pass" => array ("post", "string", ""),
31  "passconf" => array ("post", "string", ""),
32  "prefixe" => array ("post", "string", ""),
33  "login" => array ("post", "string", ""),
34  "dir" => array ("post", "string", ""),
35 );
37 
38 if (! $id && !$create) { //not a creation and not an edit
39  $msg->raise("ERROR", "ftp", _("Error: neither a creation nor an edition"));
40  include("ftp_list.php");
41  exit();
42 }
43 
44 if (! $id ) { //create
45  $r=$ftp->add_ftp($prefixe,$login,$pass,$dir);
46 } else { // edit
47  $r=$ftp->put_ftp_details($id,$prefixe,$login,$pass,$dir);
48 }
49 
50 if (!$r) {
51  $is_include=true;
52  $rr[0]["prefixe"]=$prefixe;
53  $rr[0]["login"]=$login;
54  $rr[0]["dir"]=$dir;
55  include_once("ftp_edit.php");
56  exit();
57 } else {
58  if ($create)
59  $msg->raise("INFO", "ftp", _("The FTP account has been successfully created"));
60  else
61  $msg->raise("INFO", "ftp", _("The FTP account has been successfully saved"));
62 
63  include("ftp_list.php");
64  exit();
65 }
66 
67 ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
if(! $r=$aws->get_list()) $create
Definition: aws_list.php:34
$fields
change settings of an FTP account
Definition: ftp_doedit.php:27
$rr
Definition: ftp_edit.php:52
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
$login
if(!isset($is_include)) if(! $key &&! $crt) $id
if($error) $is_include
Definition: ssl_donew.php:55