Skip to content

Commit

Permalink
Merge pull request #4447 from corentin-soriano/improve_bo_performances
Browse files Browse the repository at this point in the history
Exclude personal folder from identAdmin function (admins can't have personal folders).
  • Loading branch information
nilsteampassnet authored Nov 6, 2024
2 parents e3318a4 + dbc4207 commit fcf1e4e
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions sources/main.functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,35 +361,6 @@ function identAdmin($idFonctions, $SETTINGS, $tree)
}
$session->set('user-accessible_folders', $groupesVisibles);
$session->set('user-all_non_personal_folders', $groupesVisibles);
// Exclude all PF
$where = new WhereClause('and');
// create a WHERE statement of pieces joined by ANDs
$where->add('personal_folder=%i', 1);
if (
isset($SETTINGS['enable_pf_feature']) === true
&& (int) $SETTINGS['enable_pf_feature'] === 1
) {
$where->add('title=%s', $globalsUserId);
$where->negateLast();
}
// Get ID of personal folder
$persfld = DB::queryfirstrow(
'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s',
$globalsUserId
);
if (empty($persfld['id']) === false) {
if (in_array($persfld['id'], $globalsVisibleFolders) === false) {
array_push($globalsVisibleFolders, $persfld['id']);
array_push($globalsPersonalVisibleFolders, $persfld['id']);
// get all descendants
$tree->rebuild();
$tst = $tree->getDescendants($persfld['id']);
foreach ($tst as $t) {
array_push($globalsVisibleFolders, $t->id);
array_push($globalsPersonalVisibleFolders, $t->id);
}
}
}

// get complete list of ROLES
$tmp = explode(';', $idFonctions);
Expand Down

0 comments on commit fcf1e4e

Please sign in to comment.