From 2ae6c8c2b80ac37b5063a55e8c3e5a6cbff9360c Mon Sep 17 00:00:00 2001
From: deepend-tildeclub <58404188+deepend-tildeclub@users.noreply.github.com>
Date: Sat, 26 Apr 2025 13:17:26 -0600
Subject: [PATCH] Update users.php
---
includes/users.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/includes/users.php b/includes/users.php
index 0d46320..640beae 100644
--- a/includes/users.php
+++ b/includes/users.php
@@ -7,13 +7,16 @@ print "
";
foreach (glob("/home/*") as $userpath) {
if (is_dir("$userpath/public_html")) {
$user = basename($userpath);
-
+
+ // Use @ to suppress warnings in case the user directory/files are not readable.
$skeletonMatch = (@sha1_file($html_skel) === @sha1_file("$userpath/public_html/index.html"));
$isEmptyPubhtml = (@count(@scandir("$userpath/public_html")) === 2); // 2 => "." and ".."
if ($skeletonMatch || $isEmptyPubhtml) {
+ // If it matches the skeleton index.html or is empty, display without a link
print "- ~$user
\n";
} else {
+ // Otherwise, link to the user's directory
print "- ~$user
\n";
}
}