Add getLoginSecurityLevel() support to FormSpecialPage
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 9 May 2018 18:53:32 +0000 (14:53 -0400)
committerReedy <reedy@wikimedia.org>
Wed, 29 May 2019 13:06:38 +0000 (14:06 +0100)
commit63a9098e9cafcbf8bb4bd02f20cf5643c61c2472
tree4146319016588dd81570e6d8a397276844e241ad
parentde69db1e2263bf613a7b5c3d60b2661e776df0e4
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
(cherry picked from commit bfc4e41636aca33b943f8522024bd9f8eeac1977)
RELEASE-NOTES-1.31
includes/specialpage/FormSpecialPage.php
includes/specialpage/SpecialPage.php