public function __construct($controller) { $user = $controller->getCurrentUser(); if ($user) { $this->form = new \Depage\HtmlForm\HtmlForm('login', ['label' => 'logout']); } else { $this->form = new \Depage\HtmlForm\HtmlForm('login', ['label' => 'login']); $this->form->addText('User'); $this->form->addPassword('Pass'); } $this->form->process(); if ($this->form->validate()) { if ($user) { $controller->logoff(); } else { $values = $this->form->getValues(); $controller->login($values['User'], $values['Pass']); } $this->form->clearSession(); Page::redirect('/'); } }
protected function redirect() { Page::redirect('/todos'); }
protected function redirect() { Page::redirect('/records'); }
public function getPath($offset = null) { return parent::getPath($offset); }