mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch 'hailwood/patch-5' into 3
This commit is contained in:
commit
ee326f6394
@ -102,7 +102,7 @@ class MemberLoginForm extends LoginForm {
|
||||
FormAction::create('dologin', _t('Member.BUTTONLOGIN', "Log in")),
|
||||
LiteralField::create(
|
||||
'forgotPassword',
|
||||
'<p id="ForgotPassword"><a href="Security/lostpassword">'
|
||||
'<p id="ForgotPassword"><a href="' . Security::lost_password_url() . '">'
|
||||
. _t('Member.BUTTONLOSTPASSWORD', "I've lost my password") . '</a></p>'
|
||||
)
|
||||
);
|
||||
|
@ -129,6 +129,15 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
*/
|
||||
private static $logout_url = "Security/logout";
|
||||
|
||||
/**
|
||||
* The default lost password URL
|
||||
*
|
||||
* @config
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $lost_password_url = "Security/lostpassword";
|
||||
|
||||
/**
|
||||
* Get location of word list file
|
||||
*
|
||||
@ -651,9 +660,9 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
* @param string $autoLoginHash The auto login token.
|
||||
*/
|
||||
public static function getPasswordResetLink($member, $autologinToken) {
|
||||
$autologinToken = urldecode($autologinToken);
|
||||
$autologinToken = urldecode($autologinToken);
|
||||
$selfControllerClass = __CLASS__;
|
||||
$selfController = new $selfControllerClass();
|
||||
$selfController = new $selfControllerClass();
|
||||
return $selfController->Link('changepassword') . "?m={$member->ID}&t=$autologinToken";
|
||||
}
|
||||
|
||||
@ -1108,7 +1117,7 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
* @return string
|
||||
*/
|
||||
public static function login_url() {
|
||||
return self::config()->login_url;
|
||||
return Controller::join_links(Director::baseURL(), self::config()->login_url);
|
||||
}
|
||||
|
||||
|
||||
@ -1120,9 +1129,19 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
* @return string
|
||||
*/
|
||||
public static function logout_url() {
|
||||
return self::config()->logout_url;
|
||||
return Controller::join_links(Director::baseURL(), self::config()->logout_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the URL of the logout page.
|
||||
*
|
||||
* To update the logout url use the "Security.logout_url" config setting.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function lost_password_url() {
|
||||
return Controller::join_links(Director::baseURL(), self::config()->lost_password_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines global accessible templates variables.
|
||||
@ -1133,6 +1152,7 @@ class Security extends Controller implements TemplateGlobalProvider {
|
||||
return array(
|
||||
"LoginURL" => "login_url",
|
||||
"LogoutURL" => "logout_url",
|
||||
"LostPasswordURL" => "lost_password_url",
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user