Skip to content

Commit c5e82d4

Browse files
author
Thom
committed
Fix broken check for correct index file (#6147)
1 parent f9c22b4 commit c5e82d4

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

server/conf/awstats_index.php.master

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,17 @@ if ($handle = opendir('.'))
4343
arsort($awprev);
4444

4545
$options = "";
46-
foreach ($awprev as $key => $value)
47-
{
48-
49-
if(file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
50-
$awstatsindex = 'awsindex.html';
51-
} elseif(file_exists($value.'/awsindex.html') && !file_exists($value.'/goaindex.html')) {
52-
$awstatsindex = 'awsindex.html';
53-
} else {
54-
$awstatsindex = 'goaindex.html';
55-
}
56-
46+
foreach ($awprev as $key => $value) {
47+
// Define name for the index file
48+
$awstatsindex = 'awsindex.html';
49+
if(!file_exists($value.'/awsindex.html') && file_exists($value.'/goaindex.html')) {
50+
$awstatsindex = 'goaindex.html';
51+
}
52+
// Set name for first entry in month list
5753
if($key == $current) $options .= "<option selected=\"selected\" value=\"{$awstatsindex}\">{$value}</option>\n";
5854
else $options .= "<option value=\"{$value}/{$awstatsindex}\">{$value}</option>\n";
5955
}
6056

61-
$awstatsindex = 'awsindex.html';
62-
6357
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
6458
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
6559
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";

0 commit comments

Comments
 (0)