Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
ftp_list.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: ftp_list.php,v 1.5 2003/06/10 13:16:11 root 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: List ftp accounts of the user.
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 include_once("head.php");
32 
33 $fields = array (
34  "domain" => array ("request", "string", ""),
35 );
37 
38 $noftp=false;
39 if (!$r=$ftp->get_list($domain)) {
40  $noftp=true;
41  $error=$err->errstr();
42 }
43 
44 ?>
45 <h3><?php __("FTP accounts list"); ?></h3>
46 <hr id="topbar"/>
47 <br />
48 
49 <?php
50 if (isset($error) && $error && !$noftp) {
51 ?>
52 <p class="alert alert-danger"><?php echo $error ?></p>
53 <?php } ?>
54 
55 <?php if ($quota->cancreate("ftp")) { ?>
56 <p>
57  <span class="inb add"><a href="ftp_edit.php?create=1"><?php __("Create a new ftp account"); ?></a></span>
58 </p>
59 <?php } ?>
60 
61 <?php
62  if ($noftp) {
63 ?>
64  <?php $mem->show_help("ftp_list_no"); ?>
65 <?php
66  include_once("foot.php");
67  }
68 ?>
69 
70 <form method="post" action="ftp_del.php">
71 <table class="tlist" id="ftp_list_table">
72 <thead>
73  <tr><th colspan="2"> </th><th><?php __("Enabled"); ?></th><th><?php __("Username"); ?></th><th><?php __("Folder"); ?></th></tr>
74 </thead>
75 <?php
76 reset($r);
77 while (list($key,$val)=each($r)) { ?>
78  <tr class="lst">
79  <td align="center"><input type="checkbox" class="inc" id="del_<?php echo $val["id"]; ?>" name="del_<?php echo $val["id"]; ?>" value="<?php echo $val["id"]; ?>" /></td>
80 <td><div class="ina edit"><a href="ftp_edit.php?id=<?php echo $val["id"] ?>"><?php __("Edit"); ?></a></div></td>
81 
82  <td><a href='ftp_switch_enable.php?id=<?php echo $val['id'].'&amp;status='.( ($val['enabled'])?'0':'1' ) ;?>' onClick='return confirm("<?php __("Are you sure you want to change his status?"); ?>");'><?php
83 if ( $val['enabled']) {
84  echo "<img src='images/check_ok.png' alt=\""._("Enabled")."\"/>";
85  echo "<span style='display:none;'>ENABLED</span>"; // for tablesorter
86 } else {
87  echo "<img src='images/check_no.png' alt=\""._("Disabled")."\"/>";
88  echo "<span style='display:none;'>DISABLED</span>"; // for tablesorter
89 }
90 
91 ?></a></td>
92  <td><label for="del_<?php echo $val["id"]; ?>"><?php echo $val["login"] ?></label>
93  <input type='hidden' name='names[<?php echo $val['id'];?>]' value='<?php echo $val["login"] ?>' />
94  </td>
95  <td>
96  <a href="bro_main.php?R=<?php echo urlencode(str_replace(getuserpath(),'', $val["dir"])); ?>"><code><?php echo str_replace(getuserpath(),'', $val["dir"]) ?></code></a>
97  <?php if ( ! file_exists($val['dir'])) { echo " <span class=\"alerte\">"._("Directory not found")."</span>"; } ?>
98  </td>
99  </tr>
100 <?php
101  }
102 ?>
103 </table>
104 <p><input type="submit" name="submit" class="inb delete" value="<?php __("Delete checked accounts"); ?>" /></p>
105 </form>
106 
107 <br/>
108 <hr/>
109 
110 <h3><?php __("FTP configuration information");?></h3>
111 
112 <?php __("Here are some configuration information you will need to configure your FTP application.");?>
113 
114 <ul>
115  <li><?php echo '<b>'._("Server:").'</b> '.$ftp->srv_name; ?></li>
116  <li><?php echo '<b>'._("FTP mode for data transfer:").'</b> '._("passive");?></li>
117  <li><?php echo '<b>'._("User/password:").'</b> '._("the one you specified when you created the account. You can edit them in the panel.");?></li>
118 </ul>
119 
120 <?php
121 $mem->show_help("ftp_list");
122 ?>
123 <script type="text/javascript">
124 
125 $(document).ready(function()
126  {
127  $("#ftp_list_table").tablesorter();
128  }
129 );
130 </script>
131 
132 <?php include_once("foot.php"); ?>