BUGFIX Check if $member variable isn't empty before looking for first name in MemberLoginForm

MINOR Coding conventions, inconsistent use of tabs and spaces

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@66318 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2008-11-20 21:05:29 +00:00 committed by Sam Minnee
parent e50b7369b7
commit 55dbe2bf52

View File

@ -115,16 +115,18 @@ class MemberLoginForm extends LoginForm {
Director::redirect('Security/changepassword');
} else if(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
} elseif(isset($_REQUEST['BackURL']) && $backURL = $_REQUEST['BackURL']) {
Session::clear("BackURL");
Director::redirect($backURL);
} else {
$member = Member::currentUser();
$firstname = Convert::raw2xml($member->FirstName);
Session::set("Security.Message.message",
sprintf(_t('Member.WELCOMEBACK', "Welcome Back, %s"), $firstname)
);
Session::set("Security.Message.type", "good");
if($member) {
$firstname = Convert::raw2xml($member->FirstName);
Session::set('Security.Message.message',
sprintf(_t('Member.WELCOMEBACK', "Welcome Back, %s"), $firstname)
);
Session::set("Security.Message.type", "good");
}
Director::redirectBack();
}
} else {