From fafbe3e567f11afcdddd044aa92b5b990a7f8ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20Rich=C3=A1rd?= Date: Sun, 28 Jul 2019 16:00:27 +0200 Subject: [PATCH] fixed undefined variable (authorities) notice --- event_handler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/event_handler.php b/event_handler.php index b90f22b..28ca85a 100644 --- a/event_handler.php +++ b/event_handler.php @@ -187,7 +187,8 @@ if (isset($_POST['action'])) { $psw = "null"; } - $new_coach_id = user::create_user($_POST['ua_name'], $psw, $_POST['authorities']); + $authorities = isset($_POST['authorities']) ? $_POST['authorities'] : array(); + $new_coach_id = user::create_user($_POST['ua_name'], $psw, $authorities); log::register('new_coach', $new_coach_id); header("Location: /admin/coaches"); break; @@ -200,7 +201,8 @@ if (isset($_POST['action'])) { $psw = "-1"; //ez jelzi h nem szabad updatelni } - user::update_user($_POST['ua_name'], $psw, isset($_POST['ua_admin']), $_POST['ua_id'], $_POST['authorities']); + $authorities = isset($_POST['authorities']) ? $_POST['authorities'] : array(); + user::update_user($_POST['ua_name'], $psw, isset($_POST['ua_admin']), $_POST['ua_id'], $authorities); log::register('update_coach', $_POST['ua_id']); header("Location: /admin/coaches/".$_POST['ua_id']); break;