Esempio n. 1
0
 /**
  * prepareExecute
  *
  * @return  void
  */
 protected function prepareExecute()
 {
     if (UserHelper::isLogin()) {
         $this->redirect($this->getSuccessRedirect());
         return;
     }
     parent::prepareExecute();
 }
Esempio 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();
 }
Esempio 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');
 }
Esempio n. 4
0
 /**
  * getFailRedirect
  *
  * @param  DataInterface $data
  *
  * @return  string
  */
 protected function getFailRedirect(DataInterface $data = null)
 {
     unset($data->id);
     return parent::getFailRedirect($data);
 }
Esempio n. 5
0
 /**
  * postExecute
  *
  * @param mixed $result
  *
  * @return  mixed
  */
 protected function postExecute($result = null)
 {
     return parent::postExecute($result);
 }
Esempio n. 6
0
 /**
  * postSave
  *
  * @param DataInterface $data
  *
  * @return  void
  */
 protected function postSave(DataInterface $data)
 {
     parent::postSave($data);
 }
Esempio 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);
 }
Esempio n. 9
0
 /**
  * postSave
  *
  * @param Data $data
  *
  * @return  void
  */
 protected function postSave(Data $data)
 {
     parent::postSave($data);
 }
Esempio 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);
     }
 }