Exemple #1
0
 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');
 }
Exemple #2
0
 public static function verifyAuth()
 {
     if (is_null(Session::get('user'))) {
         Header::location('/admin/user/login');
     }
 }