/** * User Profile action * * @return void */ public function edit() { $this->layout = 'default'; if (!$this->user) { $this->Session->setFlash(__d('users', 'Hey buddy, you need to login first!')); $this->redirect(array('controller' => 'app_users', 'action' => 'login')); } parent::edit(); }
UsersController::login(); }); $routes->get('/rekisteroidy', function () { UsersController::add_form(); }); $routes->post('/rekisteroidy', function () { UsersController::add(); }); $routes->post('/kirjaudu_ulos', 'check_logged_in', function () { UsersController::logout(); }); $routes->get('/omat_tiedot', 'check_logged_in', function () { UsersController::edit_form(); }); $routes->post('/omat_tiedot', 'check_logged_in', function () { UsersController::edit(); }); $routes->get('/tuotteet/kebabit', function () { ProductController::get_products('Kebab'); }); $routes->get('/tuotteet/juomat', function () { ProductController::get_products('Juoma'); }); $routes->get('/tuotteet/pizzat', function () { ProductController::get_products('Pizza'); }); $routes->get('/tuotteet/salaatit', function () { ProductController::get_products('Salaatti'); }); $routes->get('/tuotteet/:category/lisaa', 'check_logged_in', 'check_if_admin', function ($category) { ProductController::add_form($category);