BUG Fix SS_HTTPResponse being cast as string (#5413)

Fixes #5335
This commit is contained in:
Damian Mooyman 2016-05-02 08:54:19 +12:00 committed by Ingo Schommer
parent 745faebd81
commit 2a5ba397e6

View File

@ -275,9 +275,12 @@ class Security extends Controller implements TemplateGlobalProvider {
$form = $me->LoginForm(); $form = $me->LoginForm();
$form->sessionMessage($message, 'warning'); $form->sessionMessage($message, 'warning');
Session::set('MemberLoginForm.force_message',1); Session::set('MemberLoginForm.force_message',1);
$formText = $me->login(); $loginResponse = $me->login();
if($loginResponse instanceof SS_HTTPResponse) {
return $loginResponse;
}
$response->setBody($formText); $response->setBody((string)$loginResponse);
$controller->extend('permissionDenied', $member); $controller->extend('permissionDenied', $member);
@ -502,7 +505,7 @@ class Security extends Controller implements TemplateGlobalProvider {
* For multiple authenticators, Security_MultiAuthenticatorLogin is used. * For multiple authenticators, Security_MultiAuthenticatorLogin is used.
* See getTemplatesFor and getIncludeTemplate for how to override template logic * See getTemplatesFor and getIncludeTemplate for how to override template logic
* *
* @return string Returns the "login" page as HTML code. * @return string|SS_HTTPResponse Returns the "login" page as HTML code.
*/ */
public function login() { public function login() {
// Check pre-login process // Check pre-login process