Exemplo n.º 1
0
 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     if (UserHelper::isLogin()) {
         $this->redirect($this->getSuccessRedirect());
         return;
     }
     parent::prepareExecute();
 }
Exemplo n.º 2
0
 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     if (UserHelper::isLogin()) {
         $warder = WarderHelper::getPackage();
         $this->redirect($this->router->route($warder->get('frontend.redirect.login', 'home')));
         return;
     }
     parent::prepareExecute();
 }
Exemplo n.º 3
0
 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     if (UserHelper::isLogin()) {
         $warder = WarderHelper::getPackage();
         $this->redirect($this->router->route($warder->get('frontend.redirect.login', 'home')));
         return;
     }
     parent::prepareExecute();
     $this->data['email'] = $this->input->getEmail('email');
     $this->data['token'] = $this->input->get('token');
 }
Exemplo n.º 4
0
 /**
  * getFailRedirect
  *
  * @param  DataInterface $data
  *
  * @return  string
  */
 protected function getFailRedirect(DataInterface $data = null)
 {
     unset($data->id);
     return parent::getFailRedirect($data);
 }
Exemplo n.º 5
0
 /**
  * postExecute
  *
  * @param mixed $result
  *
  * @return  mixed
  */
 protected function postExecute($result = null)
 {
     return parent::postExecute($result);
 }
Exemplo n.º 6
0
 /**
  * postSave
  *
  * @param DataInterface $data
  *
  * @return  void
  */
 protected function postSave(DataInterface $data)
 {
     parent::postSave($data);
 }
Exemplo n.º 7
0
 /**
  * getRecord
  *
  * @param string $name
  *
  * @return  \Windwalker\Record\Record
  */
 public function getRecord($name = 'User')
 {
     return parent::getRecord($name);
 }
 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     if (UserHelper::isLogin()) {
         $warder = WarderHelper::getPackage();
         $this->redirect($this->router->route($warder->get('frontend.redirect.login', 'home')));
         return;
     }
     parent::prepareExecute();
     $this->token = UserHelper::getToken($this->data['email']);
     $this->data['activation'] = UserHelper::hashPassword($this->token);
 }
Exemplo n.º 9
0
 /**
  * postSave
  *
  * @param Data $data
  *
  * @return  void
  */
 protected function postSave(Data $data)
 {
     parent::postSave($data);
 }
Exemplo n.º 10
0
 /**
  * validate
  *
  * @param DataInterface $data
  *
  * @return  void
  *
  * @throws ValidateFailException
  */
 protected function validate(DataInterface $data)
 {
     parent::validate($data);
     $loginName = WarderHelper::getLoginName();
     if ($loginName != 'email') {
         $user = User::get(array($loginName => $data->{$loginName}));
         if ($user->notNull() && $user->id != $data->id) {
             throw new ValidateFailException(Translator::translate($this->langPrefix . 'message.user.account.exists'));
         }
     }
     $user = User::get(array('email' => $data->email));
     if ($user->notNull() && $user->id != $data->id) {
         throw new ValidateFailException(Translator::translate($this->langPrefix . 'message.user.email.exists'));
     }
     if ('' !== (string) $data->password) {
         if ($data->password != $data->password2) {
             throw new ValidateFailException(Translator::translate($this->langPrefix . 'message.password.not.match'));
         }
         unset($data->password2);
     } else {
         unset($data->password);
     }
 }