vern-web/users.php

31 lines
903 B
PHP
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="/style.css">
<title>~vern users</title>
</head>
<body>
<!--#include file="nav" -->
<div class=h><h1 id=users>Users</h1> <a aria-hidden=true href=#users>#users</a></div>
<p>This is a list of all ~vern users, and whether they are online (<b><span class=green></span></b>) or not (<b><span class=red></span></b>).</p>
<ul userlist>
<?php
$users = explode(' ', shell_exec('users /sshfs/var/run/utmp'));
$handle = opendir('/sshfs/home');
while (($subdir = readdir($handle)) !== false) {
if ($subdir != '.' && $subdir != '..') {
$online='false';
foreach ($users as $val)
if (trim($val) == $subdir) $online='true';
echo ' <li online="' . $online . '">' . $subdir . "</li>\n";
}
}
closedir($handle);
?>
</ul>
<!--#include file="footer" -->
</body>
</html>