Page MenuHomePhabricator

SpecialUserlogin.php only save settings if there is a change in rememberpassword
Closed, InvalidPublic

Description

Author: stronk7

Description:
Hi,

we are using one AuthPlugin extension to provide unified accounts to our mediawiki site. The production server, using Mediawiki 1.5.8 works perfectly (http://docs.moodle.org), but we have found one problem when upgrading to Mediawiki 1.22.2 (http://docs.moodle.org/test):

First time users are properly validated and their information (username, email, real name) is copied perfectly to mediawiki tables.

But, non-first time users don't get this info updated (if they change it in the external DB).

I've been tracing a bit the problem and it seems that, in SpecialUserLogin.php, the processLogin() method only performs one $wgUser->saveSettings(); when there is one change in the "rememberpassword" option. And all the change performed by our AuthPlugin extension, and properly stored in $wgUser aren't saved at all.

Perhaps the $wgUser->saveSettings(); call should be out from the if? To be applied always the login is SUCCESS ?

I've assigned this to the "Special pages" component, because the bug is in one of them (SpecialUserLogin.php). Not sure if I should have used another component. Apologizes!

TIA and ciao, stronk7 :-)


Version: 1.11.x
Severity: normal
URL: http://docs.moodle.org/test

Details

Reference
bz13963

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:12 PM
bzimport set Reference to bz13963.
bzimport added a subscriber: Unknown Object (MLST).

Does it solve the problem if you toss in a $user->saveSettings() in your plugin?

stronk7 wrote:

Hi Brion,

that works. It's, in fact, the hack I've in our updateUser() method.

But it's supposed that both initUser() and updateUser() only have to modify $user and, by reference, be returned to SpecialUserlogin.php and saved from there. At least that's the way it used to work, and the way initUser() continues working now.

Ciao, stronk7 :-)

Can you please test this against MediaWiki 1.13 that was recently released, or even MediaWiki 1.14alpha (SVN HEAD)?

stronk7 wrote:

I've tested this against MediaWiki 1.13 and behaviour continues the same. $wgUser data coming from authentication extension isn't updated at all. It seems that the SpeciaUserlogin->processLogin() function hasn't been changed, so $wgUser->saveSettings() is not executed always.

Ciao :-)

Ammarpad removed a project: TestMe.
Ammarpad subscribed.

AuthPlugin has been superseded by AuthManager. Probably this is no longer valid