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


PHP Authenticatable::getAuthPassword方法代碼示例

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


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

示例1: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     $options = array();
     if ($user instanceof User) {
         $options['salt'] = $user->salt;
         $options['byte_size'] = strlen($user->getAuthPassword());
     }
     return $this->hasher->check($plain, $user->getAuthPassword(), $options);
 }
開發者ID:drawmyattention,項目名稱:expauth,代碼行數:17,代碼來源:ExpressionEngineUserProvider.php

示例2: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     $legacyHasher = $user->getAuthObject();
     if ($legacyHasher !== false) {
         if (!$legacyHasher->check($plain, $user->getAuthPassword())) {
             return false;
         }
         $user->password = $this->hasher->make($plain);
         $user->password_legacy = null;
         $user->save();
         return true;
     }
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
開發者ID:GodOfConquest,項目名稱:infinity-next,代碼行數:22,代碼來源:EloquentUserProvider.php

示例3: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     $laravel = $this->hasher->check($plain, $user->getAuthPassword());
     if ($laravel) {
         return true;
     }
     $django = $this->hasher->checkForDjango($plain, $user->getAuthPassword());
     if ($django) {
         if (config('auth.rehash_django', true)) {
             $this->updatePassword($user, $plain);
         }
         return true;
     }
     return false;
 }
開發者ID:jobinja,項目名稱:laravel-djangoable-auth,代碼行數:23,代碼來源:DjangoableEloquentUserProvider.php

示例4: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if (!isset($credentials['password'])) {
         return false;
     }
     return $user->getAuthPassword() === $credentials['password'];
 }
開發者ID:larasite,項目名稱:larasite,代碼行數:14,代碼來源:ConfigUserProvider.php

示例5: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     // $is_valid = $this->model->where('Username', '=', $credentials['Username'])->where('Password', '=', $credentials['Password'])->first() != null;
     $is_valid = $user->Username == $credentials['Username'] && $this->hasher->check($credentials['Password'], $user->getAuthPassword());
     return $is_valid;
     // $plain = $credentials['password'];
     // return $this->hasher->check($plain, $user->getAuthPassword());
 }
開發者ID:ahmadmuiz,項目名稱:wp_employee,代碼行數:15,代碼來源:CustomUserProvider.php

示例6: validateCredentials

 /**
  * @param Authenticatable $user
  * @param array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user->type == 'local') {
         $plain = $credentials['password'];
         return $this->hasher->check($plain, $user->getAuthPassword());
     }
     return true;
 }
開發者ID:h3r2on,項目名稱:shibboleth,代碼行數:13,代碼來源:ShibolethUserProvider.php

示例7: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user instanceof CustomKeyAuthenticable) {
         $method = 'get' . ucfirst($user->getAuthKeyName());
     } else {
         $method = 'getEmail';
     }
     return app('hash')->check($credentials['password'], $user->getAuthPassword()) && trim(strtolower($credentials['email'])) === trim(strtolower($user->{$method}()));
 }
開發者ID:atrauzzi,項目名稱:laravel-doctrine,代碼行數:16,代碼來源:DoctrineAuthenticator.php

示例8: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Auth\UserInterface  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(\Illuminate\Contracts\Auth\Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
開發者ID:opensolutions,項目名稱:doctrine2bridge-l5,代碼行數:12,代碼來源:Doctrine2UserProvider.php

示例9: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param \Illuminate\Contracts\Auth\Authenticatable $user
  * @param array                                      $credentials
  *
  * @return bool
  */
 public function validateCredentials(AuthenticatableContract $user, array $credentials)
 {
     return $this->hasher->check($credentials['password'], $user->getAuthPassword());
 }
開發者ID:rosstuck,項目名稱:Laravel-Doctrine,代碼行數:12,代碼來源:DoctrineUserProvider.php

示例10: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $this->hasher->make($user->getAuthPassword()));
 }
開發者ID:flysap,項目名稱:administrator,代碼行數:12,代碼來源:FileUserProvider.php

示例11: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $password = $credentials[$this->getPasswordField()];
     return $this->hasher->check($password, $user->getAuthPassword());
 }
開發者ID:reshadman,項目名稱:laravel-mongo-auth,代碼行數:12,代碼來源:MongoDbUserProvider.php

示例12: validateCredentials

 public function validateCredentials(UserContract $user, array $credentials)
 {
     $userPass = $user->getAuthPassword();
     $pass = $credentials['password'];
     return password_verify($pass, $userPass);
 }
開發者ID:barnetik,項目名稱:doctrine-auth-provider,代碼行數:6,代碼來源:DoctrineUserProvider.php

示例13: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array                                      $credentials
  *
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $pwmatch = FALSE;
     $hash = $user->getAuthPassword();
     if ($this->hash_password) {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.hashpw', ['username_clean' => strtolower($credentials['username'])]);
         }
         //Check if hash is a bcryp 2 hash, then use bcrypt2
         if (strncmp($hash, '$2y$10$', 7) == 0) {
             $pwmatch = Hash::check($credentials['password'], $hash);
             if ($this->log_logins) {
                 Log::debug('login.validatecreds.newhash', ['username_clean' => strtolower($credentials['username'])]);
             }
         } else {
             $passwordhash = new PasswordHash();
             $pwmatch = $passwordhash->phpbb_check_hash($credentials['password'], $user->getAuthPassword());
             if ($this->log_logins) {
                 Log::debug('login.validatecreds.oldhash', ['username_clean' => strtolower($credentials['username'])]);
             }
         }
     } else {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.nohash', ['username_clean' => strtolower($credentials['username'])]);
         }
         $pwmatch = $credentials['password'] == $hash;
     }
     if ($user->username_clean == strtolower($credentials['username']) && $pwmatch == TRUE) {
         if ($this->log_logins) {
             Log::debug('login.validatecreds.success', ['username_clean' => strtolower($credentials['username'])]);
         }
         return TRUE;
     }
     if ($this->log_logins) {
         Log::debug('login.validatecreds.fail', ['username_clean' => strtolower($credentials['username'])]);
     }
     return FALSE;
 }
開發者ID:Aurorastation,項目名稱:Web-Interface,代碼行數:46,代碼來源:PhpbbUserProvider.php

示例14: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     return $this->hasher->check($plain, $user->getAuthPassword());
 }
開發者ID:manhvu1212,項目名稱:videoplatform,代碼行數:12,代碼來源:DatabaseUserProvider.php

示例15: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     $plain = $credentials['password'];
     if ($this->hasher->check($plain, $user->getAuthPassword())) {
         //            $user->last_login_time = Carbon::now();
         //            $user->save();
         return true;
     }
     return false;
 }
開發者ID:digitlimit,項目名稱:adminpanel,代碼行數:17,代碼來源:AdminpanelUserProvider.php


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