Commit 89d9e531 authored by Alan Garcia's avatar Alan Garcia

Fix #1456

Msg d'erreur si répertoire inexistant
parent 99dcc5f8
......@@ -150,10 +150,6 @@ if (isset($actextract) && $actextract) {
}
}
/* Creation de la liste des fichiers courants */
$c=$bro->filelist($R, $showdirsize );
if ($c===false) $error=$err->errstr();
?>
<h3><?php __("File browser"); ?></h3>
<table border="0" width="100%" cellspacing="0">
......@@ -161,12 +157,21 @@ if ($c===false) $error=$err->errstr();
<hr />
<p class="breadcrumb">
<?php __("Path"); ?> / <a href="bro_main.php?R=/"><?php echo $mem->user["login"]; ?></a>&nbsp;/&nbsp;<?php echo $bro->PathList($R,"bro_main.php") ?>
</p>
<?php if (isset($error) && $error) echo "<p class=\"error\">$error</p>"; ?>
<?php
/* Creation de la liste des fichiers courants */
$c=$bro->filelist($R, $showdirsize );
if ($c===false) {
echo "<p class=\"error\">".$err->errstr()."</p>";
require_once('foot.php');
exit;
}
if (isset($error) && $error) echo "<p class=\"error\">$error</p>";
?>
<table><tr>
<td class="formcell">
......
......@@ -160,9 +160,13 @@ class m_bro {
* @return array le tableau contenant les fichiers de $dir, et
*/
function filelist($dir="", $showdirsize = false) {
global $db,$cuid;
global $db,$cuid,$err;
$db->query("UPDATE browser SET lastdir='$dir' WHERE uid='$cuid';");
$absolute=$this->convertabsolute($dir,0);
if (! file_exists($absolute)) {
$err->raise('bro',_("This directory do not exist"));
return false;
}
if ($dir = @opendir($absolute)) {
while (($file = readdir($dir)) !== false) {
if ($file!="." && $file!="..") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment