本文整理汇总了PHP中Illuminate\Hashing\BcryptHasher::check方法的典型用法代码示例。如果您正苦于以下问题:PHP BcryptHasher::check方法的具体用法?PHP BcryptHasher::check怎么用?PHP BcryptHasher::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Hashing\BcryptHasher
的用法示例。
在下文中一共展示了BcryptHasher::check方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check
/**
* @param $value
* @return bool
*/
public function check($value)
{
$store = $this->session->get('captcha');
if ($this->sensitive) {
$value = $this->str->lower($value);
$store = $this->str->lower($store);
}
return $this->hasher->check($value, $store);
}
示例2: check
/**
*
* @param $value
* @return bool
*/
public function check($value)
{
$store = $this->session->get('captcha' . (Input::has('captcha_id') ? '_' . Input::get('captcha_id') : ''));
if ($this->sensitive) {
$value = $this->str->lower($value);
$store = $this->str->lower($store);
}
return $this->hasher->check($value, $store);
}
示例3: unlock
/**
* Unlocks a batch by checking the specified
* password against the batch password.
*
* @param BatchUnlockRequest $request
*
* @return bool
*/
public function unlock(BatchUnlockRequest $request)
{
$hasher = new BcryptHasher();
if ($hasher->check($request->input('password'), $this->password)) {
// Store the UUID in the users session so they can have
// access to it for as long as the session exists
$request->session()->put($this->uuid, $this->uuid);
return true;
}
return false;
}
示例4: check
/**
* Captcha check
*
* @param $value
* @return bool
*/
public function check($value)
{
if (!$this->session->has('captcha')) {
return false;
}
$key = $this->session->get('captcha.key');
if (!$this->session->get('captcha.sensitive')) {
$value = $this->str->lower($value);
}
$this->session->remove('captcha');
return $this->hasher->check($value, $key);
}
示例5: updateSettings
public function updateSettings(Request $request, Hash $hash)
{
$user = $request->user();
$rules = ['old_password' => 'required|min:8', 'password' => 'required|confirmed|min:8'];
$validator = app('validation')->make($request->all(), $rules);
if ($validator->fails()) {
$request->session->add(['errors' => $validator->errors()->all()]);
return app('twig')->render('user/settings.htm', ['oldInputs' => $request->all()]);
}
if (!$hash->check($request->input('old_password'), $user->password)) {
$request->session->add(['errors' => ['Old password incorrect.']]);
return app('twig')->render('user/settings.htm', ['oldInputs' => $request->all()]);
}
$user->password = $hash->make($request->input('old_password'));
$user->save();
$request->session->add(['success' => 'settings updated successfuly.']);
return app('twig')->render('user/settings.htm');
}
示例6: check
/**
* Check the given plain value against a hash.
*
* @param string $value
* @param string $hashedValue
* @param array $options
* @return bool
* @static
*/
public static function check($value, $hashedValue, $options = array())
{
return \Illuminate\Hashing\BcryptHasher::check($value, $hashedValue, $options);
}
示例7: checkPin
/**
* Checks the specified pin against the current password folder pin.
*
* @param string $pin
*
* @return bool
*/
public function checkPin($pin)
{
$hasher = new BcryptHasher();
return $hasher->check($pin, $this->pin);
}
示例8: check
/**
* Check if password matches
*
* @param Password $password
* @param HashedPassword $hashedPassword
* @return boolean
*/
public function check(Password $password, HashedPassword $hashedPassword)
{
return $this->hasher->check($password->toString(), $hashedPassword->toString());
}
示例9: validateCredentials
/**
* Validate a user against the given credentials.
*
* @param \Illuminate\Auth\Authenticatable $user
* @param array $credentials
* @return bool
*/
public function validateCredentials(Authenticatable $user, array $credentials)
{
return $credentials['type'] === 'shibboleth' ? true : $this->hasher->check($credentials['password'], $user->getAuthPassword());
}
开发者ID:PeterMartinez,项目名称:Laravel-Shibboleth-Service-Provider,代码行数:11,代码来源:ShibbolethUserProvider.php