Fix list all private dashboards on user edition

This commit is contained in:
Luis Calvo 2022-12-09 09:54:20 +01:00
parent f2ad934c92
commit cdd1569364
2 changed files with 18 additions and 6 deletions

View File

@ -1313,7 +1313,14 @@ $home_screen .= html_print_select(
).'</div>'; ).'</div>';
$dashboards = Manager::getDashboards(-1, -1); $dashboards = Manager::getDashboards(
-1,
-1,
false,
false,
$id_usr
);
$dashboards_aux = []; $dashboards_aux = [];
if ($dashboards === false) { if ($dashboards === false) {
$dashboards = ['None' => 'None']; $dashboards = ['None' => 'None'];

View File

@ -675,7 +675,8 @@ class Manager implements PublicLogin
int $offset=-1, int $offset=-1,
int $limit=-1, int $limit=-1,
bool $favourite=false, bool $favourite=false,
bool $slideshow=false bool $slideshow=false,
string $id_user=''
):array { ):array {
global $config; global $config;
@ -693,11 +694,15 @@ class Manager implements PublicLogin
$sql_where .= 'AND td.cells_slideshow = 1'; $sql_where .= 'AND td.cells_slideshow = 1';
} }
if (empty($id_user) === true) {
$id_user = $config['id_user'];
}
// Check ACl. // Check ACl.
if (\is_user_admin($config['id_user']) !== true) { if (\is_user_admin($id_user) !== true) {
// User no admin see dashboards of him groups and profile 'AR'. // User no admin see dashboards of him groups and profile 'AR'.
$group_list = \users_get_groups( $group_list = \users_get_groups(
$config['id_user'], $id_user,
'RR', 'RR',
true true
); );
@ -727,7 +732,7 @@ class Manager implements PublicLogin
GROUP BY td.id GROUP BY td.id
ORDER BY name%s", ORDER BY name%s",
$string_groups, $string_groups,
$config['id_user'], $id_user,
$sql_where, $sql_where,
$sql_limit $sql_limit
); );
@ -746,7 +751,7 @@ class Manager implements PublicLogin
WHERE td.id_group = 0 AND td.id_user = '%s' %s WHERE td.id_group = 0 AND td.id_user = '%s' %s
GROUP BY td.id GROUP BY td.id
ORDER BY name%s", ORDER BY name%s",
$config['id_user'], $id_user,
$sql_where, $sql_where,
$sql_limit $sql_limit
); );