Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | if ($have_user && $have_pass) { | ||||
| pht('Invalid credentials.')); | pht('Invalid credentials.')); | ||||
| } | } | ||||
| } else { | } else { | ||||
| // User hasn't provided credentials, which means we count them as | // User hasn't provided credentials, which means we count them as | ||||
| // being "not logged in". | // being "not logged in". | ||||
| $viewer = new PhabricatorUser(); | $viewer = new PhabricatorUser(); | ||||
| } | } | ||||
| // See T13590. Some pathways, like error handling, may require unusual | |||||
| // access to things like timezone information. These are fine to build | |||||
| // inline; this pathway is not lightweight anyway. | |||||
| $viewer->setAllowInlineCacheGeneration(true); | |||||
| $this->setServiceViewer($viewer); | $this->setServiceViewer($viewer); | ||||
| $allow_public = PhabricatorEnv::getEnvConfig('policy.allow-public'); | $allow_public = PhabricatorEnv::getEnvConfig('policy.allow-public'); | ||||
| $allow_auth = PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth'); | $allow_auth = PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth'); | ||||
| if (!$allow_public) { | if (!$allow_public) { | ||||
| if (!$viewer->isLoggedIn()) { | if (!$viewer->isLoggedIn()) { | ||||
| if ($allow_auth) { | if ($allow_auth) { | ||||
| return new PhabricatorVCSResponse( | return new PhabricatorVCSResponse( | ||||
| ▲ Show 20 Lines • Show All 1,056 Lines • Show Last 20 Lines | |||||