diff --git a/security/MemberLoginForm.php b/security/MemberLoginForm.php index 9f86fd207..9f6fc6e62 100644 --- a/security/MemberLoginForm.php +++ b/security/MemberLoginForm.php @@ -3,12 +3,12 @@ * Log-in form for the "member" authentication method. * * Available extension points: - * - "authenticationFailed": Called when login was not successful. + * - "authenticationFailed": Called when login was not successful. * Arguments: $data containing the form submission - * - "forgotPassword": Called before forgot password logic kicks in, - * allowing extensions to "veto" execution by returning FALSE. + * - "forgotPassword": Called before forgot password logic kicks in, + * allowing extensions to "veto" execution by returning FALSE. * Arguments: $member containing the detected Member record - * + * * @package framework * @subpackage security */ @@ -21,16 +21,16 @@ class MemberLoginForm extends LoginForm { public $loggedInAsField = 'FirstName'; protected $authenticator_class = 'MemberAuthenticator'; - + /** * Since the logout and dologin actions may be conditionally removed, it's necessary to ensure these * remain valid actions regardless of the member login state. * * @var array - * @config + * @config */ private static $allowed_actions = array('dologin', 'logout'); - + /** * Constructor * @@ -59,7 +59,7 @@ class MemberLoginForm extends LoginForm { if(Director::fileExists($customCSS)) { Requirements::css($customCSS); } - + if(isset($_REQUEST['BackURL'])) { $backURL = $_REQUEST['BackURL']; } else { @@ -92,7 +92,7 @@ class MemberLoginForm extends LoginForm { } if(Security::config()->autologin_enabled) { $fields->push(new CheckboxField( - "Remember", + "Remember", _t('Member.REMEMBERME', "Remember me next time?") )); } @@ -124,7 +124,7 @@ class MemberLoginForm extends LoginForm { $js = <<message = _t( - 'Member.LOGGEDINAS', - "You're logged in as {name}.", + 'Member.LOGGEDINAS', + "You're logged in as {name}.", array('name' => $member->{$this->loggedInAsField}) ); } @@ -162,11 +162,11 @@ JS; Session::set('SessionForms.MemberLoginForm.Remember', isset($data['Remember'])); } - if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL']; - else $backURL = null; + if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL']; + else $backURL = null; if($backURL) Session::set('BackURL', $backURL); - + // Show the right tab on failed login $loginLink = Director::absoluteURL($this->controller->Link('login')); if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL); @@ -201,7 +201,7 @@ JS; $cp->sessionMessage('Your password has expired. Please choose a new one.', 'good'); return $this->controller->redirect('Security/changepassword'); } - + // Absolute redirection URLs may cause spoofing if(isset($_REQUEST['BackURL']) && $_REQUEST['BackURL'] && Director::is_site_url($_REQUEST['BackURL']) ) { return $this->controller->redirect($_REQUEST['BackURL']); @@ -312,7 +312,7 @@ JS; _t('Member.ENTEREMAIL', 'Please enter an email address to get a password reset link.'), 'bad' ); - + $this->controller->redirect('Security/lostpassword'); } }