Add getLoginSecurityLevel() support to FormSpecialPage
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 May 2018 18:53:32 +0000 (14:53 -0400)
committerGergő Tisza <tgr.huwiki@gmail.com>
Tue, 5 Jun 2018 21:10:54 +0000 (23:10 +0200)
commitbfc4e41636aca33b943f8522024bd9f8eeac1977
treec25ea19e2d3de308f7b448e259f5a0c8519ed578
parent05e5f781a179110280aa8ddef325796151332262
Add getLoginSecurityLevel() support to FormSpecialPage

The base SpecialPage will handle reauthentication automatically if you
just implement getLoginSecurityLevel() to return an appropriate string.

But it doesn't work with FormSpecialPage, and if you try calling
checkLoginSecurityLevel() manually it'll lose any post data if the
reauth happens when the form is posted.

So this patch has SpecialPage::checkLoginSecurityLevel() preserve post
data across reauth (using logic similar to that in AuthManagerSpecialPage),
and has FormSpecialPage call checkLoginSecurityLevel() in the same
way the base SpecialPage does.

It also fixes the SpecialPage logic to not call
checkLoginSecurityLevel() when the special page doesn't implement
getLoginSecurityLevel(), as was the originally-intended behavior.
Apparently almost nothing actually gets to SpecialPage::execute() or
this would probably have been noticed already.

Change-Id: Ic89dc1b6583aaecd2efe3f5109896148a188c271
RELEASE-NOTES-1.32
includes/specialpage/FormSpecialPage.php
includes/specialpage/SpecialPage.php