Skip to content

Commit

Permalink
QA: Fix upstream issue with branch call
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWitness committed Feb 23, 2025
1 parent 2e272b5 commit 0c76372
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -907,12 +907,15 @@ function is_tree_branch_empty($tree_id, $parent = 0) {
), 'site_id', 'site_id'
);

$total_rows = -1;

if (!cacti_sizeof($sites)) {
if (cacti_sizeof($hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $hosts) . ')'), 'description', '', -1) > 0) {
if (cacti_sizeof($hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $hosts) . ')', 'description', '', $total_rows)) > 0) {
return false;
}
} else {
$site_hosts = array();

foreach($sites as $site) {
$site_hosts += array_rekey(
db_fetch_assoc_prepared('SELECT id
Expand All @@ -923,7 +926,7 @@ function is_tree_branch_empty($tree_id, $parent = 0) {
);
}

if (cacti_sizeof($site_hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $site_hosts) . ')'), 'description', '', -1) > 0) {
if (cacti_sizeof($site_hosts) && cacti_sizeof(get_allowed_devices('h.id IN(' . implode(',', $site_hosts) . ')', 'description', '', $total_rows)) > 0) {
return false;
}
}
Expand Down

0 comments on commit 0c76372

Please sign in to comment.