WPIntell

Source evidence

Password field grey

Create User With Password Multisite · support · 2023-09-04T08:04:00+00:00

complaintsentiment
highseverity
1.0relevance
4replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

6 / 34 rows with source links

17.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

28 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
caterweb unresolved
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. 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 I’m also currently experiencing this issue. I think I’d be happy to contribute a fix if the git repo is available

Comments

4 shown
adamdipardo 2023-09-08T14:59:00+00:00

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.

fruvos 2023-09-12T10:51:00+00:00

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>

luisarieltoledo 2023-09-12T17:29:00+00:00

Same issue here

ericmikkelsenboldium 2023-10-27T18:44:00+00:00

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