Example #1
0
 public function activateAction()
 {
     $request = $this->getRequest();
     $param = $request->getParam("key");
     $email = $this->convert($param, $this->_key);
     if (isset($email)) {
         $user = new PAP_Model_User();
         $user->loadByEmail($email);
         if (!isset($user)) {
             $this->_redirect('auth/notexist');
         }
         if ($user->getStatus() == 'pending') {
             $user->setStatus('validated');
             $user->update();
             $this->view->assign('name', $user->getName());
         } else {
             //Si el user ya fue validado
             if ($user->getStatus() != null) {
                 $this->_redirect('auth/login/user/' . $email);
             } else {
                 $this->_redirect('auth/login');
             }
         }
     } else {
         $this->_redirect('auth/login');
     }
     //
 }