Move routine under includes. Simplify the file skip check

This commit is contained in:
Scott Ullrich 2011-02-06 23:43:51 -05:00
parent ee3f28cc06
commit 104faa07f7

View File

@ -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 <a href='crash_reporter.php'>here</a> 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 <a href='crash_reporter.php'>here</a> for more information.";
}
##build list of widgets
$directory = "/usr/local/www/widgets/widgets/";
$dirhandle = opendir($directory);