Do not show warning box when LoginForm was posted

Because there is no easy way to detect failed user login/account
creation, do not show warning box during POST request. This should
do the trick as there shouldn't be possible to display valid
login/usercreate form during POST request.

Bug: T149413
Change-Id: Ieb7a34068aaad99616ad6c43de48f70a6775882e
Depends-On: I6ba28ddaeb0f9af17fa875bd9d1265509db4b927
This commit is contained in:
Piotr Miazga 2017-07-18 00:55:25 +02:00 committed by Pmiazga
parent f7509adfbb
commit f86cfc6fc4

View file

@ -116,7 +116,8 @@ class MinervaHooks {
// if no warning message set.
if (
!$request->getVal( 'warning', null ) &&
!$special->getUser()->isLoggedIn()
!$special->getUser()->isLoggedIn() &&
!$request->wasPosted()
) {
$request->setVal( 'warning', 'mobile-frontend-generic-login-new' );
}