本文整理汇总了PHP中XLite\Core\Auth::comparePassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Auth::comparePassword方法的具体用法?PHP Auth::comparePassword怎么用?PHP Auth::comparePassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XLite\Core\Auth
的用法示例。
在下文中一共展示了Auth::comparePassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doActionConfirmWithPassword
/**
* Do action
*
* @return void
*/
protected function doActionConfirmWithPassword()
{
$password = \XLite\Core\Request::getInstance()->password;
$result = null !== $password && \XLite\Core\Auth::comparePassword(\XLite\Core\Auth::getInstance()->getProfile()->getPassword(), $password);
if (!$result) {
\XLite\Core\TopMessage::addError('Incorrect password. Please try again.');
}
\XLite\Core\Event::passwordConfirmed(array('result' => $result));
}
示例2: doActionConfirmWithPassword
/**
* Do action
*
* @return void
*/
protected function doActionConfirmWithPassword()
{
$password = \XLite\Core\Request::getInstance()->password;
$result = null !== $password && \XLite\Core\Auth::comparePassword(\XLite\Core\Auth::getInstance()->getProfile()->getPassword(), $password);
if ($result) {
echo 1;
} else {
\XLite\Core\TopMessage::addError('Incorrect password. Please try again.');
echo 0;
}
}
示例3: setModelProperties
/**
* Populate model object properties by the passed data
*
* @param array $data Data to set
*
* @return void
*/
protected function setModelProperties(array $data)
{
$result = !\XLite\Core\Auth::comparePassword(\XLite\Core\Auth::getInstance()->getProfile()->getPassword(), $data['password']);
if (!$result) {
$formFields = $this->getFormFields();
$this->addErrorMessage('password', 'The new password must not coincide with the current password for your account.', $formFields[self::SECTION_MAIN]);
}
parent::setModelProperties($data);
}