From 104faa07f7dc51f4ef66e323299881c2ffbec0f6 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 6 Feb 2011 23:43:51 -0500 Subject: Move routine under includes. Simplify the file skip check --- usr/local/www/index.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/usr/local/www/index.php b/usr/local/www/index.php index b1c2b50..980c87e 100755 --- a/usr/local/www/index.php +++ b/usr/local/www/index.php @@ -42,24 +42,6 @@ ##|*MATCH=index.php* ##|-PRIV -$crash = glob("/var/crash/*"); -$x = 0; -if(is_array($crash)) { - foreach($crash as $c) { - if($c == "minfree") - continue; - if($c == ".") - continue; - if($c == "..") - continue; - if($c == "") - continue; - $x++; - } - if($x > 0) - $savemsg = "{$g['product_name']} has detected a crash report. Click here for more information."; -} - // Turn off csrf for the dashboard $nocsrf = true; @@ -74,6 +56,21 @@ require_once('functions.inc'); require_once('guiconfig.inc'); require_once('notices.inc'); +// Check to see if we have a crash report +$crash = glob("/var/crash/*"); +$x = 0; +$skip_files = array(".", "..", "minfree", ""); +if(is_array($crash)) { + foreach($crash as $c) { + foreach($skip_files as $sf) + if($sf == $c) + continue; + $x++; + } + if($x > 0) + $savemsg = "{$g['product_name']} has detected a crash report. Click here for more information."; +} + ##build list of widgets $directory = "/usr/local/www/widgets/widgets/"; $dirhandle = opendir($directory); -- cgit v1.1