UserController::save(); }); $routes->get('/user', function () { UserController::all(); }); $routes->get('/user/:id/edit', function ($id) { UserController::edit($id); }); $routes->post('/user/:id/edit', function ($id) { UserController::updateUsername($id); }); $routes->get('/user/:id/password', function ($id) { UserController::editPassword($id); }); $routes->post('/user/:id/password', function ($id) { UserController::updatePassword($id); }); //site $routes->get('/site/new_site', 'check_logged_in', function () { SiteController::new_site(); }); $routes->get('/site/show_site/:id', 'check_logged_in', function ($id) { SiteController::show($id); }); $routes->get('/site/show_site/:id/edit', 'check_logged_in', function ($id) { SiteController::edit($id); }); $routes->post('/site/show_site/:id/edit', 'check_logged_in', function ($id) { SiteController::update($id); }); $routes->post('/site/:id/destroy', 'check_logged_in', function ($id) {
$controller->changeInfo(); }); $app->post('/change/info', function () { fAuthorization::requireLoggedIn(); $controller = new UserController(); $controller->updateInfo(); }); $app->get('/change/password', function () { fAuthorization::requireLoggedIn(); $controller = new UserController(); $controller->changePassword(); }); $app->post('/change/password', function () { fAuthorization::requireLoggedIn(); $controller = new UserController(); $controller->updatePassword(); }); $app->get('/home', function () { $controller = new HomeController(); $controller->index(); }); $app->get('/sets', function () { $controller = new HomeController(); $controller->showProblemSets(); }); $app->get('/page/:name', function ($name) { $controller = new HomeController(); $controller->showPage($name); }); $app->get('/problems', function () { $controller = new ProblemController();