Show better error for anons on Special:EmailUser
authorEddie Greiner-Petter <git@eddie-sh.de>
Mon, 13 Mar 2017 17:33:35 +0000 (18:33 +0100)
committerEddieGP <wikimedia.org@eddie-sh.de>
Thu, 16 Mar 2017 13:22:51 +0000 (13:22 +0000)
commit274bddfb575ebfd1f0d4e7ac59dcc7a34b02ae52
treefc07cd0c1129448d8d61954e0be5063d52caad92
parent1e4fdfb825ff96f5d6356b2a50a9532eeeba05ba
Show better error for anons on Special:EmailUser

When a anon user visits Special:EmailUser, the PermissionError message
is shown (as only members of the group "user" (all logged in users) are
allowed to do this). There is a better error message, which tells "You
must be logged in and have a valid email adress in your preferences."
available, but was only shown to users who are logged in but did not
have a valid mail adress in their settings, because the check for the
permission "emailuser" happened before the check for the valid mail
(which returns false for anon users). Exchanging the order of those
makes the right error message appear.

Bug: T160309
Change-Id: I26175df1f7577937d9781950058ca458984ce2cb
includes/specials/SpecialEmailuser.php