-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
54 lines (47 loc) · 1.99 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!doctype html>
<?php
// Dynamically list users with web sites on paradoxical
// Nick B-W <[email protected]> 11/23/2001
$users = file("/etc/passwd");
$ousers = array();
$homes = array();
foreach($users as $num => $user) {
list($username, $x, $uid, $gid, $gecos, $home, $shell) = explode(":", $user);
if((int)$uid >= 500) {
$ousers[$num] = $username;
}
$homes[$username] = $home;
}
$users = $ousers;
// Get our crunchy candy shell
?>
<html>
<head>
<title>Users present on community.nbtsc.org</title>
<link rel="stylesheet" href='/style.css'>
</head>
<body>
<h1>Users present on community.nbtsc.org</h1>
<?php natcasesort($users); // Pause for audience applause... ?>
<p>
This is the current user list for this server. Usernames with a
<img src="star.png" alt="*" width="16" height="15"> have an index of an
appreciable size, and most likely have web sites. Unless otherwise noted on
the site, materials found on personal sites are copyright their respective
users.
</p>
<p>
If you are an nbtsc.org user and would prefer not to have your account listed
here, please send a message to the <a href="mailto:[email protected]">webmasters</a>.
</p>
<?php foreach($users as $val): ?>
<?php if(is_file($homes[$val]."/web/.nolist")) continue; ?>
<a href='/~<?= $val ?>/'><?= $val ?></a> <a href='finger.php?user=<?= $val ?>'>?</a>
<?php if ($f = glob($homes[$val]."/web/index.*") and !preg_match('/No web page here, yet|Congratulations, your Web directory is ready/', file_get_contents($f[0]))): ?>
<a href='/~<?= $val ?>/'><img src='star.png' alt='*' width='16' height='15' border='0'></a>
<?php endif; ?>
<br>
<?php endforeach ?>
<?php // Okay, you don't have to go home, but you can't stay here ?>
</body>
</html>