31 require_once(
"../class/config.php");
32 include_once (
"head.php");
35 "R" => array (
"request",
"string",
""),
36 "o" => array (
"request",
"array",
""),
37 "d" => array (
"request",
"array",
""),
38 "perm" => array (
"post",
"array", array()),
39 "formu" => array (
"request",
"integer",
""),
40 "actextract" => array (
"request",
"string",
""),
41 "fileextract" => array (
"request",
"string",
""),
42 "actperms" => array (
"request",
"string",
""),
43 "actdel" => array (
"request",
"string",
""),
44 "actcopy" => array (
"request",
"string",
""),
45 "actrename" => array (
"request",
"string",
""),
46 "actmove" => array (
"request",
"string",
""),
47 "actmoveto" => array (
"request",
"string",
""),
48 "nomfich" => array (
"request",
"string",
""),
49 "del_confirm" => array (
"request",
"string",
""),
50 "cancel" => array (
"request",
"string",
""),
51 "showdirsize" => array (
"request",
"integer",
"0"),
52 "nomfich" => array (
"request",
"string",
""),
58 if (!
$R &&
$p[
"golastdir"]) {
61 $R=$bro->convertabsolute(
$R,1);
63 if (!empty($formu) && $formu) {
66 if (!$bro->CreateDir(
$R,$nomfich)) {
72 if (!$bro->CreateFile(
$R,$nomfich)) {
76 if (
$p[
"createfile"]==1) {
78 include(
"bro_editor.php");
84 if (!empty($del_confirm) ) {
85 if (!$bro->DeleteFile(
$d,
$R)) {
88 } elseif (empty($cancel) && is_array(
$d)) {
89 include_once(
"head.php");
91 <h3><?php printf(_(
"Deleting files and/or directories")); ?> : </h3>
92 <form action=
"bro_main.php" method=
"post" name=
"main" id=
"main">
93 <input type=
"hidden" name=
"formu" value=
"2" />
94 <input type=
"hidden" name=
"actdel" value=
"1" />
95 <input type=
"hidden" name=
"R" value=
"<?php echo ehe($R)?>" />
96 <p
class=
"alert alert-warning"><?php
__(
"WARNING: Confirm the deletion of this files"); ?></p>
97 <h2><?php echo
$mem->user[
"login"].$R.
"/"; ?></h2>
100 <li> <?php echo stripslashes($editfile); ?></li>
101 <input type=
"hidden" name=
"d[]" value=
"<?php echo htmlentities(stripslashes($editfile)); ?>" />
105 <input type=
"submit" class=
"inb ok" name=
"del_confirm" value=
"<?php __("Yes,
delete those files/folders
"); ?>" />
106 <input type=
"submit" class=
"inb cancel" name=
"cancel" value=
"<?php __("No, don
't delete those files/folders"); ?>" />
110 include_once("foot.php");
115 if (!$bro->CopyFile($d,$R,$actmoveto)) {
116 $error = $err->errstr();
120 if (!$bro->MoveFile($d,$R,$actmoveto)) {
121 $error = $err->errstr();
125 case 4: // Renommage Effectif...
126 if (!$bro->RenameFile($R,$o,$d)) { // Rename $R (directory) $o (old) $d (new) names
127 $error = $err->errstr();
130 case 3: // Upload de fichier...
131 if (!$bro->UploadFile($R)) {
132 $error = $err->errstr();
135 case 7: // Changement de permissions [ML]
136 if (!@$bro->ChangePermissions($R, $d, $perm)) {
137 $error = $err->errstr();
143 if (isset($actextract) && $actextract) {
144 print _("extracting...")."<br />\n"; flush();
145 if ($bro->ExtractFile($R. '/
' . $fileextract, $R)) {
146 echo "<p class=\"alert alert-danger\">";
147 print $err->errstr();
148 print _("failed")."<br />\n";
151 print _("done")."<br />\n";
156 <h3><?php __("File browser"); ?></h3>
157 <table border="0" width="100%" cellspacing="0">
162 <p class="breadcrumb">
163 <?php __("Path"); ?> / <a href="bro_main.php?R=/"><?php echo $mem->user["login"]; ?></a> / <?php echo $bro->PathList($R,"bro_main.php") ?>
167 /* Creation de la liste des fichiers courants */
168 $c=$bro->filelist($R, $showdirsize );
170 echo "<p class=\"alert alert-danger\">".$err->errstr()."</p>";
171 require_once('foot.php
');
175 if (isset($error) && $error) echo "<p class=\"alert alert-danger\">$error</p>";
179 <td class="formcell">
181 <form action="bro_main.php" enctype="multipart/form-data" method="post">
182 <input type="hidden" name="R" value="<?php echo $R; ?>" />
183 <input type="hidden" name="formu" value="3" />
185 <?php __("Send one file:"); ?><br />
186 <input class="int" name="userfile" type="file" />
188 <input type="submit" id="sendthisfile" class="ina" value="<?php __("Send this file"); ?>" />
189 <?php echo sprintf(_("Warning: max size: %s"),$bro->getMaxAllowedUploadSize() ); ?>
193 <td style="width: 20px"> </td>
194 <td class="formcell">
196 <?php __("New file or folder:"); ?><br />
197 <form action="bro_main.php" method="post" name="nn" id="nn">
198 <input type="hidden" name="R" value="<?php echo $R; ?>" />
200 <td><input type="text" class="int" name="nomfich" id="nomfich" size="22" maxlength="255" /></td>
201 <td><input type="submit" class="ina" value="<?php __("Create"); ?>" /></td>
203 <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>
204 <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>
205 </td><td></td></tr></table>
212 <tr><td valign="top">
215 /* Renommer / Copier / D�placer les fichiers : */
216 if (isset($formu) && $formu==2 && isset($actrename) && $actrename && count($d)) {
217 echo "<table cellpadding=\"6\">\n";
218 echo "<form action=\"bro_main.php\" method=\"post\">\n";
219 echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n";
220 echo "<input type=\"hidden\" name=\"formu\" value=\"4\" />\n";
221 echo "<tr><th colspan=\"2\">"._("Rename")."</th></tr>";
222 for ($i=0;$i<count($d);$i++) {
224 echo "<tr><td><input type=\"hidden\" name=\"o[$i]\" value=\"".$d[$i]."\" />".$d[$i]."</td>";
225 echo "<td><input type=\"text\" class=\"int\" name=\"d[$i]\" value=\"".$d[$i]."\" /></td></tr>";
227 echo "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Rename")."\" /></td></tr>";
228 echo "</table></form>\n";
232 /* [ML] Changer les permissions : */
233 if ($formu==2 && ! (empty($actperms)) && count($d)) {
234 echo "<form action=\"bro_main.php\" method=\"post\">\n";
235 echo "<input type=\"hidden\" name=\"R\" value=\"$R\" />\n";
236 echo "<input type=\"hidden\" name=\"formu\" value=\"7\" />\n";
237 echo "<p>"._("Permissions")."</p>";
239 $tmp_absdir = $bro->convertabsolute($R,0);
241 echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"0\">";
243 echo "<th>" . _("File") . "</th><th>"._("Permissions")."</th>";
246 for ($i=0;$i<count($d);$i++) {
248 $stats = stat($tmp_absdir . '/
' . $d[$i]);
252 echo "<td>".$d[$i]."</td>";
256 echo "<input type=\"hidden\" name=\"d[$i]\" value=\"".$d[$i]."\" />";
257 echo "<label for=\"permw$i\">"._("write")."</label> <input type=\"checkbox\" id=\"permw$i\" name=\"perm[$i][w]\" value=\"1\" ". (($modes & 0000200) ? 'checked=
"checked"' : '') ." />";
265 echo "<p><input type=\"submit\" class=\"inb\" name=\"submit\" value=\""._("Change permissions")."\" /></p>";
270 /* We draw the file list and button bar only if there is files here ! */
274 <form action="bro_main.php" method="post" name="main" id="main">
275 <input type="hidden" name="R" value="<?php echo $R; ?>" />
276 <input type="hidden" name="formu" value="2" />
281 <table width="100%" style="border: 0px">
282 <tr><td class="" style="padding: 4px 4px 8px 4px">
284 <input type="submit" class="ina" name="actdel" value="<?php __("Delete"); ?>" />
285 <input type="submit" class="ina" name="actrename" value="<?php __("Rename"); ?>" />
286 <input type="submit" class="ina" name="actperms" value="<?php __("Permissions"); ?>" />
288 <input type="submit" class="ina" name="actcopy" value="<?php __("Copy"); ?>" onClick=" return actmoveto_not_empty();"/>
289 <input type="submit" class="ina" name="actmove" value="<?php __("Move"); ?>" onClick=" return actmoveto_not_empty();"/>
291 <input type="text" class="int" id='actmoveto
' name="actmoveto" value="" />
292 <?php display_browser( "" , "main.actmoveto" ); ?>
298 <script type="text/javascript">
299 function actmoveto_not_empty() {
300 if ( $('#actmoveto
').val() =='' ) {
301 alert("<?php __("Please select a destination folder");?>");
311 switch ($p["listmode"]) {
313 /* AFFICHE 1 COLONNE DETAILLEE */
315 echo "<table width=\"100%\" id='tab_files_w_details
' class=\"tlist\" style=\"border: 0px\" cellpadding=\"2\" cellspacing=\"0\"><thead>";
318 <script type="text/javascript">
320 document.write("<input type=\"checkbox\" id=\"checkall\" value=\"1\" class=\"inb\" onclick=\"CheckAll();\" />");
324 <?php if ($p["showicons"]) { ?>
325 <th style="text-align: center;"><?php if (!empty($R)) { echo $bro->PathList($R,"bro_main.php",true); }?></th>
327 <th><?php __("Filename"); ?></th>
328 <th><?php __("Size"); ?></th>
329 <th><?php __("Last modification"); ?></th>
330 <?php if ($p["showtype"]) { ?>
331 <th><?php __("File Type"); ?></th>
337 for($i=0;$i<count($c);$i++) {
338 echo "<tr class=\"lst\">\n";
339 if ($c[$i]["type"]) {
340 echo " <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities($c[$i]["name"])."\" /></td>";
341 if ($p["showicons"]) {
342 echo "<td style='text-align: center;
' width=\"28\"><img src=\"icon/".$bro->icon($c[$i]["name"])."\" width=\"16\" height=\"16\" alt=\"\" /></td>";
344 echo "<td><a href=\"";
345 $canedit = $bro->can_edit($R,$c[$i]["name"]);
347 echo "bro_editor.php?editfile=".urlencode($c[$i]["name"])."&R=".urlencode($R);
349 echo "bro_downloadfile.php?dir=".urlencode($R)."&file=".urlencode($c[$i]["name"]);
351 echo "\">"; ehe($c[$i]["name"]);
353 echo " <td>".format_size($c[$i]["size"])."</td>";
354 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>";
355 if ($p["showtype"]) {
356 echo "<td>"._($bro->mime($c[$i]["name"]))."</td>";
358 $vu=$bro->viewurl($R,$c[$i]["name"]);
360 echo "<td><a href=\"$vu\">"._("View")."</a>";
364 $e = $bro->is_extractable($R,$c[$i]["name"]);
366 echo " <a href=\"bro_main.php?actextract=1&fileextract=".urlencode($c[$i]["name"])."&R=".urlencode($R)."\">";
370 $ez = $bro->is_sqlfile($R,$c[$i]["name"]);
372 echo " <a href=\"javascript:;\" onClick=\"$('#rest_db_
$i').toggle();\">";
373 echo _("Restore SQL");
375 echo "<div id='rest_db_
$i' style='display:none;
'><fieldset><legend>"._("Restore SQL")."</legend>"._("In which database to you want to restore this dump?");
377 echo "<input type='hidden
' name ='filename
' value='".htmlentities($R."/
".$c[$i]["name
"])."' />";
378 $dbl=array(); foreach ($mysql->get_dblist() as $v) { $dbl[]=$v['db
'];}
379 echo "<select id='db_name_
$i'>"; eoption($dbl,'',true); echo "</select>" ;
380 echo "<a href='javascript:;
' onClick='window.location=\
"sql_restore.php?filename=".urlencode(
$R.
"/".
$c[
$i][
"name"]).
"&id=\"+encodeURIComponent($(\"#db_name_$i\").val()) ;'>"._(
"Restore it").
"</a>";
381 echo
"</fieldset></div>";
386 echo
" <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".htmlentities(
$c[
$i][
"name"]).
"\" /></td>";
387 if (
$p[
"showicons"]) {
388 echo
"<td width=\"28\" style='text-align: center;'><img src=\"icon/folder.png\" width=\"16\" height=\"16\" alt=\"\" /></td>";
390 echo
"<td><b><a href=\"";
391 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
392 echo
"\">";
ehe(
$c[$i][
"name"]); echo
"/</a></b></td>\n";
393 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td>";
394 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>";
395 if (
$p[
"showtype"]) {
396 echo
"<td>"._(
"Folder").
"</td>";
404 echo
"</tbody></table>";
409 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
410 echo
"<tr><td valign=\"top\" width=\"50%\">";
411 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
412 for(
$i=0;
$i<round(count(
$c)/2);
$i++) {
413 echo
"<tr class=\"lst\">\n";
414 if (
$c[
$i][
"type"]) {
415 echo
" <td width=\"28\"><input type=\"checkbox\" class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\" /></td><td><a href=\"";
416 echo
"bro_editor.php?editfile=".urlencode(
$c[$i][
"name"]).
"&R=".urlencode(
$R);
417 echo
"\">".htmlentities(
$c[$i][
"name"]).
"</a></td>\n";
418 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
419 $vu=$bro->viewurl(
$R,
$c[$i][
"name"]);
421 echo
"<td><a href=\"$vu\">"._(
"V").
"</a>";
427 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><b><a href=\"";
428 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
429 echo
"\">".htmlentities(
$c[$i][
"name"]).
"/</a></b></td>\n";
430 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
438 echo
"</td><td valign=\"top\" width=\"50%\">";
439 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
440 for(
$i=round(count(
$c)/2);
$i<count(
$c);
$i++) {
441 echo
"<tr class=\"lst\">\n";
442 if (
$c[
$i][
"type"]) {
443 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><a href=\"";
444 echo
"bro_editor.php?editfile=".urlencode(
$c[$i][
"name"]).
"&R=".urlencode(
$R);
445 echo
"\">".htmlentities(
$c[$i][
"name"]).
"</a></td>\n";
446 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
447 $vu=$bro->viewurl(
$R,
$c[$i][
"name"]);
449 echo
"<td><a href=\"$vu\">"._(
"V").
"</a>";
455 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><b><a href=\"";
456 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
457 echo
"\">".htmlentities(
$c[$i][
"name"]).
"/</a></b></td>\n";
458 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
472 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
473 echo
"<tr><td valign=\"top\" width=\"33%\">";
474 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
475 for(
$i=0;
$i<round(count(
$c)/3);
$i++) {
476 echo
"<tr class=\"lst\">\n";
477 if (
$c[
$i][
"type"]) {
478 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><a href=\"";
479 echo
"bro_editor.php?editfile=".urlencode(
$c[$i][
"name"]).
"&R=".urlencode(
$R);
480 echo
"\">".htmlentities(
$c[$i][
"name"]).
"</a></td>\n";
481 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
482 $vu=$bro->viewurl(
$R,
$c[$i][
"name"]);
484 echo
"<td><a href=\"$vu\">"._(
"V").
"</a>";
490 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><b><a href=\"";
491 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
492 echo
"\">".htmlentities(
$c[$i][
"name"]).
"/</a></b></td>\n";
493 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
501 echo
"</td><td valign=\"top\" width=\"33%\">";
502 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
503 for(
$i=round(count(
$c)/3);
$i<round(2*count(
$c)/3);
$i++) {
504 echo
"<tr class=\"lst\">\n";
505 if (
$c[
$i][
"type"]) {
506 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><a href=\"";
507 echo
"bro_editor.php?editfile=".urlencode(
$c[$i][
"name"]).
"&R=".urlencode(
$R);
508 echo
"\">".htmlentities(
$c[$i][
"name"]).
"</a></td>\n";
509 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
510 $vu=$bro->viewurl(
$R,
$c[$i][
"name"]);
512 echo
"<td><a href=\"$vu\">"._(
"V").
"</a>";
519 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><b><a href=\"";
520 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
521 echo
"\">".htmlentities(
$c[$i][
"name"]).
"/</a></b></td>\n";
522 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
530 echo
"</td><td valign=\"top\" width=\"33%\">";
531 echo
"<table width=\"100%\" border=0 cellpadding=0 cellspacing=0>";
532 for(
$i=round(2*count(
$c)/3);
$i<count(
$c);
$i++) {
533 echo
"<tr class=\"lst\">\n";
534 if (
$c[
$i][
"type"]) {
535 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><a href=\"";
536 echo
"bro_editor.php?editfile=".urlencode(
$c[$i][
"name"]).
"&R=".urlencode(
$R);
537 echo
"\">".htmlentities(
$c[$i][
"name"]).
"</a></td>\n";
538 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
539 $vu=$bro->viewurl(
$R,
$c[$i][
"name"]);
541 echo
"<td><a href=\"$vu\">"._(
"View").
"</a>";
547 echo
" <td width=\"28\"><input TYPE=checkbox class=\"inc\" name=\"d[]\" value=\"".$c[
$i][
"name"].
"\"></td><td><b><a href=\"";
548 echo
"bro_main.php?R=".urlencode(
$R.
"/".
$c[$i][
"name"]);
549 echo
"\">".htmlentities(
$c[$i][
"name"]).
"/</a></b></td>\n";
550 echo
" <td>".format_size(
$c[$i][
"size"]).
"</td><td>";
567 echo
"<p class=\"alert alert-info\">"._(
"No files in this folder").
"</p>";
572 <tr><td colspan=
"2" style=
"">
577 <span
class=
"ina"><a href=
"bro_main.php?R=<?php echo (($R)?$R:"/
"); ?>&showdirsize=1"><?php
__(
"Show size of directories"); ?></a></span> <?php
__(
"(slow)"); ?>
579 <span
class=
"ina"><?php
580 if ($hta->is_protected(
$R)) {
581 echo
"<a href=\"hta_edit.php?dir=".(($R)?
$R:
"/").
"\">"._(
"Edit this folder's protection").
"</a>";
584 echo
"<a href=\"hta_add.php?dir=".(($R)?
$R:
"/").
"\">"._(
"Protect this folder").
"</a>";
586 ?></span> <?php
__(
"with a login and a password"); ?>
589 <a href=
"bro_tgzdown.php?dir=<?php echo (($R)?$R:"/
") ?>"><?php
__(
"Download this folder"); ?></a>
591 <?php printf(_(
"as a %s file"),$bro->l_tgz[
$p[
"downfmt"]]); ?>
595 if ($id=$ftp->is_ftp(
$R)) {
598 <a href=
"ftp_edit.php?id=<?php ehe($id); ?>"><?php
__(
"Edit the ftp account"); ?></a>
599 </span> <?php
__(
"that exists in this folder"); ?>
605 <a href=
"ftp_edit.php?create=1&dir=<?php ehe($R); ?>"><?php
__(
"Create an ftp account in this folder"); ?></a>
614 <a href=
"bro_pref.php"><?php
__(
"Configure the file editor"); ?></a>
619 <script type=
"text/javascript">
620 $(document).ready(
function() { $(
"#tab_files_w_details").tablesorter(); } );
623 <?php include_once(
"foot.php"); ?>