本文整理汇总了PHP中Authenticator::checkPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Authenticator::checkPassword方法的具体用法?PHP Authenticator::checkPassword怎么用?PHP Authenticator::checkPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authenticator
的用法示例。
在下文中一共展示了Authenticator::checkPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: interact
public function interact()
{
// Fetch the entity, using provided identifiers...
$entity = $this->getEntity();
// ... verify that the password matches
// @todo: handle the other bits of A1, like rehashing and brute force checks
$this->authenticator->checkPassword($this->getRequiredIdentifier('password'), $entity->password);
// ... and return the formatted result.
return $this->formatter->__invoke($entity);
}
示例2: interact
public function interact()
{
// Fetch the entity, using provided identifiers...
$entity = $this->getEntity();
// Rate limit login attempts
$this->rateLimiter->limit($entity);
// ... verify that the password matches
$this->authenticator->checkPassword($this->getRequiredIdentifier('password'), $entity->password);
// ... and return the formatted result.
return $this->formatter->__invoke($entity);
}
示例3: userCredentialsSubmitted
/**
* @param Form $form
*/
public function userCredentialsSubmitted($form)
{
$values = $form->getValues();
$user = $this->userRepo->findById($this->user->id)->fetch();
if (Authenticator::checkPassword($user->password, $values->oldpass)) {
$this->userRepo->setPassword($this->user->id, $values->newpass);
$this->flashMessage('Heslo nastaveno', 'success');
} else {
$this->flashMessage('Staré heslo bylo zadáno nesprávně', 'error');
}
$this->redirect('this');
}