|
2601 | 2601 | $accessLevel = 2; |
2602 | 2602 | $arrTmp = []; |
2603 | 2603 | foreach (explode(';', $_SESSION['fonction_id']) as $role) { |
2604 | | - $access = DB::queryFirstRow( |
2605 | | - "SELECT type FROM ".prefix_table("roles_values")." WHERE role_id = %i AND folder_id = %i", |
2606 | | - $role, |
2607 | | - $post_id |
2608 | | - ); |
2609 | | - if ($access['type'] === "R") { |
2610 | | - array_push($arrTmp, 1); |
2611 | | - } elseif ($access['type'] === "W") { |
2612 | | - array_push($arrTmp, 0); |
2613 | | - } elseif ($access['type'] === "ND") { |
2614 | | - array_push($arrTmp, 2); |
2615 | | - } else { |
2616 | | - // Ensure to give access Right if allowed folder |
2617 | | - if (in_array($post_id, $_SESSION['groupes_visibles']) === true) { |
| 2604 | + if (empty($role) === false) { |
| 2605 | + $access = DB::queryFirstRow( |
| 2606 | + "SELECT type FROM ".prefix_table("roles_values")." WHERE role_id = %i AND folder_id = %i", |
| 2607 | + $role, |
| 2608 | + $post_id |
| 2609 | + ); |
| 2610 | + if ($access['type'] === "R") { |
| 2611 | + array_push($arrTmp, 1); |
| 2612 | + } elseif ($access['type'] === "W") { |
2618 | 2613 | array_push($arrTmp, 0); |
| 2614 | + } elseif ($access['type'] === "ND") { |
| 2615 | + array_push($arrTmp, 2); |
2619 | 2616 | } else { |
2620 | | - array_push($arrTmp, 3); |
| 2617 | + // Ensure to give access Right if allowed folder |
| 2618 | + if (in_array($post_id, $_SESSION['groupes_visibles']) === true) { |
| 2619 | + array_push($arrTmp, 0); |
| 2620 | + } else { |
| 2621 | + array_push($arrTmp, 3); |
| 2622 | + } |
2621 | 2623 | } |
2622 | 2624 | } |
2623 | 2625 | } |
2624 | | - $accessLevel = min($arrTmp); |
2625 | | - $uniqueLoadData['accessLevel'] = $accessLevel; |
2626 | | - |
| 2626 | + |
2627 | 2627 | // check if this folder is a PF. If yes check if saltket is set |
2628 | 2628 | if ((!isset($_SESSION['user_settings']['encrypted_psk']) || empty($_SESSION['user_settings']['encrypted_psk'])) && $folderIsPf === true) { |
2629 | 2629 | $showError = "is_pf_but_no_saltkey"; |
|
0 commit comments