mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Using new "Security.login_url" configuration value
This commit is contained in:
parent
d0585e484a
commit
b15b98345f
@ -302,7 +302,12 @@ class ContentController extends Controller {
|
||||
$surname = Convert::raw2xml($member->Surname);
|
||||
$logInMessage = _t('ContentController.LOGGEDINAS', 'Logged in as') ." {$firstname} {$surname} - <a href=\"Security/logout\">". _t('ContentController.LOGOUT', 'Log out'). "</a>";
|
||||
} else {
|
||||
$logInMessage = _t('ContentController.NOTLOGGEDIN', 'Not logged in') ." - <a href=\"Security/login\">". _t('ContentController.LOGIN', 'Login') ."</a>";
|
||||
$logInMessage = sprintf(
|
||||
'%s - <a href="%s">%s</a>' ,
|
||||
_t('ContentController.NOTLOGGEDIN', 'Not logged in') ,
|
||||
Config::inst()->get('Security', 'login_url'),
|
||||
_t('ContentController.LOGIN', 'Login') ."</a>"
|
||||
);
|
||||
}
|
||||
$viewPageIn = _t('ContentController.VIEWPAGEIN', 'View Page in:');
|
||||
|
||||
|
@ -24,7 +24,10 @@ class ContentControllerPermissionsTest extends FunctionalTest {
|
||||
$response = $this->get('/testpage/?stage=Stage');
|
||||
// should redirect to login
|
||||
$this->assertEquals($response->getStatusCode(), 302, 'Redirects to login page when not logged in for draft stage');
|
||||
$this->assertContains('Security/login', $response->getHeader('Location'));
|
||||
$this->assertContains(
|
||||
Config::inst()->get('Security', 'login_url'),
|
||||
$response->getHeader('Location')
|
||||
);
|
||||
|
||||
$this->logInWithPermission('CMS_ACCESS_CMSMain');
|
||||
|
||||
|
@ -42,7 +42,10 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
||||
// should be prompted for a login
|
||||
$response = $this->get($page->URLSegment . '?stage=Stage');
|
||||
$this->assertEquals($response->getStatusCode(), '302');
|
||||
$this->assertContains('Security/login', $response->getHeader('Location'));
|
||||
$this->assertContains(
|
||||
Config::inst()->get('Security', 'login_url'),
|
||||
$response->getHeader('Location')
|
||||
);
|
||||
|
||||
$this->logInWithPermission('ADMIN');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user