diff --git a/security/ChangePasswordForm.php b/security/ChangePasswordForm.php index 21deb3402..77872cc7b 100644 --- a/security/ChangePasswordForm.php +++ b/security/ChangePasswordForm.php @@ -111,7 +111,7 @@ class ChangePasswordForm extends Form { } else { // Redirect to default location - the login form saying "You are logged in as..." - $redirectURL = HTTP::setGetVar('BackURL', Director::absoluteBaseURL(), Security::Link('login')); + $redirectURL = HTTP::setGetVar('BackURL', Director::absoluteBaseURL(), $this->controller->Link('login')); Director::redirect($redirectURL); } } else { diff --git a/security/MemberLoginForm.php b/security/MemberLoginForm.php index 9675b7c4a..f85263992 100644 --- a/security/MemberLoginForm.php +++ b/security/MemberLoginForm.php @@ -130,14 +130,14 @@ JS if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL']; else $backURL = null; - if($backURL) Session::set('BackURL', $backURL); + if($backURL) Session::set('BackURL', $backURL); if($badLoginURL = Session::get("BadLoginURL")) { $this->controller->redirect($badLoginURL); } else { // Show the right tab on failed login - $loginLink = Director::absoluteURL(Security::Link("login")); - if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL); + $loginLink = Director::absoluteURL($this->controller->Link('login')); + if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL); $this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab'); } } diff --git a/security/PermissionCheckboxSetField.php b/security/PermissionCheckboxSetField.php index db9027068..cad6474a6 100644 --- a/security/PermissionCheckboxSetField.php +++ b/security/PermissionCheckboxSetField.php @@ -281,7 +281,7 @@ class PermissionCheckboxSetField_Readonly extends PermissionCheckboxSetField { protected $readonly = true; - function saveInto($record) { + function saveInto(DataObjectInterface $record) { return false; } } diff --git a/security/Security.php b/security/Security.php index dfa658259..5d69b99ce 100644 --- a/security/Security.php +++ b/security/Security.php @@ -514,7 +514,9 @@ class Security extends Controller { */ public static function getPasswordResetLink($autoLoginHash) { $autoLoginHash = urldecode($autoLoginHash); - return self::Link('changepassword') . "?h=$autoLoginHash"; + $selfControllerClass = __CLASS__; + $selfController = new $selfControllerClass(); + return $selfController->Link('changepassword') . "?h=$autoLoginHash"; } /**