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 {
|
else {
|
||||||
// Redirect to default location - the login form saying "You are logged in as..."
|
// 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);
|
Director::redirect($redirectURL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -130,14 +130,14 @@ JS
|
|||||||
if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL'];
|
if(isset($_REQUEST['BackURL'])) $backURL = $_REQUEST['BackURL'];
|
||||||
else $backURL = null;
|
else $backURL = null;
|
||||||
|
|
||||||
if($backURL) Session::set('BackURL', $backURL);
|
if($backURL) Session::set('BackURL', $backURL);
|
||||||
|
|
||||||
if($badLoginURL = Session::get("BadLoginURL")) {
|
if($badLoginURL = Session::get("BadLoginURL")) {
|
||||||
$this->controller->redirect($badLoginURL);
|
$this->controller->redirect($badLoginURL);
|
||||||
} else {
|
} else {
|
||||||
// Show the right tab on failed login
|
// 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);
|
if($backURL) $loginLink .= '?BackURL=' . urlencode($backURL);
|
||||||
$this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab');
|
$this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ class PermissionCheckboxSetField_Readonly extends PermissionCheckboxSetField {
|
|||||||
|
|
||||||
protected $readonly = true;
|
protected $readonly = true;
|
||||||
|
|
||||||
function saveInto($record) {
|
function saveInto(DataObjectInterface $record) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -514,7 +514,9 @@ class Security extends Controller {
|
|||||||
*/
|
*/
|
||||||
public static function getPasswordResetLink($autoLoginHash) {
|
public static function getPasswordResetLink($autoLoginHash) {
|
||||||
$autoLoginHash = urldecode($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