• Hi, after recent update (1.10 on 6.3.1 WP Installation) first password field looks disabled in my environment.
    Source code now is:

    <input name="cuwp_pass1" type="password" id="pass1" autocomplete="off" disabled>

    Obviously now is not possible to add new users unless clearing “disabled” from code on inspector window every time needed.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Also experiencing the same issue recently. Seems like some JavaScript is adding the “disabled” attribute to the field, unsure why.

    But I noticed that the hook the plugin uses (“user_new_form”) is called twice, once for the “Add Existing User” form, and once for the “Add New User” form. This means the password fields are being added to the HTML twice, and I think something (WordPress?) is disabling the password field automatically because it detects two password fields with the same ID. Maybe a security thing?

    I can temporarily get around the issue by modifying the plugin code, changing lines 47-48 of cuwp.php to read:

    public function cuwp_plug_pass($type) {
    if ($type != "add-new-user") return; ?>

    This prevents the plugin from outputting the form for the “Add Existing User” form, and this then keeps the password field editable.

    I was experiencing the same issue, but unfortunately @adamdipardo fix didn’t hold. It did re-enable the password field, however when I then typed into the Repeat Password (required) box, it would remove text from the Password (required) input.

    As well as the above fix, I needed a secondary change which was to update the field IDs in cuwp.php to not use the IDs pass1 and pass2. The specific issue was being caused by code in the WP core file user-profile.js – particularly this function

        /*
         * Fix a LastPass mismatch issue, LastPass only changes pass2.
         *
         * This fixes the issue by copying any changes from the hidden
         * pass2 field to the pass1 field, then running check_pass_strength.
         */
        $pass2 = $("#pass2").on("input", function () {
          if ($pass2.val().length > 0) {
            $pass1.val($pass2.val());
            $pass2.val("");
            currentPass = "";
            $pass1.trigger("pwupdate");
          }
        });
    

    This particular change is over 8 years old now, so I’m not sure why it’s suddenly presenting an issue.

    However, by changing the field IDs in cuwp.php to cuwp-pass1 and cuwp-pass2 this resolves the issue and I can successfully register users again.

    <tr class="form-field form-required">
        <th scope="row"><label for="cuwp_pass1"><?php _e('Password', 'create-user-with-password-multisite'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
        <td><input name="cuwp_pass1" type="password" id="cuwp_pass1" autocomplete="off" /><input class="hidden" value=" " /></td>
    </tr>
    
    <tr class="form-field form-required">
        <th scope="row"><label for="cuwp_pass2"><?php _e('Repeat Password', 'create-user-with-password-multisite'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
        <td><input name="cuwp_pass2" type="password" id="cuwp_pass2" autocomplete="off" /></td>
    </tr>

    Same issue here

    ericmikkelsenboldium

    (@ericmikkelsenboldium)

    I’m also currently experiencing this issue. I think I’d be happy to contribute a fix if the git repo is available

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Password field grey’ is closed to new replies.