From c469e83bd6013071a7cf9cec9c03dfc3b2f25dd1 Mon Sep 17 00:00:00 2001 From: steinm Date: Fri, 8 Feb 2013 08:13:57 +0000 Subject: [PATCH] - better error checking --- views/bootstrap/class.LogManagement.php | 32 +++++++++++++------------ 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/views/bootstrap/class.LogManagement.php b/views/bootstrap/class.LogManagement.php index 41737f6d6..751cec0fd 100644 --- a/views/bootstrap/class.LogManagement.php +++ b/views/bootstrap/class.LogManagement.php @@ -80,25 +80,27 @@ class LetoDMS_View_LogManagement extends LetoDMS_Bootstrap_Style { $this->contentHeading(getMLText("log_management")); - $handle = opendir($this->contentdir); $entries = array(); $wentries = array(); - while ($e = readdir($handle)){ - if (is_dir($this->contentdir.$e)) continue; - if (strpos($e,".log")==FALSE) continue; - if (strcmp($e,"current.log")==0) continue; - if(substr($e, 0, 6) == 'webdav') { - $wentries[] = $e; - } else { - $entries[] = $e; + $handle = opendir($this->contentdir); + if($handle) { + while ($e = readdir($handle)){ + if (is_dir($this->contentdir.$e)) continue; + if (strpos($e,".log")==FALSE) continue; + if (strcmp($e,"current.log")==0) continue; + if(substr($e, 0, 6) == 'webdav') { + $wentries[] = $e; + } else { + $entries[] = $e; + } } - } - closedir($handle); + closedir($handle); - sort($entries); - sort($wentries); - $entries = array_reverse($entries); - $wentries = array_reverse($wentries); + sort($entries); + sort($wentries); + $entries = array_reverse($entries); + $wentries = array_reverse($wentries); + } ?>