2006-04-26 12:28:53 +00:00
< ? php
/*
$Id : ftp_list . php , v 1.5 2003 / 06 / 10 13 : 16 : 11 root Exp $
----------------------------------------------------------------------
AlternC - Web Hosting System
Copyright ( C ) 2002 by the AlternC Development Team .
http :// alternc . org /
----------------------------------------------------------------------
Based on :
Valentin Lacambre ' s web hosting softwares : http :// altern . org /
----------------------------------------------------------------------
LICENSE
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License ( GPL )
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
To read the license please visit http :// www . gnu . org / copyleft / gpl . html
----------------------------------------------------------------------
Original Author of file : Benjamin Sonntag
Purpose of file : List ftp accounts of the user .
----------------------------------------------------------------------
*/
require_once ( " ../class/config.php " );
2009-09-08 05:29:38 +00:00
include_once ( " head.php " );
$fields = array (
" domain " => array ( " request " , " string " , " " ),
);
getFields ( $fields );
2006-04-26 12:28:53 +00:00
$noftp = false ;
if ( ! $r = $ftp -> get_list ( $domain )) {
$noftp = true ;
$error = $err -> errstr ();
}
?>
< h3 >< ? php __ ( " FTP accounts list " ); ?> </h3>
2010-05-02 05:34:36 +00:00
< hr id = " topbar " />
< br />
2010-04-28 23:58:29 +00:00
< ? php
2012-04-06 10:10:36 +00:00
if ( isset ( $error ) && $error && ! $noftp ) {
2010-04-28 23:58:29 +00:00
?>
2013-10-18 09:12:41 +00:00
< p class = " alert alert-danger " >< ? php echo $error ?> </p>
2010-04-28 23:58:29 +00:00
< ? php } ?>
< ? php if ( $quota -> cancreate ( " ftp " )) { ?>
< p >
2013-04-25 16:06:50 +00:00
< span class = " inb add " >< a href = " ftp_edit.php?create=1 " >< ? php __ ( " Create a new ftp account " ); ?> </a></span>
2010-04-28 23:58:29 +00:00
</ p >
< ? php } ?>
2006-04-26 12:28:53 +00:00
< ? php
if ( $noftp ) {
?>
< ? php $mem -> show_help ( " ftp_list_no " ); ?>
< ? php
2010-04-28 23:58:29 +00:00
include_once ( " foot.php " );
}
2006-04-26 12:28:53 +00:00
?>
2010-04-28 23:58:29 +00:00
2006-04-26 12:28:53 +00:00
< form method = " post " action = " ftp_del.php " >
2014-01-15 17:23:05 +00:00
< table class = " tlist " id = " ftp_list_table " >
< thead >
2013-03-01 07:52:50 +00:00
< tr >< th colspan = " 2 " > </ th >< th >< ? php __ ( " Enabled " ); ?> </th><th><?php __("Username"); ?></th><th><?php __("Folder"); ?></th></tr>
2014-01-15 17:23:05 +00:00
</ thead >
2006-04-26 12:28:53 +00:00
< ? php
reset ( $r );
2013-05-23 16:18:56 +00:00
while ( list ( $key , $val ) = each ( $r )) { ?>
< tr class = " lst " >
2009-09-08 05:29:38 +00:00
< 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 >
2013-04-25 12:39:24 +00:00
< td >< div class = " ina edit " >< a href = " ftp_edit.php?id=<?php echo $val["id"] ?> " >< ? php __ ( " Edit " ); ?> </a></div></td>
2010-04-28 23:58:29 +00:00
2013-04-19 07:18:25 +00:00
< 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
2013-03-01 07:52:50 +00:00
if ( $val [ 'enabled' ]) {
echo " <img src='images/check_ok.png' alt= \" " . _ ( " Enabled " ) . " \" /> " ;
2014-01-15 17:23:05 +00:00
echo " <span style='display:none;'>ENABLED</span> " ; // for tablesorter
2013-03-01 07:52:50 +00:00
} else {
echo " <img src='images/check_no.png' alt= \" " . _ ( " Disabled " ) . " \" /> " ;
2014-01-15 17:23:05 +00:00
echo " <span style='display:none;'>DISABLED</span> " ; // for tablesorter
2013-03-01 07:52:50 +00:00
}
?> </a></td>
2012-08-23 17:01:13 +00:00
< td >< label for = " del_<?php echo $val["id"] ; ?> " >< ? php echo $val [ " login " ] ?> </label>
2013-04-19 07:18:25 +00:00
< input type = 'hidden' name = 'names[<?php echo $val[' id '];?>]' value = '<?php echo $val["login"] ?>' />
2012-08-23 17:01:13 +00:00
</ td >
2013-04-19 15:31:04 +00:00
< td >
< a href = " bro_main.php?R=<?php echo urlencode(str_replace(getuserpath(),'', $val["dir"] )); ?> " >< code >< ? php echo str_replace ( getuserpath (), '' , $val [ " dir " ]) ?> </code></a>
< ? php if ( ! file_exists ( $val [ 'dir' ])) { echo " <span class= \" alerte \" > " . _ ( " Directory not found " ) . " </span> " ; } ?>
</ td >
2009-09-08 05:29:38 +00:00
</ tr >
2006-04-26 12:28:53 +00:00
< ? php
}
?>
2009-09-08 05:29:38 +00:00
</ table >
2013-04-25 16:06:50 +00:00
< p >< input type = " submit " name = " submit " class = " inb delete " value = " <?php __( " Delete checked accounts " ); ?> " /></ p >
2006-04-26 12:28:53 +00:00
</ form >
2009-09-08 05:29:38 +00:00
2013-02-26 15:05:10 +00:00
< br />
< hr />
2013-10-17 16:18:32 +00:00
< h3 >< ? php __ ( " FTP configuration information " ); ?> </h3>
2013-02-26 15:05:10 +00:00
2013-10-17 16:18:32 +00:00
< ? php __ ( " Here are some configuration information you will need to configure your FTP application. " ); ?>
2013-02-26 15:05:10 +00:00
< ul >
< li >< ? php echo '<b>' . _ ( " Server: " ) . '</b> ' . $ftp -> srv_name ; ?> </li>
2013-10-17 16:18:32 +00:00
< li >< ? php echo '<b>' . _ ( " FTP mode for data transfer: " ) . '</b> ' . _ ( " passive " ); ?> </li>
2013-02-26 15:05:10 +00:00
< li >< ? php echo '<b>' . _ ( " User/password: " ) . '</b> ' . _ ( " the one you specified when you created the account. You can edit them in the panel. " ); ?> </li>
2013-04-19 07:18:25 +00:00
</ ul >
2013-02-26 15:05:10 +00:00
2010-04-28 23:58:29 +00:00
< ? php
2009-09-08 05:29:38 +00:00
$mem -> show_help ( " ftp_list " );
?>
2014-01-15 17:23:05 +00:00
< script type = " text/javascript " >
$ ( document ) . ready ( function ()
{
$ ( " #ftp_list_table " ) . tablesorter ();
}
);
</ script >
2009-09-08 05:29:38 +00:00
< ? php include_once ( " foot.php " ); ?>