Skip to content

Commit 74efda9

Browse files
committed
Do not show data from other users when viewing the client dashboard as an admin
1 parent eee2d24 commit 74efda9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

interface/web/dashboard/dashlets/limits.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,12 @@ public function show($limit_to_client_id = 0)
148148
$tpl->setVar($wb);
149149

150150
if ($limit_to_client_id != null) {
151-
$client = $app->db->queryOneRecord("SELECT * FROM client WHERE client_id = ?", $limit_to_client_id);
151+
$client_id = $limit_to_client_id;
152152
}
153153
elseif ($limit_to_client_id == null && $app->auth->is_reseller()) {
154-
$client = $app->db->queryOneRecord("SELECT * FROM client WHERE client_id = ?", $_SESSION['s']['user']['client_id']);
154+
$client_id = $_SESSION['s']['user']['client_id'];
155155
}
156+
$client = $app->db->queryOneRecord("SELECT * FROM client WHERE client_id = ?", $client_id);
156157

157158
$rows = array();
158159
foreach ($limits as $limit) {
@@ -201,7 +202,7 @@ public function _get_limit_usage($limit, $limit_to_client_id)
201202
if ($limit['db_where'] != '') {
202203
$sql .= $limit['db_where']." AND ";
203204
}
204-
$sql .= $app->tform->getAuthSQL('r', '', $limit_to_client_id);
205+
$sql .= $app->tform->getAuthSQL('r', '', $limit_to_client_id, array());
205206
// TEST to show reseller data.
206207
//$sql .= $app->tform->getAuthSQL('r', '', 0, '3,28,39');
207208
//echo $sql;

0 commit comments

Comments
 (0)