From 89d9e531b13de00b7a2eabcd6f763feef56a36cc Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 14 Feb 2013 17:14:31 +0000 Subject: [PATCH] Fix #1456 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Msg d'erreur si répertoire inexistant --- bureau/admin/bro_main.php | 17 +++++++++++------ bureau/class/m_bro.php | 6 +++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/bureau/admin/bro_main.php b/bureau/admin/bro_main.php index 3474c7d8..0f356cb1 100644 --- a/bureau/admin/bro_main.php +++ b/bureau/admin/bro_main.php @@ -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(); - ?>

@@ -161,12 +157,21 @@ if ($c===false) $error=$err->errstr();
- -$error

"; ?> +filelist($R, $showdirsize ); +if ($c===false) { + echo "

".$err->errstr()."

"; + require_once('foot.php'); + exit; +} + +if (isset($error) && $error) echo "

$error

"; +?>
diff --git a/bureau/class/m_bro.php b/bureau/class/m_bro.php index 1f3ce951..58aba874 100644 --- a/bureau/class/m_bro.php +++ b/bureau/class/m_bro.php @@ -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!="..") {