/** * @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(); }
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(); }
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(); } } }