forked from vern/website
Add users.php
Signed-off-by: Aleksandar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
30a807f20c
commit
5e45a915f6
28
style.css
28
style.css
|
@ -1,6 +1,6 @@
|
|||
body {
|
||||
font-family: 'Fira Code';
|
||||
src: url("/woff/FiraCode-Regular.woff") format("woff");
|
||||
font-family:'Fira Code';
|
||||
src:url("/woff/FiraCode-Regular.woff") format("woff");
|
||||
margin:20px auto;
|
||||
max-width:800px;
|
||||
line-height:1.5em;
|
||||
|
@ -67,11 +67,31 @@ pre {
|
|||
color:#ff6c6b;
|
||||
}
|
||||
|
||||
.green {
|
||||
color:#98be65;
|
||||
}
|
||||
|
||||
input[type=submit] {
|
||||
padding:5px 15px;
|
||||
background:#51afef;
|
||||
border:0 none;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
-webkit-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
|
||||
ul[userlist] {
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
ul[userlist] li[online]::before {
|
||||
content:"\2022";
|
||||
color:#ff6c6b;
|
||||
font-weight:bold;
|
||||
display:inline-block;
|
||||
width:1.0em;
|
||||
margin-left:-1.0em;
|
||||
}
|
||||
|
||||
ul[userlist] li[online$=true]::before {
|
||||
color:#98be65;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<!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=#admins>#admins</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 != '..') {
|
||||
foreach ($users as $val) {
|
||||
$online='false';
|
||||
if (trim($val) == $subdir) $online='true';
|
||||
}
|
||||
echo '<li online="' . $online . '">' . $subdir . "</li>\n";
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
?>
|
||||
</ul>
|
||||
<!--#include file="footer" -->
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue