Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
ftp_doedit.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: ftp_doedit.php,v 1.3 2006/01/12 01:10:48 anarcat Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Editing an ftp account
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 $fields = array (
32  "id" => array ("post", "integer", ""),
33  "create" => array ("post", "integer", ""),
34  "pass" => array ("post", "string", ""),
35  "passconf" => array ("post", "string", ""),
36  "prefixe" => array ("post", "string", ""),
37  "login" => array ("post", "string", ""),
38  "dir" => array ("post", "string", ""),
39 );
41 
42 
43 if ($pass != $passconf) {
44  $error = _("Passwords do not match");
45  include_once("head.php");
46  echo "<h3>"._("Create a FTP account")."</h3><p class=\"alert alert-danger\">$error</p>";
47  include("foot.php");
48  exit();
49 }
50 
51 if (! $id && !$create) { //not a creation and not an edit
52  $error=_("Error: neither a creation nor an edition");
53  include("ftp_list.php");
54  exit();
55 }
56 
57 if (! $id ) { //create
58  $r=$ftp->add_ftp($prefixe,$login,$pass,$dir);
59 } else { // edit
60  $r=$ftp->put_ftp_details($id,$prefixe,$login,$pass,$dir);
61 }
62 
63 if (!$r) {
64  $error=$err->errstr();
65  $is_include=true;
66  $rr[0]["prefixe"]=$prefixe;
67  $rr[0]["login"]=$login;
68  $rr[0]["dir"]=$dir;
69  include_once("ftp_edit.php");
70  exit();
71 } else {
72  $error=_("The ftp account has been successfully saved");
73  include("ftp_list.php");
74  exit();
75 }
76 
77 ?>