Skip to content

Password confirmation #72

Open
Open

Description

@dubrod

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]]" />

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions