BUGFIX: Fallback for arrays which do not contain 'alreadyLoggedIn' values (from r95968)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102322 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 00:51:21 +00:00
parent 60453176ef
commit 0375eea256

View File

@ -189,8 +189,15 @@ class Security extends Controller {
$response = ($controller) ? $controller->getResponse() : new SS_HTTPResponse();
$response->setStatusCode(403);
//If 'alreadyLoggedIn' is not specified in the array, then use the default
//which should have been specified in the lines above
if(isset($messageSet['alreadyLoggedIn']))
$message=$messageSet['alreadyLoggedIn'];
else
$message=$messageSet['default'];
// Replace %s with the log in link
$body = sprintf($messageSet['alreadyLoggedIn'],
$body = sprintf($message,
Controller::join_links(Director::baseURL(), 'Security/login',
'?BackURL=' . urlencode($_SERVER['REQUEST_URI'])));