-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
46 lines (40 loc) · 1.25 KB
/
index.php
File metadata and controls
46 lines (40 loc) · 1.25 KB
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
<?php
require 'vendor/autoload.php';
$c = new \Comet\Server("http://127.0.0.1:9960/", "admin", "admin");
$users = $c->AdminListUsersFull();
?>
<!DOCTYPE html>
<table>
<thead>
<tr>
<th>Username</th>
<th>Number of devices</th>
<th>Current Storage</th>
</tr>
</thead>
<tbody>
<?php foreach($users as $username => $profile) { ?>
<tr>
<td>
<?php echo htmlentities($username); ?>
</td>
<td>
<?php echo count($profile->Devices); ?>
</td>
<td>
<?php
$total_storage_vault_size = 0;
foreach($profile->Destinations as $storage_vault) {
if ($storage_vault->DestinationType == \Comet\Def::DESTINATIONTYPE_LOCALCOPY) {
continue;
}
$total_storage_vault_size += $storage_vault->Statistics->ClientProvidedSize->Size;
}
$total_storage_vault_size_gb = ($total_storage_vault_size / (1024*1024*1024));
echo $total_storage_vault_size_gb . " GB";
?>
</td>
</tr>
<?php } ?>
</tbody>
</table>