We know SHOW the 'protected' files in the browser, so that you understand why you can't edit them
This commit is contained in:
parent
edf639d048
commit
fa5ca54555
|
@ -62,13 +62,13 @@ $R=$bro->convertabsolute($R,1);
|
||||||
// on fait ?
|
// on fait ?
|
||||||
if (!empty($formu) && $formu) {
|
if (!empty($formu) && $formu) {
|
||||||
switch ($formu) {
|
switch ($formu) {
|
||||||
case 1: // Cr<EFBFBD>er le r<>pertoire $R.$nomfich
|
case 1: // Create the folder $R.$nomfich
|
||||||
if (!$bro->CreateDir($R,$nomfich)) {
|
if (!$bro->CreateDir($R,$nomfich)) {
|
||||||
$error = $err->errstr();
|
$error = $err->errstr();
|
||||||
}
|
}
|
||||||
$p=$bro->GetPrefs();
|
$p=$bro->GetPrefs();
|
||||||
break;
|
break;
|
||||||
case 6: // Cr<EFBFBD>er le fichier $R.$nomfich
|
case 6: // Create the file $R.$nomfich
|
||||||
if (!$bro->CreateFile($R,$nomfich)) {
|
if (!$bro->CreateFile($R,$nomfich)) {
|
||||||
$error = $err->errstr();
|
$error = $err->errstr();
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ if (!empty($formu) && $formu) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7: // Changement de permissions [ML]
|
case 7: // Changement de permissions [ML]
|
||||||
if (!@$bro->ChangePermissions($R, $d, $perm)) {
|
if (!$bro->ChangePermissions($R, $d, $perm)) {
|
||||||
$error = $err->errstr();
|
$error = $err->errstr();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -331,7 +331,7 @@ function actmoveto_not_empty() {
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr></thead><tbody>
|
</tr></thead><tbody>
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
for($i=0;$i<count($c);$i++) {
|
for($i=0;$i<count($c);$i++) {
|
||||||
echo "<tr class=\"lst\">\n";
|
echo "<tr class=\"lst\">\n";
|
||||||
|
@ -348,7 +348,11 @@ function actmoveto_not_empty() {
|
||||||
echo "bro_downloadfile.php?dir=".urlencode($R)."&file=".urlencode($c[$i]["name"]);
|
echo "bro_downloadfile.php?dir=".urlencode($R)."&file=".urlencode($c[$i]["name"]);
|
||||||
}
|
}
|
||||||
echo "\">"; ehe($c[$i]["name"]);
|
echo "\">"; ehe($c[$i]["name"]);
|
||||||
echo"</a></td>\n";
|
echo"</a>";
|
||||||
|
if (!($c[$i]["permissions"] & 0000200)) {
|
||||||
|
echo " (<a href=\"bro_main.php?actperms=Permissions&R=".urlencode($R)."&formu=2&d[]=".urlencode($c[$i]["name"])."\">"._("protected")."</a>)";
|
||||||
|
}
|
||||||
|
echo "</td>\n";
|
||||||
echo " <td>".format_size($c[$i]["size"])."</td>";
|
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>";
|
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"]) {
|
if ($p["showtype"]) {
|
||||||
|
|
|
@ -206,11 +206,15 @@ class m_bro {
|
||||||
$err->raise('bro', _("This directory is not readable."));
|
$err->raise('bro', _("This directory is not readable."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
clearstatcache(true);
|
||||||
$c = array();
|
$c = array();
|
||||||
if ($dir = @opendir($absolute)) {
|
if ($dir = @opendir($absolute)) {
|
||||||
while (($file = readdir($dir)) !== false) {
|
while (($file = readdir($dir)) !== false) {
|
||||||
if ($file != "." && $file != "..") {
|
if ($file != "." && $file != "..") {
|
||||||
$c[] = array("name" => $file, "size" => $this->fsize($absolute . "/" . $file, $showdirsize), "date" => filemtime($absolute . "/" . $file), "type" => (!is_dir($absolute . "/" . $file)));
|
$stat=stat($absolute . "/" . $file);
|
||||||
|
$c[] = array("name" => $file, "size" => $this->fsize($absolute . "/" . $file, $showdirsize),
|
||||||
|
"date" => filemtime($absolute . "/" . $file), "type" => (!is_dir($absolute . "/" . $file)),
|
||||||
|
"permissions" => $stat[2] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($dir);
|
closedir($dir);
|
||||||
|
@ -563,12 +567,14 @@ class m_bro {
|
||||||
$m = $m & (~ 0222); // ugo-w
|
$m = $m & (~ 0222); // ugo-w
|
||||||
}
|
}
|
||||||
$action->chmod($absolute . "/" . $d[$i], $m);
|
$action->chmod($absolute . "/" . $d[$i], $m);
|
||||||
|
// We'd like to *wait* for this to complete, but since this is essentially asynchronous, we can't be sure easily
|
||||||
|
// So we chose to wait a little bit (2 sec) at the end of the loop...
|
||||||
if ($verbose) {
|
if ($verbose) {
|
||||||
echo "chmod " . sprintf('%o', $m) . " file, was " . sprintf('%o', fileperms($absolute . "/" . $d[$i])) . " -- " . $perm[$i]['w'];
|
echo "chmod " . sprintf('%o', $m) . " file, was " . sprintf('%o', fileperms($absolute . "/" . $d[$i])) . " -- " . $perm[$i]['w'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
sleep(2);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -873,6 +879,8 @@ class m_bro {
|
||||||
include('foot.php');
|
include('foot.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
$stat=stat($absolute);
|
||||||
|
if (!($stat[2] & 0000200)) return false;
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$mime = finfo_file($finfo, $absolute);
|
$mime = finfo_file($finfo, $absolute);
|
||||||
if (substr($mime, 0, 5) == "text/" || $mime == "application/x-empty" || $mime == "inode/x-empty") {
|
if (substr($mime, 0, 5) == "text/" || $mime == "application/x-empty" || $mime == "inode/x-empty") {
|
||||||
|
|
Loading…
Reference in New Issue