Skip to content

Commit

Permalink
Merge pull request #17 from silverstripe-labs/pulls/basicauth-fix
Browse files Browse the repository at this point in the history
Fix environment check basic auth tests
  • Loading branch information
Damian Mooyman committed Jul 7, 2015
2 parents 98126dc + 631b7ba commit 7e28448
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/EnvironmentChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@ function init($permission = 'ADMIN') {
}

function canAccess($member = null, $permission = "ADMIN") {
if(!$member) $member = Member::currentUser();
if(!$member) {
$member = Member::currentUser();
}

if(!$member) {
$member = BasicAuth::requireLogin('Environment Checker', $permission, false);
}

// We allow access to this controller regardless of live-status or ADMIN permission only
// if on CLI. Access to this controller is always allowed in "dev-mode", or of the user is ADMIN.
Expand Down

0 comments on commit 7e28448

Please sign in to comment.