Example #1
0
 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('/');
     }
 }
Example #2
0
 protected function redirect()
 {
     Page::redirect('/todos');
 }
Example #3
0
 protected function redirect()
 {
     Page::redirect('/records');
 }
Example #4
0
 public function getPath($offset = null)
 {
     return parent::getPath($offset);
 }