-
Notifications
You must be signed in to change notification settings - Fork 127
/
seedboxInfo.php.template
51 lines (46 loc) · 1.11 KB
/
seedboxInfo.php.template
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
<htm>
<body>
<font face="arial">
<h1>The Seedbox From Scratch Script v<?php echo getScriptVersion(); ?></h1>
<h2>User list</h2>
<?php
error_reporting(E_ALL);
$dir = '/etc/seedbox-from-scratch/users/';
$files = scandir($dir);
foreach($files as $index=>$file) {
$data = explode(".", $file);
if ($data[1] == 'info') {
printUser($dir,$data[0]);
}
}
function printUser($dir,$user) {
echo "<h3>$user</h3>";
$data = file($dir."$user.info");
foreach($data as $index=>$line) {
$line = makelink($line);
echo $line;
}
}
function makelink($input) {
$parse = explode(' ', $input);
$input = "";
foreach ($parse as $token) {
$br = "<br>";
if (strpos($token, "://") > 0) {
$input .= '<a href="' . $token . '">' . $token . '</a> ';
} else if(substr($token, 1, 3) == '---') {
$input .= "<hr>";
$br = "";
} else {
$input .= $token." ";
}
}
return trim($input.$br);
}
function getScriptVersion() {
$data = file("/etc/seedbox-from-scratch/version.info");
return $data[0];
}
?>
</body>
</htm>