Msg d'erreur si répertoire inexistant
This commit is contained in:
Alan Garcia 2013-02-14 17:14:31 +00:00
parent 99dcc5f80b
commit 89d9e531b1
2 changed files with 16 additions and 7 deletions

View File

@ -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> <h3><?php __("File browser"); ?></h3>
<table border="0" width="100%" cellspacing="0"> <table border="0" width="100%" cellspacing="0">
@ -161,12 +157,21 @@ if ($c===false) $error=$err->errstr();
<hr /> <hr />
<p class="breadcrumb"> <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") ?> <?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> </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> <table><tr>
<td class="formcell"> <td class="formcell">

View File

@ -160,9 +160,13 @@ class m_bro {
* @return array le tableau contenant les fichiers de $dir, et * @return array le tableau contenant les fichiers de $dir, et
*/ */
function filelist($dir="", $showdirsize = false) { function filelist($dir="", $showdirsize = false) {
global $db,$cuid; global $db,$cuid,$err;
$db->query("UPDATE browser SET lastdir='$dir' WHERE uid='$cuid';"); $db->query("UPDATE browser SET lastdir='$dir' WHERE uid='$cuid';");
$absolute=$this->convertabsolute($dir,0); $absolute=$this->convertabsolute($dir,0);
if (! file_exists($absolute)) {
$err->raise('bro',_("This directory do not exist"));
return false;
}
if ($dir = @opendir($absolute)) { if ($dir = @opendir($absolute)) {
while (($file = readdir($dir)) !== false) { while (($file = readdir($dir)) !== false) {
if ($file!="." && $file!="..") { if ($file!="." && $file!="..") {