From 55dbe2bf524e85e0e8890ae6e1b924648b3f0d1d Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Thu, 20 Nov 2008 21:05:29 +0000 Subject: [PATCH] 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 --- security/MemberLoginForm.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/security/MemberLoginForm.php b/security/MemberLoginForm.php index bd30b4648..71bdd4c8e 100644 --- a/security/MemberLoginForm.php +++ b/security/MemberLoginForm.php @@ -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 {