bug behoben Admin Funktion
This commit is contained in:
parent
1f6126cc95
commit
e5be261875
3 changed files with 10 additions and 2 deletions
|
|
@ -9,8 +9,6 @@ if (!isset($_SESSION['user_id'])) {
|
||||||
|
|
||||||
// Ab hier: Nur für angemeldete Benutzer
|
// Ab hier: Nur für angemeldete Benutzer
|
||||||
error_log($_SESSION['user_id']);
|
error_log($_SESSION['user_id']);
|
||||||
// Standard: kein Admin
|
|
||||||
$is_admin = "false";
|
|
||||||
|
|
||||||
// Prüfen, ob die user_id im Admin-Array ist
|
// Prüfen, ob die user_id im Admin-Array ist
|
||||||
if (in_array($_SESSION['user_id'], $admin_ids, true)) {
|
if (in_array($_SESSION['user_id'], $admin_ids, true)) {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,11 @@ if (!isset($_SESSION['user_id'])) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prüfen, ob die user_id im Admin-Array ist
|
||||||
|
if (in_array($_SESSION['user_id'], $admin_ids, true)) {
|
||||||
|
$is_admin = "true";
|
||||||
|
}
|
||||||
|
|
||||||
// Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern
|
// Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern
|
||||||
$year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y');
|
$year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y');
|
||||||
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m');
|
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m');
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,11 @@ if (!isset($_SESSION['user_id'])) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prüfen, ob die user_id im Admin-Array ist
|
||||||
|
if (in_array($_SESSION['user_id'], $admin_ids, true)) {
|
||||||
|
$is_admin = "true";
|
||||||
|
}
|
||||||
|
|
||||||
// Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern
|
// Aktuelles Jahr und Monat ermitteln, ggf. aus GET-Parametern
|
||||||
$year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y');
|
$year = isset($_GET['year']) ? (int)$_GET['year'] : (int)date('Y');
|
||||||
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m');
|
$month = isset($_GET['month']) ? (int)$_GET['month'] : (int)date('m');
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue