-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquota.php
More file actions
58 lines (37 loc) · 1.12 KB
/
quota.php
File metadata and controls
58 lines (37 loc) · 1.12 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
47
48
49
50
51
52
53
54
55
56
57
58
<?php
class dashlet_quota {
function show() {
global $app;
//* Loading Template
$app->uses('tpl,quota_lib');
if (!$app->auth->verify_module_permissions('sites')) {
return;
}
$modules = explode(',', $_SESSION['s']['user']['modules']);
if(!in_array('sites', $modules)) {
return '';
}
$tpl = new tpl;
$tpl->newTemplate("dashlets/templates/quota.htm");
$wb = array();
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_quota.lng';
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
$sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
//print_r($sites);
$has_quota = false;
if(is_array($sites) && !empty($sites)){
foreach($sites as &$site) {
$site['domain'] = $app->functions->idn_decode($site['domain']);
$site['progressbar'] = $site['hd_quota'];
}
unset($site);
$sites = $app->functions->htmlentities($sites);
$tpl->setloop('quota', $sites);
$has_quota = isset($sites[0]['used']);
}
$tpl->setVar('has_quota', $has_quota);
return $tpl->grab();
}
}
?>