Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password confirmation #72

Open
dubrod opened this issue May 30, 2016 · 0 comments
Open

Password confirmation #72

dubrod opened this issue May 30, 2016 · 0 comments

Comments

@dubrod
Copy link

dubrod commented May 30, 2016

core/components/login/model/login/loginvalidator.class.php

Password Confirmation was not getting the password field value through the "params".
When i did it manually, it worked.

public function password_confirm($key,$value,$param = 'password_confirm') {
        if (empty($value)) return $this->modx->lexicon('register.password_not_confirmed');
        //$confirm = !empty($this->fields[$param]) ? $this->fields[$param] : '';
        $confirm = !empty($this->fields["password"]) ? $this->fields["password"] : '';
        if ($confirm != $value) {
            return $this->_getErrorMessage($key,'vTextPasswordConfirm','register.password_dont_match',array(
                'field' => $key,
                'password' => $value,
                'password_confirm' => $confirm,
            ));
        }
        return true;
    }

the validate code is:

password:required:minLength=^6^,
passwordagain:password_confirm=^password^

HTML:

<label for="password">[[%register.password]] [[!+error.password]]</label>
    <input type="password" name="password" id="password" value="[[+password]]" />

    <label for="passwordagain">Confirm Password [[!+error.passwordagain]]</label>
    <input type="password" name="passwordagain" id="passwordagain" value="[[+passwordagain]]" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant