當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Request::getPassword方法代碼示例

本文整理匯總了PHP中Illuminate\Http\Request::getPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getPassword方法的具體用法?PHP Request::getPassword怎麽用?PHP Request::getPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Http\Request的用法示例。


在下文中一共展示了Request::getPassword方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (env('APP_ENV') != 'local' && !in_array($request->ip(), $this->allowIps)) {
         if (empty($request->getUser()) || empty($request->getPassword()) || $request->getUser() !== $this->credentials['id'] || $request->getPassword() !== $this->credentials['password']) {
             return $this->auth->basic();
         }
     }
     return $next($request);
 }
開發者ID:mint-soft-com,項目名稱:xpressengine,代碼行數:16,代碼來源:AuthenticateInside.php

示例2: getTokenForRequest

 /**
  * Get the token for the current request.
  *
  * @return string
  */
 protected function getTokenForRequest()
 {
     $token = $this->request->input($this->inputKey);
     if (empty($token)) {
         $token = $this->request->bearerToken();
     }
     if (empty($token)) {
         $token = $this->request->getPassword();
     }
     return $token;
 }
開發者ID:eugene-holiday,項目名稱:framework,代碼行數:16,代碼來源:TokenGuard.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($request->getUser() != env('AUTH_BASIC_USER') || $request->getPassword() != env('AUTH_BASIC_PASS')) {
         $headers = ['WWW-Authenticate' => 'Basic'];
         return response('Invalid credentials.', 401, $headers);
     }
     return $next($request);
 }
開發者ID:jumilla,項目名稱:laravel5-sample-todo,代碼行數:15,代碼來源:BasicAuth.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $valid = $request->getUser() == env('BASIC_USERNAME') && $request->getPassword() == env('BASIC_PASSWORD');
     if ($valid) {
         return $next($request);
     }
     $headers = ['WWW-Authenticate' => 'Basic'];
     return new Response('Invalid credentials.', 401, $headers);
 }
開發者ID:javanlabs,項目名稱:tender,代碼行數:16,代碼來源:CustomBasicAuth.php

示例5: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     // check current environment
     if (App::environment() !== "development" && App::environment() !== "testing") {
         // check given credentials
         if ($request->getUser() !== config('app.api_user') || $request->getPassword() !== config('app.api_password')) {
             return response()->json(['error' => 'Invalid credentials.'], 401)->header('WWW-Authenticate', 'Basic');
         }
     }
     return $next($request);
 }
開發者ID:MyGrades,項目名稱:mygrades-server,代碼行數:18,代碼來源:BasicAuthMiddleware.php

示例6: login

 /**
  * Log in a user.
  *
  * @param Request $request
  *
  * @return ApiResponse
  */
 public function login(Request $request)
 {
     $credentials = ['email' => $request->getUser(), 'password' => $request->getPassword()];
     if (!($token = $this->attemptLogin($credentials))) {
         // Check to see if the user has recently requested to change their email and try to log in using it
         if ($oldEmail = User::findCurrentEmail($credentials['email'])) {
             $credentials['email'] = $oldEmail;
             if (!($token = $this->attemptLogin($credentials))) {
                 throw new UnauthorizedException('Credentials failed.');
             }
         } else {
             throw new UnauthorizedException('Credentials failed.');
         }
     }
     return $this->getResponse()->transformer($this->transformer)->item($token);
 }
開發者ID:TFidryForks,項目名稱:spira,代碼行數:23,代碼來源:AuthController.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $usuario = new User($request->all());
     // encriptamos el password
     $usuario->password = bcrypt($request->getPassword());
     $date = Carbon::now()->minute . Carbon::now()->second;
     $file = $request->file('imagen');
     $filename = $date . $file->getClientOriginalName();
     $image = \Image::make($file);
     $ruta = public_path() . '/uploads/usuarios/';
     $image->save($ruta . $filename);
     $image->resize(40, 40);
     $image->save($ruta . 'thumb/' . 'thumb_' . $filename);
     $usuario->avatar = $filename;
     $usuario->save();
     return redirect()->route('admin.usuarios.index');
 }
開發者ID:byrogr,項目名稱:appmandri,代碼行數:23,代碼來源:UsersController.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     // Load configuration
     $veryBasicAuthUser = config('very_basic_auth.user');
     $veryBasicAuthPass = config('very_basic_auth.password');
     $veryBasicAuthEnvs = config('very_basic_auth.envs');
     $veryBasicAuthMsg = config('very_basic_auth.error_message');
     $veryBasicAuthView = config('very_basic_auth.error_view');
     // Check if middleware is in use in current environment
     if (in_array(app()->environment(), $veryBasicAuthEnvs)) {
         if ($request->getUser() != $veryBasicAuthUser || $request->getPassword() != $veryBasicAuthPass) {
             $header = ['WWW-Authenticate' => 'Basic'];
             // If view is available
             if ($veryBasicAuthView) {
                 return response()->view($veryBasicAuthView, [], 401)->withHeaders($header);
             }
             // Else return default message
             return response($veryBasicAuthMsg, 401, $header);
         }
     }
     return $next($request);
 }
開發者ID:olssonm,項目名稱:l5-very-basic-auth,代碼行數:29,代碼來源:VeryBasicAuth.php

示例9: getPassword

 /**
  * Returns the password.
  *
  * @return string|null 
  * @static 
  */
 public static function getPassword()
 {
     //Method inherited from \Symfony\Component\HttpFoundation\Request
     return \Illuminate\Http\Request::getPassword();
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:11,代碼來源:_ide_helper.php

示例10: getBasicCredentials

 /**
  * Get the credential array for a HTTP Basic request.
  *
  * @param \Illuminate\Http\Request $request
  * @param string                   $field
  *
  * @return array
  */
 protected function getBasicCredentials(Request $request, $field)
 {
     return [$field => $request->getUser(), 'password' => $request->getPassword()];
 }
開發者ID:arubacao,項目名稱:http-basic-auth-guard,代碼行數:12,代碼來源:BasicGuard.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @param string|null $user
  *
  * @return mixed
  */
 public function handle($request, Closure $next, string $user = null)
 {
     $this->shield->verify($request->getUser(), $request->getPassword(), $user);
     return $next($request);
 }
開發者ID:vinkla,項目名稱:laravel-shield,代碼行數:14,代碼來源:ShieldMiddleware.php


注:本文中的Illuminate\Http\Request::getPassword方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。