Example #1
0
 /**
  * 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));
 }
Example #2
0
 /**
  * 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;
     }
 }
 /**
  * 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);
 }