Added more restrictions to user dashboard function
This commit is contained in:
parent
87f3798499
commit
b10f1f422f
|
@ -1992,13 +1992,13 @@ function get_os_name ($id_os) {
|
||||||
function get_user_dashboards ($id_user) {
|
function get_user_dashboards ($id_user) {
|
||||||
if (users_is_admin($id_user)) {
|
if (users_is_admin($id_user)) {
|
||||||
$sql = "SELECT name
|
$sql = "SELECT name
|
||||||
FROM tdashboard";
|
FROM tdashboard WHERE id_user = '" . $id_user ."' OR id_user = ''";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$user_can_manage_all = users_can_manage_group_all('RR');
|
$user_can_manage_all = users_can_manage_group_all('RR');
|
||||||
if ($user_can_manage_all) {
|
if ($user_can_manage_all) {
|
||||||
$sql = "SELECT name
|
$sql = "SELECT name
|
||||||
FROM tdashboard";
|
FROM tdashboard WHERE id_user = '" . $id_user ."' OR id_user = ''";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$user_groups = users_get_groups($id_user, "RR", false);
|
$user_groups = users_get_groups($id_user, "RR", false);
|
||||||
|
@ -2013,7 +2013,7 @@ function get_user_dashboards ($id_user) {
|
||||||
|
|
||||||
$sql = "SELECT name
|
$sql = "SELECT name
|
||||||
FROM tdashboard
|
FROM tdashboard
|
||||||
WHERE id_group IN (" . implode(",", $u_groups) . ")";
|
WHERE id_group IN (" . implode(",", $u_groups) . ") AND (id_user = '" . $id_user ."' OR id_user = '')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue