add user api
This commit is contained in:
parent
34b4f772ef
commit
34ce59895d
|
@ -19,12 +19,23 @@ elseif (isset($_GET["fonts"])) { // get list of fonts
|
|||
|
||||
elseif (isset($_GET["text"])) { // run figlet
|
||||
echo shell_exec(
|
||||
"/usr/bin/figlet -d $fonts -w 140 -f " .
|
||||
"/usr/bin/figlet -d $fonts -w 120 -f " .
|
||||
escapeshellarg($_GET["font"] ?? "standard") . " " .
|
||||
escapeshellarg($_GET["text"])
|
||||
);
|
||||
}
|
||||
|
||||
elseif (isset($_GET["users"])) {
|
||||
$users = [];
|
||||
foreach (scandir("/home") as $user) {
|
||||
if (is_dir("/home/$user/public_html")
|
||||
&& isset($_GET["pub"])
|
||||
&& $_GET["pub"] != "false") continue;
|
||||
$users[] = $user;
|
||||
}
|
||||
echo json_encode($users);
|
||||
}
|
||||
|
||||
else { // get a random tagline
|
||||
echo $tags[array_rand($tags)];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue