mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Bypass BasicAuth when in CLI mode so unit tests can run (regression from r104962) (from r108193)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112715 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
cc15a7935e
commit
2ec9234da6
@ -44,7 +44,7 @@ class BasicAuth {
|
|||||||
* @return Member $member
|
* @return Member $member
|
||||||
*/
|
*/
|
||||||
static function requireLogin($realm, $permissionCode = null, $tryUsingSessionLogin = true) {
|
static function requireLogin($realm, $permissionCode = null, $tryUsingSessionLogin = true) {
|
||||||
if(!Security::database_is_ready()) return true;
|
if(!Security::database_is_ready() || (Director::is_cli() && !SapphireTest::is_running_test())) return true;
|
||||||
|
|
||||||
$member = null;
|
$member = null;
|
||||||
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
|
if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
|
||||||
|
@ -26,7 +26,7 @@ class WebserverRoutingTest extends SapphireTest {
|
|||||||
$info = curl_getinfo($ch);
|
$info = curl_getinfo($ch);
|
||||||
|
|
||||||
$this->assertEquals(curl_error($ch), '');
|
$this->assertEquals(curl_error($ch), '');
|
||||||
$this->assertEquals(trim($response), 'ok');
|
$this->assertTrue(in_array(trim($response), array('ok', _t('BasicAuth.ENTERINFO'))));
|
||||||
|
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user