Skip to content

Commit f68f9f0

Browse files
committed
Fix dashlets for admin.
1 parent 55485d1 commit f68f9f0

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

interface/web/dashboard/dashlets/databasequota.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class dashlet_databasequota {
44

5-
function show($limit_to_client_id = 0) {
5+
function show($limit_to_client_id = null) {
66
global $app;
77

88
//* Loading Template
@@ -23,7 +23,7 @@ function show($limit_to_client_id = 0) {
2323
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_databasequota.lng';
2424
if(is_file($lng_file)) include $lng_file;
2525
$tpl->setVar($wb);
26-
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
26+
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
2727
$client_id = $_SESSION['s']['user']['client_id'];
2828
} else {
2929
$client_id = $limit_to_client_id;

interface/web/dashboard/dashlets/limits.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ public function show($limit_to_client_id = 0)
149149

150150
if ($limit_to_client_id == 0) {
151151
$client_id = $_SESSION['s']['user']['client_id'];
152+
$user_is_admin = true;
152153
} else {
153154
$client_id = $limit_to_client_id;
155+
$user_is_admin = false;
154156
}
155157

156158
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
@@ -161,6 +163,12 @@ public function show($limit_to_client_id = 0)
161163
foreach ($limits as $limit) {
162164
$field = $limit['field'];
163165
$value = $client[$field];
166+
if ($user_is_admin) {
167+
$value = $wb['unlimited_txt'];
168+
} else {
169+
$value = $client[$field];
170+
}
171+
164172
if ($value != 0 || $value == $wb['unlimited_txt']) {
165173
$value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value;
166174
if (isset($limit['q_type']) && $limit['q_type'] != '') {

interface/web/dashboard/dashlets/mailquota.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class dashlet_mailquota {
44

5-
function show($limit_to_client_id = 0) {
5+
function show($limit_to_client_id = null) {
66
global $app;
77

88
//* Loading Template
@@ -16,7 +16,7 @@ function show($limit_to_client_id = 0) {
1616
if(is_file($lng_file)) include $lng_file;
1717
$tpl->setVar($wb);
1818

19-
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
19+
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
2020
$client_id = $_SESSION['s']['user']['client_id'];
2121
} else {
2222
$client_id = $limit_to_client_id;

interface/web/dashboard/dashlets/quota.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class dashlet_quota {
44

5-
function show($limit_to_client_id = 0) {
5+
function show($limit_to_client_id = null) {
66
global $app;
77

88
//* Loading Template
@@ -24,7 +24,7 @@ function show($limit_to_client_id = 0) {
2424
if(is_file($lng_file)) include $lng_file;
2525
$tpl->setVar($wb);
2626

27-
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') {
27+
if ($_SESSION["s"]["user"]["typ"] != 'admin') {
2828
$client_id = $_SESSION['s']['user']['client_id'];
2929
} else {
3030
$client_id = $limit_to_client_id;

0 commit comments

Comments
 (0)