mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Use of Link() in security classes now refers to $this->controller
instead of calling the instance method Link statically (which isn't allowed for E_STRICT compliance.)
This commit is contained in:
parent
6b40377a1c
commit
fd3de5158d
@ -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 {
|
||||
|
@ -130,13 +130,13 @@ 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"));
|
||||
$loginLink = Director::absoluteURL($this->controller->Link('login'));
|
||||
if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL);
|
||||
$this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab');
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ class PermissionCheckboxSetField_Readonly extends PermissionCheckboxSetField {
|
||||
|
||||
protected $readonly = true;
|
||||
|
||||
function saveInto($record) {
|
||||
function saveInto(DataObjectInterface $record) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -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";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user