www/includes/users.php

24 lines
747 B
PHP
Raw Normal View History

2019-07-07 01:39:54 +00:00
<?php
2025-02-14 02:03:39 +00:00
$html_skel = '/etc/skel/public_html/index.html';
2019-07-07 01:39:54 +00:00
print "<!-- Begin autogen userdir list -->";
print "<ul style='list-style: none; margin-left: -40px;'>";
2025-02-14 02:03:39 +00:00
foreach (glob("/home/*") as $userpath) {
if (is_dir("$userpath/public_html")) {
$user = basename($userpath);
$skeletonMatch = (@sha1_file($html_skel) === @sha1_file("$userpath/public_html/index.html"));
$isEmptyPubhtml = (@count(@scandir("$userpath/public_html")) === 2); // 2 => "." and ".."
if ($skeletonMatch || $isEmptyPubhtml) {
print "<li>~$user</li>\n";
} else {
print "<li><a href='$site_root/~$user/'>~$user</a></li>\n";
}
2021-11-18 16:13:06 +00:00
}
2025-02-14 02:03:39 +00:00
}
print "</ul></div>\n<!-- End Autgen userdir list -->";
2019-07-07 01:39:54 +00:00
?>