public function postLogin(LoginRequest $request) { if ($this->auth->attempt($request->only('email', 'password'))) { return redirect('/dash-board'); } return redirect('/login')->withErrors(['email' => 'The credentials you entered did not match our records. Try again?']); }
protected function login(LoginRequest $request) { $credentials = $request->only('email', 'password'); if (Auth::attempt($credentials)) { return 'Success'; } else { return 'Failed'; } }
/** * @param null $username * @param null $password * @param null $ticket * @param bool $rememberMe * @param null $warn * @param null $service * @param null $renew * @param null $gateway * @param null $responseMethod */ public function __construct($username, $password, $ticket, $rememberMe = false, $warn = null, $service = null, $renew = null, $gateway = null, $responseMethod = null) { $this->username = $username; $this->password = $password; $this->warn = $warn; $this->rememberMe = (bool) $rememberMe; $this->setTicket($ticket); parent::__construct($service, $renew, $gateway, $responseMethod); }
public static function Init($params) { DebugManager::Log("Got a logout request!", '@'); /** * @todo ValidateLogin should provide a token, which is passed to * SessionManager */ if (AccountController::ValidateLogin($params)) { $account = AccountController::Search($params); SessionManager::Create(true, reset($account)); } else { self::$defaultRedirect = 'login'; } return new ResponseObject(); }
private function handleActivatePost() { $request = Request::getInstance(); $view = ViewManager::getInstance(); $systemUser = new SystemUser(); $loginRequest = new LoginRequest(); $view->setType(self::VIEW_ACTIVATE); try { if (!$request->exists('tag')) { throw new Exception('Tag ontbreekt.'); } if (!$request->exists('key')) { throw new Exception('Key is missing.'); } $key = $request->getValue('key'); if (!$key) { throw new Exception('Key is missing.'); } // get request details $requestKey = array('request_key' => $key); if (!$loginRequest->exists($requestKey)) { throw new Exception('Request does not exist.'); } $requestInfo = $loginRequest->getDetail($requestKey); // get user details $userKey = array('id' => $requestInfo['usr_id']); if (!$systemUser->exists($userKey)) { throw new Exception('Request does not exist.'); } $user = $systemUser->getDetail(array('id' => $requestInfo['usr_id'])); $tree = $this->director->tree; $tag = $request->getValue('tag'); $tree_id = $tree->getCurrentId(); $key = array('tree_id' => $tree_id, 'tag' => $tag); $settings = $this->getDetail($key); // hide old password and change with password validation $newpass1 = $request->getValue('newpass1'); $newpass2 = $request->getValue('newpass2'); if (!$newpass1 && !$newpass2) { throw new Exception("Password is missing."); } if ($newpass1 == $newpass2) { $systemUser->setPassword($userKey, $newpass1); } else { throw new Exception("Passwords do not match."); } // delete request //$loginRequest->delete($requestKey); $referer = $settings['fin_tree_id'] ? $tree->getPath($settings['fin_tree_id'], '/', Tree::TREE_ORIGINAL) : ($request->exists('referer') ? $request->getValue('referer') : '/'); header("Location: {$referer}"); exit; } catch (Exception $e) { $template = new TemplateEngine(); $template->setVariable('formError', $e->getMessage(), false); $this->handleHttpGetRequest(); } }