2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
$Id: bro_main.php,v 1.11 2004/09/06 18:14:36 anonymous 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, Remi
|
|
|
|
|
Purpose of file: Online file Browser of AlternC
|
2009-09-08 05:29:38 +00:00
|
|
|
|
TODO : Voir ??? + D<EFBFBD>placer / Copier
|
2006-04-26 12:28:53 +00:00
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
require_once("../class/config.php");
|
2009-09-08 05:29:38 +00:00
|
|
|
|
include_once ("head.php");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
2011-03-27 15:03:42 +00:00
|
|
|
|
$fields = array (
|
2012-08-21 11:43:21 +00:00
|
|
|
|
"R" => array ("request", "string", ""),
|
|
|
|
|
"o" => array ("request", "array", ""),
|
|
|
|
|
"d" => array ("request", "array", ""),
|
2011-03-27 15:03:42 +00:00
|
|
|
|
"formu" => array ("request", "integer", ""),
|
2012-08-21 11:43:21 +00:00
|
|
|
|
"actextract" => array ("request", "string", ""),
|
|
|
|
|
"fileextract" => array ("request", "string", ""),
|
2012-08-21 12:39:26 +00:00
|
|
|
|
"actperms" => array ("request", "array", ""),
|
2012-08-21 11:43:21 +00:00
|
|
|
|
"actdel" => array ("request", "string", ""),
|
|
|
|
|
"actcopy" => array ("request", "string", ""),
|
|
|
|
|
"actrename" => array ("request", "string", ""),
|
|
|
|
|
"actmove" => array ("request", "string", ""),
|
|
|
|
|
"actmoveto" => array ("request", "string", ""),
|
|
|
|
|
"nomfich" => array ("request", "string", ""),
|
|
|
|
|
"del_confirm" => array ("request", "string", ""),
|
|
|
|
|
"cancel" => array ("request", "string", ""),
|
2012-08-21 12:39:26 +00:00
|
|
|
|
"showdirsize" => array ("request", "integer", "0"),
|
2012-08-21 18:22:21 +00:00
|
|
|
|
"nomfich" => array ("request", "string", ""),
|
2011-03-27 15:03:42 +00:00
|
|
|
|
);
|
|
|
|
|
getFields($fields);
|
|
|
|
|
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$p=$bro->GetPrefs();
|
2011-03-06 21:28:14 +00:00
|
|
|
|
if (! isset($R)) $R='';
|
2006-04-26 12:28:53 +00:00
|
|
|
|
if (!$R && $p["golastdir"]) {
|
|
|
|
|
$R=$p["lastdir"];
|
|
|
|
|
}
|
|
|
|
|
$R=$bro->convertabsolute($R,1);
|
|
|
|
|
// on fait ?
|
2012-08-23 07:56:20 +00:00
|
|
|
|
if (!empty($formu) && $formu) {
|
2006-04-26 12:28:53 +00:00
|
|
|
|
switch ($formu) {
|
|
|
|
|
case 1: // Cr<43>er le r<>pertoire $R.$nomfich
|
2007-12-20 05:44:43 +00:00
|
|
|
|
if (!$bro->CreateDir($R,$nomfich)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2006-11-27 22:18:57 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$p=$bro->GetPrefs();
|
|
|
|
|
break;
|
|
|
|
|
case 6: // Cr<43>er le fichier $R.$nomfich
|
2006-11-27 22:18:57 +00:00
|
|
|
|
if (!$bro->CreateFile($R,$nomfich)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2006-11-27 22:18:57 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$p=$bro->GetPrefs();
|
|
|
|
|
if ($p["createfile"]==1) {
|
2011-03-28 12:00:33 +00:00
|
|
|
|
$editfile=$nomfich;
|
2006-04-26 12:28:53 +00:00
|
|
|
|
include("bro_editor.php");
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 2: // act vaut Supprimer Copier ou Renommer.
|
|
|
|
|
if ($actdel) {
|
2012-08-23 07:56:20 +00:00
|
|
|
|
if (!empty($del_confirm) ) {
|
2006-11-27 22:18:57 +00:00
|
|
|
|
if (!$bro->DeleteFile($d,$R)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2006-11-27 22:18:57 +00:00
|
|
|
|
}
|
2012-08-23 07:56:20 +00:00
|
|
|
|
} elseif (empty($cancel) && is_array($d)) {
|
2009-09-08 05:29:38 +00:00
|
|
|
|
include_once("head.php");
|
2006-07-08 09:39:24 +00:00
|
|
|
|
?>
|
|
|
|
|
<h3><?php printf(_("Deleting files and/or directories")); ?> : </h3>
|
2010-06-23 21:58:44 +00:00
|
|
|
|
<form action="bro_main.php" method="post" name="main" id="main">
|
2006-07-08 09:39:24 +00:00
|
|
|
|
<input type="hidden" name="formu" value="2" />
|
2006-12-24 04:45:57 +00:00
|
|
|
|
<input type="hidden" name="actdel" value="1" />
|
|
|
|
|
<input type="hidden" name="R" value="<?php echo $R?>" />
|
2007-08-23 05:52:35 +00:00
|
|
|
|
<p class="error"><?php __("WARNING: Confirm the deletion of this files"); ?></p>
|
2012-08-21 11:43:21 +00:00
|
|
|
|
<?php foreach($d as $editfile){ ?>
|
2011-03-28 12:00:33 +00:00
|
|
|
|
<p><?php echo stripslashes($editfile); ?></p>
|
|
|
|
|
<input type="hidden" name="d[]" value="<?php echo htmlentities(stripslashes($editfile)); ?>" />
|
2006-07-08 09:39:24 +00:00
|
|
|
|
<?php } ?>
|
|
|
|
|
<blockquote>
|
2006-12-24 04:45:57 +00:00
|
|
|
|
<input type="submit" class="inb" name="del_confirm" value="<?php __("Yes"); ?>" />
|
2007-08-23 06:21:06 +00:00
|
|
|
|
<input type="submit" class="inb" name="cancel" value="<?php __("No"); ?>" />
|
2006-07-08 09:39:24 +00:00
|
|
|
|
</blockquote>
|
|
|
|
|
</form>
|
|
|
|
|
<?php
|
2012-08-21 11:43:21 +00:00
|
|
|
|
include_once("foot.php");
|
2007-08-23 05:52:35 +00:00
|
|
|
|
exit();
|
2006-07-08 09:39:24 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
2008-01-22 02:41:33 +00:00
|
|
|
|
if ($actcopy) {
|
|
|
|
|
if (!$bro->CopyFile($d,$R,$actmoveto)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2008-01-22 02:41:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
if ($actmove) {
|
2006-11-27 22:18:57 +00:00
|
|
|
|
if (!$bro->MoveFile($d,$R,$actmoveto)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2006-11-27 22:18:57 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 4: // Renommage Effectif...
|
2006-11-27 22:18:57 +00:00
|
|
|
|
if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2009-09-08 05:29:38 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3: // Upload de fichier...
|
2008-01-22 03:39:01 +00:00
|
|
|
|
if (!$bro->UploadFile($R)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2006-11-27 22:18:57 +00:00
|
|
|
|
}
|
2006-04-26 12:28:53 +00:00
|
|
|
|
break;
|
2008-04-10 18:40:08 +00:00
|
|
|
|
case 7: // Changement de permissions [ML]
|
2012-06-19 15:26:48 +00:00
|
|
|
|
if (!@$bro->ChangePermissions($R, $d, $perm)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
$error = $err->errstr();
|
2008-04-10 18:40:08 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-06 21:28:14 +00:00
|
|
|
|
if (isset($actextract) && $actextract) {
|
2009-09-08 05:29:38 +00:00
|
|
|
|
print _("extracting...")."<br />\n"; flush();
|
2011-03-27 15:03:42 +00:00
|
|
|
|
if ($bro->ExtractFile($R. '/' . $fileextract, $R)) {
|
2010-06-24 00:17:20 +00:00
|
|
|
|
echo "<p class=\"error\">";
|
2008-01-22 04:14:20 +00:00
|
|
|
|
print $err->errstr();
|
2009-09-08 05:29:38 +00:00
|
|
|
|
print _("failed")."<br />\n";
|
2010-06-24 00:17:20 +00:00
|
|
|
|
echo "</p>";
|
2008-01-22 04:14:20 +00:00
|
|
|
|
} else {
|
2009-09-08 05:29:38 +00:00
|
|
|
|
print _("done")."<br />\n";
|
2008-01-22 04:14:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
/* Creation de la liste des fichiers courants */
|
2012-08-21 12:39:26 +00:00
|
|
|
|
$c=$bro->filelist($R, $showdirsize );
|
2006-04-26 12:28:53 +00:00
|
|
|
|
if ($c===false) $error=$err->errstr();
|
|
|
|
|
|
|
|
|
|
?>
|
2008-04-10 18:05:51 +00:00
|
|
|
|
<h3><?php __("File browser"); ?></h3>
|
2009-09-08 05:29:38 +00:00
|
|
|
|
<table border="0" width="100%" cellspacing="0">
|
|
|
|
|
<tr><td>
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<hr />
|
2010-06-24 00:17:20 +00:00
|
|
|
|
|
|
|
|
|
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<p class="breadcrumb">
|
|
|
|
|
<?php __("Path"); ?> / <a href="bro_main.php?R=/"><?php echo $mem->user["login"]; ?></a> / <?php echo $bro->PathList($R,"bro_main.php") ?>
|
|
|
|
|
</p>
|
|
|
|
|
|
2011-03-06 21:28:14 +00:00
|
|
|
|
<?php if (isset($error) && $error) echo "<p class=\"error\">$error</p>"; ?>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<table><tr>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<td class="formcell">
|
2010-03-04 13:51:32 +00:00
|
|
|
|
|
|
|
|
|
<form action="bro_main.php" enctype="multipart/form-data" method="post">
|
|
|
|
|
<input type="hidden" name="R" value="<?php echo $R; ?>" />
|
|
|
|
|
<input type="hidden" name="formu" value="3" />
|
|
|
|
|
|
|
|
|
|
<?php __("Send one file:"); ?><br />
|
|
|
|
|
<input class="int" name="userfile" type="file" />
|
|
|
|
|
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
|
|
|
|
|
<br />
|
|
|
|
|
<input type="submit" id="sendthisfile" class="ina" value="<?php __("Send this file"); ?>" />
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
|
<td style="width: 20px"> </td>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<td class="formcell">
|
2010-03-04 13:51:32 +00:00
|
|
|
|
|
|
|
|
|
<?php __("New file or folder:"); ?><br />
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<form action="bro_main.php" method="post" name="nn" id="nn">
|
|
|
|
|
<input type="hidden" name="R" value="<?php echo $R; ?>" />
|
2009-09-08 05:29:38 +00:00
|
|
|
|
<table><tr>
|
2010-06-02 22:20:39 +00:00
|
|
|
|
<td><input type="text" class="int" name="nomfich" id="nomfich" size="22" maxlength="255" /></td>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<td><input type="submit" class="ina" value="<?php __("Create"); ?>" /></td>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
</tr><tr><td>
|
|
|
|
|
<input type="radio" class="inc" id="nfile" onclick="document.nn.nomfich.focus();" name="formu" value="6" <?php if (!$p["crff"]) echo "checked=\"checked\""; ?> /><label for="nfile"> <?php __("File"); ?></label>
|
|
|
|
|
<input type="radio" class="inc" id="nfold" onclick="document.nn.nomfich.focus();" name="formu" value="1" <?php if ($p["crff"]) echo "checked=\"checked\""; ?> /><label for="nfold"> <?php __("Folder"); ?></label>
|
|
|
|
|
</td><td></td></tr></table>
|
|
|
|
|
</form>
|
|
|
|
|
</td></tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
2010-03-04 13:51:32 +00:00
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
</td></tr>
|
|
|
|
|
<tr><td valign="top">
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
/* Renommer / Copier / D<>placer les fichiers : */
|
2012-06-19 15:26:48 +00:00
|
|
|
|
if (isset($formu) && $formu==2 && isset($actrename) && $actrename && count($d)) {
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<table cellpadding=\"6\">\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo "<form action=\"bro_main.php\" method=\"post\">\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"formu\" value=\"4\" />\n";
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<tr><th colspan=\"2\">"._("Rename")."</th></tr>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
for ($i=0;$i<count($d);$i++) {
|
|
|
|
|
$d[$i]=ssla($d[$i]);
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<tr><td><input type=\"hidden\" name=\"o[$i]\" value=\"".$d[$i]."\" />".$d[$i]."</td>";
|
|
|
|
|
echo "<td><input type=\"text\" class=\"int\" name=\"d[$i]\" value=\"".$d[$i]."\" /></td></tr>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Rename")."\" /></td></tr>";
|
|
|
|
|
echo "</table></form>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo "<hr />\n";
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-10 18:40:08 +00:00
|
|
|
|
/* [ML] Changer les permissions : */
|
2012-08-21 12:39:26 +00:00
|
|
|
|
if ($formu==2 && ! (empty($actperms)) && count($d)) {
|
2008-04-10 18:40:08 +00:00
|
|
|
|
echo "<form action=\"bro_main.php\" method=\"post\">\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n";
|
|
|
|
|
echo "<p>"._("Permissions")."</p>";
|
|
|
|
|
|
|
|
|
|
$tmp_absdir = $bro->convertabsolute($R,0);
|
|
|
|
|
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"0\">";
|
2008-04-10 18:40:08 +00:00
|
|
|
|
echo "<tr>";
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<th>" . _("File") . "</th><th>"._("Permissions")."</th>";
|
2008-04-10 18:40:08 +00:00
|
|
|
|
echo "</tr>";
|
|
|
|
|
|
|
|
|
|
for ($i=0;$i<count($d);$i++) {
|
|
|
|
|
$d[$i]=ssla($d[$i]);
|
|
|
|
|
$stats = stat($tmp_absdir . '/' . $d[$i]);
|
|
|
|
|
$modes = $stats[2];
|
|
|
|
|
|
|
|
|
|
echo "<tr>";
|
|
|
|
|
echo "<td>".$d[$i]."</td>";
|
|
|
|
|
|
|
|
|
|
// Owner
|
|
|
|
|
echo "<td>";
|
|
|
|
|
echo "<input type=\"hidden\" name=\"d[$i]\" value=\"".$d[$i]."\" />";
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo "<label for=\"permw$i\">"._("write")."</label> <input type=\"checkbox\" id=\"permw$i\" name=\"perm[$i][w]\" value=\"1\" ". (($modes & 0000200) ? 'checked="checked"' : '') ." />";
|
2008-04-10 18:40:08 +00:00
|
|
|
|
echo "</td>";
|
|
|
|
|
|
|
|
|
|
echo "</tr>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</table>";
|
|
|
|
|
|
|
|
|
|
echo "<p><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Change permissions")."\" /></p>";
|
|
|
|
|
echo "</form>\n";
|
|
|
|
|
echo "<hr />\n";
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
/* We draw the file list and button bar only if there is files here ! */
|
|
|
|
|
if (count($c)) {
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
<form action="bro_main.php" method="post" name="main" id="main">
|
|
|
|
|
<input type="hidden" name="R" value="<?php echo $R; ?>" />
|
|
|
|
|
<input type="hidden" name="formu" value="2" />
|
2010-03-04 13:51:32 +00:00
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<table width="100%" style="border: 0px">
|
|
|
|
|
<tr><td class="lst2" style="padding: 4px 4px 8px 4px">
|
|
|
|
|
|
|
|
|
|
<input type="submit" class="ina" name="actdel" value="<?php __("Delete"); ?>" />
|
|
|
|
|
<input type="submit" class="ina" name="actrename" value="<?php __("Rename"); ?>" />
|
|
|
|
|
<input type="submit" class="ina" name="actperms" value="<?php __("Permissions"); ?>" />
|
|
|
|
|
|
|
|
|
|
|
<input type="submit" class="ina" name="actcopy" value="<?php __("Copy"); ?>" />
|
|
|
|
|
<input type="submit" class="ina" name="actmove" value="<?php __("Move"); ?>" />
|
|
|
|
|
<?php __("To"); ?>
|
|
|
|
|
<input type="text" class="int" name="actmoveto" value="" />
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
<!--
|
2010-03-04 13:51:32 +00:00
|
|
|
|
document.write("<input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.actmoveto');\" value=\" Choisir un répertoire \" class=\"bff\" />");
|
2006-04-26 12:28:53 +00:00
|
|
|
|
// -->
|
|
|
|
|
</script>
|
|
|
|
|
|
2010-03-04 13:51:32 +00:00
|
|
|
|
</td></tr>
|
|
|
|
|
|
|
|
|
|
</table>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
|
|
|
switch ($p["listmode"]) {
|
|
|
|
|
case 0:
|
|
|
|
|
/* AFFICHE 1 COLONNE DETAILLEE */
|
|
|
|
|
reset($c);
|
2010-03-04 13:51:32 +00:00
|
|
|
|
echo "<table width=\"100%\" style=\"border: 0px\" cellpadding=\"2\" cellspacing=\"0\">";
|
|
|
|
|
?>
|
|
|
|
|
<tr><th>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
<!--
|
2010-06-23 21:58:44 +00:00
|
|
|
|
document.write("<input type=\"checkbox\" id=\"checkall\" value=\"1\" class=\"inb\" onclick=\"CheckAll();\" />");
|
2010-03-04 13:51:32 +00:00
|
|
|
|
// -->
|
|
|
|
|
</script>
|
|
|
|
|
</th>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<?php if ($p["showicons"]) { ?>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<th></th>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<?php } ?>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<th><?php __("Filename"); ?></th>
|
|
|
|
|
<th><?php __("Size"); ?></th>
|
|
|
|
|
<th><?php __("Last modification"); ?></th>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<?php if ($p["showtype"]) { ?>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<th><?php __("File Type"); ?></th>
|
2010-04-06 20:29:08 +00:00
|
|
|
|
<?php } ?>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<th></th>
|
|
|
|
|
</tr>
|
|
|
|
|
<?php
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
$col=1;
|
|
|
|
|
for($i=0;$i<count($c);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\" /></td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
if ($p["showicons"]) {
|
|
|
|
|
echo "<td width=\"28\"><img src=\"icon/".$bro->icon($c[$i]["name"])."\" width=\"16\" height=\"16\" alt=\"\" /></td>";
|
|
|
|
|
}
|
|
|
|
|
echo "<td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td>";
|
|
|
|
|
echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d H:i:s",$c[$i]["date"]))."<br /></td>";
|
|
|
|
|
if ($p["showtype"]) {
|
2008-01-22 03:39:01 +00:00
|
|
|
|
echo "<td>"._($bro->mime($c[$i]["name"]))."</td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("View")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
2008-01-22 04:14:20 +00:00
|
|
|
|
$e = $bro->is_extractable($R,$c[$i]["name"]);
|
|
|
|
|
if ($e) {
|
2011-03-27 15:03:42 +00:00
|
|
|
|
echo " <a href=\"bro_main.php?actextract=1&fileextract=".urlencode($c[$i]["name"])."&R=".urlencode($R)."\">";
|
2009-09-08 05:29:38 +00:00
|
|
|
|
echo _("Extract");
|
|
|
|
|
echo "</a>";
|
2008-01-22 04:14:20 +00:00
|
|
|
|
}
|
|
|
|
|
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else { // DOSSIER :
|
2006-07-09 14:33:40 +00:00
|
|
|
|
echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
if ($p["showicons"]) {
|
|
|
|
|
echo "<td width=\"28\"><img src=\"icon/folder.png\" width=\"16\" height=\"16\" alt=\"\" /></td>";
|
|
|
|
|
}
|
|
|
|
|
echo "<td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td>";
|
|
|
|
|
echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d h:i:s",$c[$i]["date"]))."<br /></td>";
|
|
|
|
|
if ($p["showtype"]) {
|
2010-04-29 08:31:15 +00:00
|
|
|
|
echo "<td>"._("Folder")."</td>";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
/* AFFICHE 2 COLONNES COURTES */
|
|
|
|
|
reset($c);
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
echo "<tr><td valign=\"top\" width=\"50%\">";
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
$col=1;
|
|
|
|
|
for($i=0;$i<round(count($c)/2);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
|
|
|
|
echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\" /></td><td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("V")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
echo " ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</td><td valign=\"top\" width=\"50%\">";
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
$col=1;
|
|
|
|
|
for($i=round(count($c)/2);$i<count($c);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("V")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
echo " ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</td></tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
/* AFFICHE 3 COLONNES COURTES */
|
|
|
|
|
reset($c);
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
echo "<tr><td valign=\"top\" width=\"33%\">";
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
$col=1;
|
|
|
|
|
for($i=0;$i<round(count($c)/3);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("V")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
echo " ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</td><td valign=\"top\" width=\"33%\">";
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
$col=1;
|
|
|
|
|
for($i=round(count($c)/3);$i<round(2*count($c)/3);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("V")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
echo " ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</td><td valign=\"top\" width=\"33%\">";
|
|
|
|
|
echo "<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
|
|
|
|
|
$col=1;
|
|
|
|
|
for($i=round(2*count($c)/3);$i<count($c);$i++) {
|
|
|
|
|
$col=3-$col;
|
|
|
|
|
echo "<tr class=\"lst$col\">\n";
|
|
|
|
|
if ($c[$i]["type"]) {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><a href=\"";
|
2011-03-28 12:00:33 +00:00
|
|
|
|
echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."</a></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
$vu=$bro->viewurl($R,$c[$i]["name"]);
|
|
|
|
|
if ($vu) {
|
|
|
|
|
echo "<td><a href=\"$vu\">"._("View")."</a>";
|
|
|
|
|
} else {
|
|
|
|
|
echo "<td> ";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
} else {
|
|
|
|
|
echo " <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[$i]["name"]."\"></td><td><b><a href=\"";
|
|
|
|
|
echo "bro_main.php?R=".urlencode($R."/".$c[$i]["name"]);
|
2006-11-27 18:58:53 +00:00
|
|
|
|
echo "\">".htmlentities($c[$i]["name"])."/</a></b></td>\n";
|
2006-04-26 12:28:53 +00:00
|
|
|
|
echo " <td>".format_size($c[$i]["size"])."</td><td>";
|
|
|
|
|
echo " ";
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</table>";
|
|
|
|
|
echo "</td></tr>";
|
|
|
|
|
echo "</table>";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
</form>
|
2009-09-08 05:29:38 +00:00
|
|
|
|
<?php
|
2006-04-26 12:28:53 +00:00
|
|
|
|
} // is there any files here ?
|
|
|
|
|
else {
|
|
|
|
|
echo "<p class=\"error\">"._("No files in this folder")."</p>";
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
</td></tr>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<tr><td colspan="2" style="">
|
2006-04-26 12:28:53 +00:00
|
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
|
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<p>
|
|
|
|
|
<span class="ina"><a href="bro_main.php?R=<?php echo $R; ?>&showdirsize=1"><?php __("Show size of directories"); ?></a></span> <?php __("(slow)"); ?>
|
2010-05-24 12:08:10 +00:00
|
|
|
|
</p><p> </p><p>
|
2010-03-04 13:51:32 +00:00
|
|
|
|
<span class="ina"><?php
|
|
|
|
|
if ($hta->is_protected($R)) {
|
2010-04-29 08:31:15 +00:00
|
|
|
|
echo "<a href=\"hta_edit.php?dir=".(($R)?$R:"/")."\">"._("Edit this folder's protection")."</a>";
|
2010-03-04 13:51:32 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
2010-04-06 20:29:08 +00:00
|
|
|
|
echo "<a href=\"hta_add.php?value=".(($R)?$R:"/")."\">"._("Protect this folder")."</a>";
|
2010-03-04 13:51:32 +00:00
|
|
|
|
}
|
|
|
|
|
?></span> <?php __("with a login and a password"); ?>
|
|
|
|
|
</p><p>
|
|
|
|
|
<span class="ina">
|
|
|
|
|
<a href="bro_tgzdown.php?dir=<?php echo $R; ?>"><?php __("Download this folder"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
<?php printf(_("as a %s file"),$bro->l_tgz[$p["downfmt"]]); ?>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if ($id=$ftp->is_ftp($R)) {
|
2010-04-28 23:58:29 +00:00
|
|
|
|
?>
|
|
|
|
|
<span class="ina">
|
2010-04-29 10:07:15 +00:00
|
|
|
|
<a href="ftp_edit.php?id=<?php ehe($id); ?>"><?php __("Edit the ftp account"); ?></a>
|
2010-04-28 23:58:29 +00:00
|
|
|
|
</span> <?php __("that exists in this folder"); ?>
|
|
|
|
|
<?php
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
else {
|
2010-04-28 23:58:29 +00:00
|
|
|
|
?>
|
|
|
|
|
<span class="ina">
|
|
|
|
|
<a href="ftp_add.php?dir=<?php ehe($R); ?>"><?php __("Create an ftp account in this folder"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
<?php
|
2006-04-26 12:28:53 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
?>
|
2010-05-24 12:08:10 +00:00
|
|
|
|
<p> </p>
|
|
|
|
|
<p>
|
|
|
|
|
<span class="ina">
|
|
|
|
|
<a href="bro_pref.php"><?php __("Configure the file editor"); ?></a>
|
|
|
|
|
</span>
|
|
|
|
|
</p>
|
2006-04-26 12:28:53 +00:00
|
|
|
|
</td></tr></table>
|
2009-09-08 05:29:38 +00:00
|
|
|
|
<?php include_once("foot.php"); ?>
|