When only global passwords selected, per-page passwords are still required

Created on 12 July 2024, 5 months ago

Problem/Motivation

When the Allow only global option is selected in the module settings, the form to add a new protected page still shows Password and Confirm Password fields, both of which are required. Entering a password other than the global password in this form works, but only the global password is accepted when trying to access the newly-protected page.

Steps to reproduce

  1. Update the Protected Pages settings to select the Allow only global option and enter a global password.
  2. Save module settings.
  3. Go to the main Protected Pages page and click on + Add Protected Page.
  4. Observe that the form shows a Passwordfield.
  5. Fill out the form using a password that is different than the global password entered in the first step.
  6. Save the new protected page.
  7. Visit the newly-protected page.
  8. Try authenticating with the page-specific password first.
  9. Observe that the password does not work.
  10. Try authenticating with the global password.
  11. Observe that you are allowed access to the protected page.

Proposed resolution

  1. Update the module so that password fields are not required when adding a protected page when the module’s settings are set to accept only the global password.
  2. Update the protected page form to remove the password fields when the module’s settings are set to accept only the global password.
  3. Add a hook so that anytime the module’s settings are updated from Allow only global to Allow per page password (i.e. no global password accepted), any pages previously saved without a password is automatically updated to use the global password.

User interface changes

The for to add a new protected page would change so that the password fields are not present when the module’s settings are set to .

Data model changes

Password protected pages should be able to be saved without a password.

🐛 Bug report
Status

Needs work

Version

1.0

Component

User interface

Created by

🇺🇸United States agarzola

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024