Ejemplo n.º 1
0
 /**
  * @return mixed
  */
 public function execute()
 {
     $rUser->setArray($this->request->post());
     $rUser->hashPassword();
     if ($rUser->save()) {
         trigger('user.registered', [$rUser]);
         return $this->successful();
     }
     return $this->error();
 }
Ejemplo n.º 2
0
 public function execute(callable $next)
 {
     if ($this->auth->isLoggedIn() || !$this->request->isGet() || !isset($_COOKIE['pckg.auth.autologin'])) {
         return $next();
     }
     $cookie = unserialize($_COOKIE['pckg.auth.autologin']);
     foreach ($cookie as $provider => $data) {
         $this->auth->useProvider($provider);
         $this->auth->autologin($data['user_id']);
     }
     return $next();
 }
Ejemplo n.º 3
0
 protected function resolvePost()
 {
     /**
      * Initialize fields.
      */
     $this->form->initFields();
     /**
      * Fill form with request data.
      */
     $this->form->populateFromRequest();
     if ($this->form->isValid()) {
         return $this->form;
     } else {
         /**
          * Fill session with form data.
          */
         $this->form->populateToSession();
         if ($this->request->isAjax()) {
             return $this->ajaxErrorResponse();
         } else {
             return $this->postErrorResponse();
         }
     }
 }