} }, "customer/registration" => function () { if (isset($_GET['email']) && isset($_GET['key'])) { $reg_success = AnonymousController::checkRegistration(); if ($reg_success) { CustomerController::setActiveUser(); echo ViewHelper::render("view/customer-message.php", ["message" => "Registracija uspešna! Lahko se sedaj prijavite."]); } else { echo ViewHelper::render("view/customer-message.php", ["message" => "Registracija neuspešna! Vpišite pravi registracijski naslov."]); // AnonymousController::registrationUnsuccessful(); } } else { AnonymousController::registration(); } }, "customer/rating" => function () { CustomerController::addRating(); // echo json_encode($_POST["ocena"]); }, "customer/registration/mailsent" => function () { echo ViewHelper::render("view/customer-message.php", ["message" => "Hvala za registracijo! Potrditveni mail je bil poslan na mail."]); }, "customer/registration/mailfailed" => function () { echo ViewHelper::render("view/customer-message.php", ["message" => "Zgodila se je napaka! Potrditveni mail ni bil poslan."]); }, "customer/login" => function () { if (isset($_SESSION["active"]) && $_SESSION["role"] == "customer") { ViewHelper::redirect(BASE_URL . "customer"); } elseif ($_SERVER["REQUEST_METHOD"] == "POST") { CustomerController::check(); } else { CustomerController::login(); } }, "customer/logout" => function () { session_unset();