public function updatePassword($token = NULL) { $this->view->token = $token; if ($token == NULL) { Header::location('/'); } if (count(Auth::verifyRecoverUser($token)) < 1) { $this->view->alert_msg = 'Token expirado!'; } else { if (!is_null($this->post->get('password'))) { if (is_null($this->post->getAll())) { $this->view->alert_msg = 'Preencha todos os campos!'; } if ($this->post->get('password') != $this->post->get('confirm_password')) { $this->view->alert_msg = 'As senhas não coincidem!'; } else { Auth::updateRecover($this->post->get('password'), $token); Header::location('/admin/user'); } } } $this->view->render('User_UpdatePassword'); }
public static function verifyAuth() { if (is_null(Session::get('user'))) { Header::location('/admin/user/login'); } }