mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
avoid CMS coupling
In the current setup, we cannot use a custom security controller without the cms module. This changes allow setting another controller as "page_class".
This commit is contained in:
parent
0da15f0f27
commit
2007a6fed6
@ -579,8 +579,13 @@ class Security extends Controller implements TemplateGlobalProvider
|
|||||||
$holderPage->URLSegment = 'Security';
|
$holderPage->URLSegment = 'Security';
|
||||||
// Disable ID-based caching of the log-in page by making it a random number
|
// Disable ID-based caching of the log-in page by making it a random number
|
||||||
$holderPage->ID = -1 * random_int(1, 10000000);
|
$holderPage->ID = -1 * random_int(1, 10000000);
|
||||||
|
|
||||||
|
if ($holderPage instanceof Controller) {
|
||||||
|
$controller = $holderPage;
|
||||||
|
} else {
|
||||||
|
$controller = ModelAsController::controller_for($holderPage);
|
||||||
|
}
|
||||||
|
|
||||||
$controller = ModelAsController::controller_for($holderPage);
|
|
||||||
$controller->setRequest($this->getRequest());
|
$controller->setRequest($this->getRequest());
|
||||||
$controller->doInit();
|
$controller->doInit();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user