Add option to only validate new registrations and address changes, exclude existing addresses (do not block user profile save)

Created on 13 April 2024, 2 months ago
Updated 2 May 2024, about 2 months ago

Problem/Motivation

If an existing user already uses an email provider, that is now blocked by this module, he can't save his user profile anymore.
That shouldn't be the the case by default. It should at least be allowed to opt-out of this by using a setting like "Validate existing accounts", Description: "If enabled, also existing accounts with a disallowed email address will also be validated, when a user saves his user profile and the user is forced to change his email address, otherwise it can not be saved. Changing an email address to a disallowed one will always be disallowed despite this setting."

Default for existing sites (via update hook) Enabled (for BC reasons)
Default for new installations: Disabled (as it's not expected to block an existing account)

Of course, it should also be disallowed for users to change their email address to a disallowed one.

Categorizing this as bug, as it prevents existing user profiles from being saved, which I think is an unexpected side-effect and confusing for existing users.

Steps to reproduce

Create a user account with an email address that will be disallowed by this module
Enable the module
Try to save the user account without changing the email address, for example just to change the user language. It's not possible to save the user profile any more.

Proposed resolution

For existing users, compare the given email address from the form to the current email address. If both are equal, and the new option is disabled,

I'd also be fine to not introduce the new setting and just never validate the email address, if it wasn't changed.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇦🇺Australia darvanen Sydney, Australia

    Raising to Major, I definitely agree this shouldn't be happening by default.

    I'd like existing sites to retain the "wrong" behaviour though rather than changing it for them, perhaps an update hook? I'll make sure the release note has a big note in it.

    I won't get to this tonight, or possibly for a while. MRs welcome.

  • Status changed to Needs work 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia

    Any feedback on these new config settings?

  • 🇦🇺Australia darvanen Sydney, Australia

    LOL wow, uploaded the wrong screenshot, this is the right one:

  • 🇩🇪Germany Anybody Porta Westfalica

    I agree this is major. Asking @Grevil to work on this. We can't use this module until it's fixed, it blocks existing users from editing their accounts. They can not even change their passwords.

  • 🇦🇺Australia darvanen Sydney, Australia

    @Anybody I made an MR, please try grabbing a patch from that? It only needs tests to be committed but feedback on the UI would be gratefully accepted. If @Grevil could sort out tests we'll have a release in no time.

  • First commit to issue fork.
  • Pipeline finished with Failed
    2 months ago
    Total: 139s
    #149135
  • Assigned to Grevil
  • 🇩🇪Germany Grevil

    I think the UI is good! The only point against "checkboxes", would be that we disable the module functionality through unchecking both of these. But I guess, there is a use case hidden in that feature as well! :P

    So yea, LGTM! And code looks good as well! I'll quickly add schema and install file entries, create an update hook, and add / refactor (existing) tests!

  • Pipeline finished with Success
    2 months ago
    Total: 173s
    #149177
  • Pipeline finished with Success
    2 months ago
    #149179
  • Issue was unassigned.
  • Status changed to Needs review 2 months ago
  • 🇩🇪Germany Grevil

    Alright, all finished! Please review!

  • Pipeline finished with Canceled
    2 months ago
    Total: 103s
    #149224
  • Pipeline finished with Success
    2 months ago
    Total: 142s
    #149229
  • Status changed to RTBC 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia

    Wonderful, thank you.

    I've just changed the update hook to set both to true for existing sites so they retain the functionality they already have.

  • Pipeline finished with Skipped
    2 months ago
    #149588
    • darvanen committed 2eca5c05 on 1.x
      Issue #3440590 by Grevil, darvanen, Anybody: Add option to only validate...
  • Status changed to Fixed 2 months ago
  • 🇦🇺Australia darvanen Sydney, Australia
  • 🇦🇺Australia darvanen Sydney, Australia

    Release made, hope that unblocks you :)

    While I was writing it up I realised we needed a follow-up for validation on email change: [#3441666)

  • 🇩🇪Germany Grevil

    Great stuff! Glad I could help! 👍

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024