Moodle

auth/db should reset email when undeleting users

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Duplicate
  • Affects Version/s: 1.9
  • Fix Version/s: None
  • Component/s: Authentication
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

moodle's delete_user function sets the email address to '' (used to be email || '.disabled') but in auth/db when users are undeleted it doesn't get reset. Not a huge problem as it'll get reset on next login (assuming the field is set to update on login as well as creation) but there could be try to email stuff to them in between account undeletion & email resetting on n ext login.

Issue Links

Activity

Hide
Luke Hudson added a comment -

Linked task is related to same area, and the attached patch only needs a couple of lines of modification to fix this issue. set_user_preferences(...) can be used to store the email address as well as the username.

Show
Luke Hudson added a comment - Linked task is related to same area, and the attached patch only needs a couple of lines of modification to fix this issue. set_user_preferences(...) can be used to store the email address as well as the username.
Hide
Petr Škoda (skodak) added a comment -

I do not like the way we delete users now - it is not proper delete because a lot of data is left in db, also the undelete is often hacky and it does not undo everything.

I always felt that deleting+undeleting of accounts in auth sync scripts is a bit messy and should not use standard delete at all. The patch makes sense in current code, but I think the (un)deletning in auth sync scripts should be completely rewritten in 2.0

Show
Petr Škoda (skodak) added a comment - I do not like the way we delete users now - it is not proper delete because a lot of data is left in db, also the undelete is often hacky and it does not undo everything. I always felt that deleting+undeleting of accounts in auth sync scripts is a bit messy and should not use standard delete at all. The patch makes sense in current code, but I think the (un)deletning in auth sync scripts should be completely rewritten in 2.0

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: