diff --git a/index.php b/index.php
index bed7765..291dff2 100644
--- a/index.php
+++ b/index.php
@@ -172,58 +172,62 @@ if (isset($_GET['notice'])) {
users with recently updated pages within the last month are highlighted in a lighter color.
list all users
- 0 ? $indexFiles[0] : null;
+ $oneMonthAgo = strtotime('-1 month');
- if (!$index || in_array(sha1_file($index), $page_shas)) continue;
+ // Check if user has a default index page
+ foreach (glob("/home/*") as $user) {
+ // Look for index files with common extensions
+ $indexFiles = glob("$user/public_html/index.{html,htm,php}", GLOB_BRACE);
+ $index = count($indexFiles) > 0 ? $indexFiles[0] : null;
- // Check for any recent changes in the public_html directory
- $recentChange = false;
- foreach (glob("$user/public_html/*") as $file) {
- if (filemtime($file) > $oneMonthAgo) {
- $recentChange = true;
- break;
- }
- }
+ if (!$index || in_array(sha1_file($index), $page_shas)) continue;
- $user = basename($user);
- $class = $recentChange ? 'recently-updated' : '';
- ?>
- - ~=$user?>
-
+ // Check if the index pages were updated in the last month
+ $recentChange = false;
+
+ foreach ($indexFiles as $file) {
+ if (filemtime($file) > $oneMonthAgo) {
+ $recentChange = true;
+ break;
+ }
+ }
+
+ $user = basename($user);
+ $class = $recentChange ? 'recently-updated' : '';
+
+ echo '- ~'.$user.'
';
+ }
+ ?>