当前位置: 首页>>代码示例>>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;未经允许,请勿转载。