mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Removed use of deprecated Director::redirect* functions.
This commit is contained in:
parent
3e3188f81a
commit
ff9b9e17af
@ -494,7 +494,7 @@ JS;
|
||||
|
||||
$form->sessionMessage($message, 'good');
|
||||
|
||||
Director::redirectBack();
|
||||
$this->controller->redirectBack();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -316,11 +316,11 @@ class Form extends RequestHandler {
|
||||
if(Director::is_site_url($pageURL)) {
|
||||
// Remove existing pragmas
|
||||
$pageURL = preg_replace('/(#.*)/', '', $pageURL);
|
||||
return Director::redirect($pageURL . '#' . $this->FormName());
|
||||
return $this->controller->redirect($pageURL . '#' . $this->FormName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return Director::redirectBack();
|
||||
return $this->controller->redirectBack();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,12 +136,12 @@ JS
|
||||
if($backURL) Session::set('BackURL', $backURL);
|
||||
|
||||
if($badLoginURL = Session::get("BadLoginURL")) {
|
||||
Director::redirect($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);
|
||||
Director::redirect($loginLink . '#' . $this->FormName() .'_tab');
|
||||
$this->controller->redirect($loginLink . '#' . $this->FormName() .'_tab');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -171,26 +171,22 @@ JS
|
||||
}
|
||||
$cp = new ChangePasswordForm($this->controller, 'ChangePasswordForm');
|
||||
$cp->sessionMessage('Your password has expired. Please choose a new one.', 'good');
|
||||
Director::redirect('Security/changepassword');
|
||||
return;
|
||||
return $this->controller->redirect('Security/changepassword');
|
||||
}
|
||||
|
||||
// Absolute redirection URLs may cause spoofing
|
||||
if(isset($_REQUEST['BackURL']) && $_REQUEST['BackURL'] && Director::is_site_url($_REQUEST['BackURL']) ) {
|
||||
Director::redirect($_REQUEST['BackURL']);
|
||||
return;
|
||||
return $this->controller->redirect($_REQUEST['BackURL']);
|
||||
}
|
||||
|
||||
// Spoofing attack, redirect to homepage instead of spoofing url
|
||||
if(isset($_REQUEST['BackURL']) && $_REQUEST['BackURL'] && !Director::is_site_url($_REQUEST['BackURL'])) {
|
||||
Director::redirect(Director::absoluteBaseURL());
|
||||
return;
|
||||
return $this->controller->redirect(Director::absoluteBaseURL());
|
||||
}
|
||||
|
||||
// If a default login dest has been set, redirect to that.
|
||||
if (Security::default_login_dest()) {
|
||||
Director::redirect(Director::absoluteBaseURL() . Security::default_login_dest());
|
||||
return;
|
||||
return $this->controller->redirect(Director::absoluteBaseURL() . Security::default_login_dest());
|
||||
}
|
||||
|
||||
// Redirect the user to the page where he came from
|
||||
@ -268,18 +264,18 @@ JS
|
||||
)
|
||||
);
|
||||
|
||||
Director::redirect('Security/passwordsent/' . urlencode($data['Email']));
|
||||
$this->controller->redirect('Security/passwordsent/' . urlencode($data['Email']));
|
||||
} elseif($data['Email']) {
|
||||
// Avoid information disclosure by displaying the same status,
|
||||
// regardless wether the email address actually exists
|
||||
Director::redirect('Security/passwordsent/' . urlencode($data['Email']));
|
||||
$this->controller->redirect('Security/passwordsent/' . urlencode($data['Email']));
|
||||
} else {
|
||||
$this->sessionMessage(
|
||||
_t('Member.ENTEREMAIL', 'Please enter an email address to get a password reset link.'),
|
||||
'bad'
|
||||
);
|
||||
|
||||
Director::redirect('Security/lostpassword');
|
||||
$this->controller->redirect('Security/lostpassword');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -314,7 +314,7 @@ class Security extends Controller {
|
||||
$member = Member::currentUser();
|
||||
if($member) $member->logOut();
|
||||
|
||||
if($redirect) Director::redirectBack();
|
||||
if($redirect) $this->redirectBack();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user