【问题标题】:Error in Reset password joomla 3.0重置密码 joomla 3.0 中的错误
【发布时间】:2013-01-28 08:27:32
【问题描述】:

当我在验证代码 url 为 ../index.php/registration?view=reset&layout=complete 后进入重置页面时,我在 joomla 3.0 中遇到问题。

场景是:在密码中填写不同的值,并符合密码。然后提交表单,报错:

通知 完成重置密码失败:异常 'UnexpectedValueException' 带有消息'您输入的密码确实 不匹配。请在密码栏中输入您想要的密码 并通过在确认密码字段中输入来确认您的输入。 在 /home/fiable/public_html/projects/canvasfast/libraries/joomla/form/form.php:1872 堆栈跟踪:#0 /home/fiable/public_html/projects/canvasfast/libraries/joomla/form/form.php(1105): JForm->validateField(Object(SimpleXMLElement), '', 'dfdefsdfdfdfdf', 对象(JRegistry))#1 /home/fiable/public_html/projects/canvasfast/components/com_users/models/reset.php(122): JForm->验证(数组)#2 /home/fiable/public_html/projects/canvasfast/components/com_users/controllers/reset.php(156): UsersModelReset->processResetComplete(Array) #3 /home/fiable/public_html/projects/canvasfast/libraries/legacy/controller/legacy.php(722): UsersControllerReset->complete() #4 /home/fiable/public_html/projects/canvasfast/components/com_users/users.php(15): JControllerLegacy->execute('complete') #5 /home/fiable/public_html/projects/canvasfast/libraries/legacy/component/helper.php(359): require_once('/home/fiable/pu...') #6 /home/fiable/public_html/projects/canvasfast/libraries/legacy/component/helper.php(339): JComponentHelper::executeComponent('/home/fiable/pu...') #7 /home/fiable/public_html/projects/canvasfast/includes/application.php(205): JComponentHelper::renderComponent('com_users') #8 /home/fiable/public_html/projects/canvasfast/index.php(52): JSite->dispatch() #9 {main}

【问题讨论】:

    标签: passwords reset joomla3.0


    【解决方案1】:

    在 joomla 3.0 中测试转到第 130 行 components\com_users\models\reset.php

    替换下面的代码:

     // Check the validation results.
            if ($return === false) {
                // Get the validation messages from the form.
                foreach ($form->getErrors() as $message) {
                    $this->setError($message);
                }
                return false;
            }
    

    到:

         // Check the validation results.
          if ($return === false) {
       $errors = $form->getErrors();
       for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
        if ($errors[$i] instanceof Exception) {
         $this->setError($errors[$i]->getMessage());
        } else {
         $this->setError($errors[$i]);
        }
       }
    
       return false;
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-11
      • 2017-08-02
      • 2015-08-25
      • 2016-06-15
      • 2013-12-17
      相关资源
      最近更新 更多