MINOR: Removed use of deprecated Director::redirect* functions.

This commit is contained in:
Sam Minnee 2011-10-29 17:06:19 +13:00
parent 3e3188f81a
commit ff9b9e17af
4 changed files with 14 additions and 18 deletions

View File

@ -493,8 +493,8 @@ JS;
);
$form->sessionMessage($message, 'good');
Director::redirectBack();
$this->controller->redirectBack();
}
}

View File

@ -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();
}
}

View File

@ -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');
}
}

View File

@ -314,7 +314,7 @@ class Security extends Controller {
$member = Member::currentUser();
if($member) $member->logOut();
if($redirect) Director::redirectBack();
if($redirect) $this->redirectBack();
}