// Auth $routes->get('/login', 'guest', function () { AuthController::login(); }); $routes->post('/login', 'guest', function () { AuthController::handle_login(); }); $routes->get('/logout', 'auth', function () { AuthController::logout(); }); // Profile $routes->get('/profile/edit', 'auth', function () { ProfileController::edit(); }); $routes->post('/profile/update', 'auth', function () { ProfileController::edit(); }); $routes->get('/profile/password', 'auth', function () { ProfileController::password(); }); $routes->post('/profile/password/update', 'auth', function () { ProfileController::updatePassword(); }); // Controlpanel $routes->get('/controlpanel', 'admin', function () { AuthController::controlpanel(); }); // Users $routes->get('/users', 'admin', function () { UsersController::index(); });
} } $profile_controller = new ProfileController(); if (isset($_GET['id'])) { $user_profile_id = $_GET['id']; $user = NULL; if (isset($_SESSION['user_hash'])) { $user = $_SESSION['user_hash']; } switch ($user_profile_id) { case $user: if (isset($_GET['m'])) { $method = $_GET['m']; switch ($method) { case 'edit': $profile_controller->edit($_SESSION['user_id']); break; default: $profile_controller->error_page(); break; } } else { $profile_controller->index($user_profile_id); } break; default: if (isset($_GET['m'])) { $profile_controller->error_page(); exit; } $profile_controller->index($user_profile_id);