mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
mlanthaler: The introduction of the HTTPResponse object broke some of my code. It's fixed now.
There was also a bug in the Director class: Director::redirectBack() didn't work because it stopped the script before outputting the headers. (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42092 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3cacc11986
commit
e9d323b0d8
@ -54,7 +54,10 @@ class Director {
|
|||||||
|
|
||||||
// Save the updated session back
|
// Save the updated session back
|
||||||
$_SESSION = $controllerObj->getSession()->inst_getAll();
|
$_SESSION = $controllerObj->getSession()->inst_getAll();
|
||||||
|
|
||||||
|
if(isset($_GET['debug_profile'])) Profiler::mark("Outputting to browser");
|
||||||
$response->output();
|
$response->output();
|
||||||
|
if(isset($_GET['debug_profile'])) Profiler::unmark("Outputting to browser");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(isset($_GET['debug_profile'])) Profiler::unmark("Director","direct");
|
if(isset($_GET['debug_profile'])) Profiler::unmark("Director","direct");
|
||||||
@ -336,6 +339,11 @@ class Director {
|
|||||||
|
|
||||||
|
|
||||||
static $siteMode;
|
static $siteMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the site mode (if it is the public site or the cms),
|
||||||
|
* and runs registered modules.
|
||||||
|
*/
|
||||||
static protected $mode_additions;
|
static protected $mode_additions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -345,11 +353,12 @@ class Director {
|
|||||||
static function set_site_mode($mode) {
|
static function set_site_mode($mode) {
|
||||||
Director::$siteMode = $mode;
|
Director::$siteMode = $mode;
|
||||||
|
|
||||||
if(isset(self::$mode_additions[$mode]))
|
if(isset(self::$mode_additions[$mode])) {
|
||||||
foreach(self::$mode_additions[$mode] as $extension) {
|
foreach(self::$mode_additions[$mode] as $extension) {
|
||||||
call_user_func($extension);
|
call_user_func($extension);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
static function get_site_mode() {
|
static function get_site_mode() {
|
||||||
return Director::$siteMode;
|
return Director::$siteMode;
|
||||||
}
|
}
|
||||||
@ -361,10 +370,11 @@ class Director {
|
|||||||
* set by controllers. The callback function will be run at the
|
* set by controllers. The callback function will be run at the
|
||||||
* initialization of the relavant controller.
|
* initialization of the relavant controller.
|
||||||
*/
|
*/
|
||||||
static function extend_site($function, $mode='site') {
|
static function extendSite($function, $mode='site') {
|
||||||
self::$mode_additions[$mode][] = $function;
|
self::$mode_additions[$mode][] = $function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static protected $environment_type;
|
static protected $environment_type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,6 +128,7 @@ class OpenIDAuthenticator extends Authenticator {
|
|||||||
$redirect_url->message);
|
$redirect_url->message);
|
||||||
} else {
|
} else {
|
||||||
Director::redirect($redirect_url);
|
Director::redirect($redirect_url);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -203,6 +204,9 @@ class OpenIDAuthenticator_Controller extends Controller {
|
|||||||
* @param array $requestParams Passed request parameters
|
* @param array $requestParams Passed request parameters
|
||||||
*/
|
*/
|
||||||
function run($requestParams) {
|
function run($requestParams) {
|
||||||
|
Controller::$currentController = $this;
|
||||||
|
$this->response = new HTTPResponse();
|
||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
if(isset($_GET['debug_profile']))
|
if(isset($_GET['debug_profile']))
|
||||||
@ -281,6 +285,8 @@ class OpenIDAuthenticator_Controller extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $this->response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ class Security extends Controller {
|
|||||||
} else {
|
} else {
|
||||||
self::permissionFailure($this,
|
self::permissionFailure($this,
|
||||||
'You must be logged in in order to change your password!');
|
'You must be logged in in order to change your password!');
|
||||||
die();
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user