Skip to content
Snippets Groups Projects
Unverified Commit f68f9f06 authored by Helmo's avatar Helmo
Browse files

Fix dashlets for admin.

parent 55485d16
No related branches found
No related tags found
1 merge request!941Add an info tab for the client page #5372
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class dashlet_databasequota { class dashlet_databasequota {
function show($limit_to_client_id = 0) { function show($limit_to_client_id = null) {
global $app; global $app;
//* Loading Template //* Loading Template
...@@ -23,7 +23,7 @@ class dashlet_databasequota { ...@@ -23,7 +23,7 @@ class dashlet_databasequota {
$lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_databasequota.lng'; $lng_file = 'lib/lang/'.$_SESSION['s']['language'].'_dashlet_databasequota.lng';
if(is_file($lng_file)) include $lng_file; if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb); $tpl->setVar($wb);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') { if ($_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id']; $client_id = $_SESSION['s']['user']['client_id'];
} else { } else {
$client_id = $limit_to_client_id; $client_id = $limit_to_client_id;
......
...@@ -149,8 +149,10 @@ class dashlet_limits ...@@ -149,8 +149,10 @@ class dashlet_limits
if ($limit_to_client_id == 0) { if ($limit_to_client_id == 0) {
$client_id = $_SESSION['s']['user']['client_id']; $client_id = $_SESSION['s']['user']['client_id'];
$user_is_admin = true;
} else { } else {
$client_id = $limit_to_client_id; $client_id = $limit_to_client_id;
$user_is_admin = false;
} }
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
...@@ -161,6 +163,12 @@ class dashlet_limits ...@@ -161,6 +163,12 @@ class dashlet_limits
foreach ($limits as $limit) { foreach ($limits as $limit) {
$field = $limit['field']; $field = $limit['field'];
$value = $client[$field]; $value = $client[$field];
if ($user_is_admin) {
$value = $wb['unlimited_txt'];
} else {
$value = $client[$field];
}
if ($value != 0 || $value == $wb['unlimited_txt']) { if ($value != 0 || $value == $wb['unlimited_txt']) {
$value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value; $value_formatted = ($value == '-1')?$wb['unlimited_txt']:$value;
if (isset($limit['q_type']) && $limit['q_type'] != '') { if (isset($limit['q_type']) && $limit['q_type'] != '') {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class dashlet_mailquota { class dashlet_mailquota {
function show($limit_to_client_id = 0) { function show($limit_to_client_id = null) {
global $app; global $app;
//* Loading Template //* Loading Template
...@@ -16,7 +16,7 @@ class dashlet_mailquota { ...@@ -16,7 +16,7 @@ class dashlet_mailquota {
if(is_file($lng_file)) include $lng_file; if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb); $tpl->setVar($wb);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') { if ($_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id']; $client_id = $_SESSION['s']['user']['client_id'];
} else { } else {
$client_id = $limit_to_client_id; $client_id = $limit_to_client_id;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class dashlet_quota { class dashlet_quota {
function show($limit_to_client_id = 0) { function show($limit_to_client_id = null) {
global $app; global $app;
//* Loading Template //* Loading Template
...@@ -24,7 +24,7 @@ class dashlet_quota { ...@@ -24,7 +24,7 @@ class dashlet_quota {
if(is_file($lng_file)) include $lng_file; if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb); $tpl->setVar($wb);
if ($limit_to_client_id == 0 || $_SESSION["s"]["user"]["typ"] != 'admin') { if ($_SESSION["s"]["user"]["typ"] != 'admin') {
$client_id = $_SESSION['s']['user']['client_id']; $client_id = $_SESSION['s']['user']['client_id'];
} else { } else {
$client_id = $limit_to_client_id; $client_id = $limit_to_client_id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment