Last modified: 2014-06-23 16:06:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51641, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49641 - pass user group changes to $wgAuth
pass user group changes to $wgAuth
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.21.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-16 15:32 UTC by Mathias Ertl
Modified: 2014-06-23 16:06 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
patch against 1.21.1 for the new updateExternalDBGroups function (2.29 KB, patch)
2013-06-16 15:32 UTC, Mathias Ertl
Details

Description Mathias Ertl 2013-06-16 15:32:03 UTC
Created attachment 12557 [details]
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! ;-)
Comment 1 Andre Klapper 2013-06-18 01:10:53 UTC
Hi! Thanks for your patch!

You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial

Putting your branch in Git makes it easier to review it quickly.
Thanks again! We appreciate your contribution.
Comment 2 Mathias Ertl 2013-06-23 10:00:44 UTC
Not sure if its still necessary to comment here, but my gerrit change request is here:

https://gerrit.wikimedia.org/r/#/c/70040/

greetings, Mati
Comment 3 Andre Klapper 2013-06-24 04:12:23 UTC
Thanks a lot, Mati! For future reference, adding something like "Bug: 49641" as the last line of the commit message will create an automatic notification in Bugzilla, see http://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines
Comment 4 Mathias Ertl 2013-06-24 09:29:09 UTC
Ok, thanks for the hint. I will improve my commit messages!

greetings, Mati
Comment 5 Mathias Ertl 2013-07-06 22:57:06 UTC
Hi,

Is there anything I can do to improve the patch? Is there any fundamental problem? Or is just everybody out of time? :-)

Feedback is welcome in any case...

greetings, Mati
Comment 6 Andre Klapper 2013-07-08 09:11:39 UTC
I guess https://gerrit.wikimedia.org/r/#/c/70040/ needed some reviewers, so I've added a potential person. 
This seems to be an interesting contribution barrier for a first patch, as you cannot know who might be interested in the area of code covered by your patch (though Gerrit allows subscribing to notifications for patches in certain code areas). So I ended up looking at the history log of the three files that you edited.
Comment 7 Mathias Ertl 2013-08-29 17:26:46 UTC
The patch is already applied upstream.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links