Alternc  latest
Alternc logiel libre pour l'hébergement
ftp_list.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  * List the FTP accounts of the user
22  *
23  * @copyright AlternC-Team 2000-2017 https://alternc.com/
24  */
25 
26 require_once("../class/config.php");
27 include_once("head.php");
28 
29 $fields = array (
30  "domain" => array ("request", "string", ""),
31 );
33 
34 $noftp=false;
35 if (!$r=$ftp->get_list($domain)) {
36  $noftp=true;
37 }
38 
39 ?>
40 <h3><?php __("FTP accounts list"); ?></h3>
41 <hr id="topbar"/>
42 <br />
43 
44 <?php
45 echo $msg->msg_html_all();
46 
47 if ($quota->cancreate("ftp")) { ?>
48  <p>
49  <span class="inb add"><a href="ftp_edit.php?create=1"><?php __("Create a new FTP account"); ?></a></span>
50  </p>
51 <?php
52 }
53 
54 if ($noftp) {
55  $mem->show_help("ftp_list_no");
56  include_once("foot.php");
57  exit;
58 }
59 ?>
60 
61 <form method="post" action="ftp_del.php">
62  <?php csrf_get(); ?>
63 <table class="tlist" id="ftp_list_table">
64 <thead>
65  <tr><th colspan="2"> </th><th><?php __("Enabled"); ?></th><th><?php __("Username"); ?></th><th><?php __("Folder"); ?></th></tr>
66 </thead>
67 <?php
68 reset($r);
69 while (list($key,$val)=each($r)) { ?>
70  <tr class="lst">
71  <td align="center"><input type="checkbox" class="inc" id="del_<?php ehe($val["id"]); ?>" name="del_<?php ehe($val["id"]); ?>" value="<?php ehe($val["id"]); ?>" /></td>
72 <td><div class="ina edit"><a href="ftp_edit.php?id=<?php eue($val["id"]); ?>"><?php __("Edit"); ?></a></div></td>
73 
74  <td><a href='ftp_switch_enable.php?id=<?php eue($val['id']); echo '&amp;status='.( ($val['enabled'])?'0':'1' ) ;?>' onClick='return confirm("<?php __("Are you sure you want to change his status?"); ?>");'><?php
75 if ( $val['enabled']) {
76  echo "<img src='images/check_ok.png' alt=\""._("Enabled")."\"/>";
77  echo "<span style='display:none;'>ENABLED</span>"; // for tablesorter
78 } else {
79  echo "<img src='images/check_no.png' alt=\""._("Disabled")."\"/>";
80  echo "<span style='display:none;'>DISABLED</span>"; // for tablesorter
81 }
82 
83 ?></a></td>
84  <td><label for="del_<?php ehe($val["id"]); ?>"><?php ehe($val["login"]); ?></label>
85  <input type="hidden" name="names[<?php ehe($val['id']); ?>]" value="<?php ehe($val["login"]); ?>" />
86  </td>
87  <td>
88 <a href="bro_main.php?R=<?php eue(str_replace(getuserpath(),'', $val["dir"])); ?>"><code><?php ehe(substr($val["dir"],strlen(getuserpath()) )); ?></code></a>
89  <?php if ( ! file_exists($val['dir'])) { echo " <span class=\"alerte\">"._("Directory not found")."</span>"; } ?>
90  </td>
91  </tr>
92 <?php
93  }
94 ?>
95 </table>
96 <p><input type="submit" name="submit" class="inb delete" value="<?php __("Delete checked accounts"); ?>" /></p>
97 </form>
98 
99 <br/>
100 <hr/>
101 
102 <h3><?php __("FTP configuration information");?></h3>
103 
104 <?php __("Here are some configuration information you will need to configure your FTP application.");?>
105 
106 <ul>
107  <li><?php echo '<b>'._("Server:").'</b> '.$ftp->srv_proftpd; ?></li>
108  <li><?php echo '<b>'._("FTP mode for data transfer:").'</b> '._("passive");?></li>
109  <li><?php echo '<b>'._("User/password:").'</b> '._("the one you specified when you created the account. You can edit them in the panel.");?></li>
110 </ul>
111 
112 <?php
113 $mem->show_help("ftp_list");
114 ?>
115 <script type="text/javascript">
116 
117 $(document).ready(function()
118  {
119  $("#ftp_list_table").tablesorter();
120  }
121 );
122 </script>
123 
124 <?php include_once("foot.php"); ?>
exit
Definition: adm_doadd.php:70
$mem
Definition: bootstrap.php:71
$msg
Definition: bootstrap.php:75
$r
Definition: aws_add.php:75
$domain
Definition: dom_import.php:36
$fields
List the FTP accounts of the user.
Definition: ftp_list.php:29
$noftp
Definition: ftp_list.php:34
ehe($str, $display=TRUE)
Echo the HTMLSpecialChars version of a value.
Definition: functions.php:647
__($str)
Definition: functions.php:404
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
getuserpath($user=null)
get the home of the user
Definition: functions.php:329
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$admin enabled
Definition: newone.php:38
$val
Definition: tempovars.php:15
if(empty($_POST['key'])||empty($_POST['val'])) $key
Definition: tempovars.php:14