mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #3184 from silverstripe-iterators/pulls/conditional-force
Conditionally reset MemberLoginForm.force_message
This commit is contained in:
commit
e7014f4cb5
@ -135,14 +135,20 @@ JS;
|
||||
*/
|
||||
protected function getMessageFromSession() {
|
||||
parent::getMessageFromSession();
|
||||
if(($member = Member::currentUser()) && !Session::get('MemberLoginForm.force_message')) {
|
||||
|
||||
$forceMessage = Session::get('MemberLoginForm.force_message');
|
||||
if(($member = Member::currentUser()) && !$forceMessage) {
|
||||
$this->message = _t(
|
||||
'Member.LOGGEDINAS',
|
||||
"You're logged in as {name}.",
|
||||
array('name' => $member->{$this->loggedInAsField})
|
||||
);
|
||||
}
|
||||
Session::set('MemberLoginForm.force_message', false);
|
||||
|
||||
// Reset forced message
|
||||
if($forceMessage) {
|
||||
Session::set('MemberLoginForm.force_message', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user