Author: mati
Description:
patch against 1.21.1 for the new updateExternalDBGroups function
I'm writing an authentication plugin for an authentication system that also manages Groups.
In the attached patch (tested against 1.21.1), I am proposing to pass added/removed groups to the new AuthPlugin::updateExternalDBGroups function. This function is called when adding/removing groups via Special:Userrights or when a user is autopromoted.
The rationale (and usefulness) behind this new function is the same as with AuthPlugin::updateExternalDB being called after User::saveSettings is called in SpecialPreferences:
User::saveSettings as well as User::addGroup and User::removeGroup feature a Hook, but this is not sufficient for a plugin that also synchronizes data *from* the external authentication source:
- I want to save groups *to* the external database when a group is added/removed via the MediaWiki interface
- I want to synchronize groups *from* the external database whenever a user logs in.
The first could be done by implementing the UserAddGroup-Hook in User::addGroup. But then I cannot use this function to save new groups from the external database in the second scenario, because the Hook would of course also be called.
I hope I made my rationale clear and hope to get this function in MediaWiki! ;-)
Version: 1.21.x
Severity: normal
Attached: