diff --git a/index.php b/index.php index 261c415..9ca0aad 100644 --- a/index.php +++ b/index.php @@ -61,6 +61,7 @@ auth_bootstrap(); $session_cl_auth_user = isset($_SESSION['user']) ? (string) $_SESSION['user'] : ''; $session_cl_auth_right = isset($_SESSION['role']) ? (string) $_SESSION['role'] : ''; $is_authenticated = $session_cl_auth_user !== ''; +$has_member_access = $is_authenticated && in_array($session_cl_auth_right, ['member', 'admin'], true); $scan_reference_rows = []; $scan_reference_max_occurrence = 0; @@ -127,12 +128,13 @@ try { $scan_reference_error = 'Impossible de charger le tableau des signatures de scan pour le moment.'; } -try { - if (!isset($db) || !($db instanceof PDO)) { - $db = db(); - } +if ($has_member_access) { + try { + if (!isset($db) || !($db instanceof PDO)) { + $db = db(); + } - $stmt_ship_presets = $db->query( + $stmt_ship_presets = $db->query( "SELECT cl_scpreset_id, cl_scpreset_name, cl_scpreset_manufacturer, cl_scpreset_description, cl_scpreset_link, cl_scpreset_creator FROM tbl_scpreset ORDER BY cl_scpreset_manufacturer ASC, cl_scpreset_name ASC" @@ -157,13 +159,15 @@ try { ]; } - natcasesort($ship_preset_manufacturers); - $ship_preset_manufacturers = array_values($ship_preset_manufacturers); -} catch (Throwable $e) { - $ship_preset_error = 'Impossible de charger les presets de vaisseaux pour le moment.'; + natcasesort($ship_preset_manufacturers); + $ship_preset_manufacturers = array_values($ship_preset_manufacturers); + } catch (Throwable $e) { + $ship_preset_error = 'Impossible de charger les presets de vaisseaux pour le moment.'; + } } -try { +if ($has_member_access) { + try { if (!isset($db) || !($db instanceof PDO)) { $db = db(); } @@ -234,15 +238,16 @@ try { } } - foreach ($grouped_item_custom_public as $item_custom_public_row) { - $item_custom_public_row['search'] = trim(implode(' ', array_filter($item_custom_public_row['search_parts'], static function ($value) { - return trim((string) $value) !== ''; - }))); - unset($item_custom_public_row['search_parts']); - $item_custom_public_rows[] = $item_custom_public_row; + foreach ($grouped_item_custom_public as $item_custom_public_row) { + $item_custom_public_row['search'] = trim(implode(' ', array_filter($item_custom_public_row['search_parts'], static function ($value) { + return trim((string) $value) !== ''; + }))); + unset($item_custom_public_row['search_parts']); + $item_custom_public_rows[] = $item_custom_public_row; + } + } catch (Throwable $e) { + $item_custom_public_error = 'Impossible de charger les objets Item Custom pour le moment.'; } -} catch (Throwable $e) { - $item_custom_public_error = 'Impossible de charger les objets Item Custom pour le moment.'; } ?> @@ -991,8 +996,10 @@ try {
Signatures de minage - Presets de vaisseaux - Item Custom + + Presets de vaisseaux + Item Custom +
id="accountPanel"> @@ -1057,6 +1064,7 @@ try {
+ + + + + +