Differential D25002 Diff 39 src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php
Show All 36 Lines | public function generateGuidance(PhabricatorGuidanceContext $context) { | ||||
$approval_key = 'auth.require-approval'; | $approval_key = 'auth.require-approval'; | ||||
$approval_link = $this->renderConfigLink($approval_key); | $approval_link = $this->renderConfigLink($approval_key); | ||||
$approval_value = PhabricatorEnv::getEnvConfig($approval_key); | $approval_value = PhabricatorEnv::getEnvConfig($approval_key); | ||||
$results = array(); | $results = array(); | ||||
if ($domains_value) { | if ($domains_value) { | ||||
$message = pht( | $message = pht( | ||||
'Phabricator is configured with an email domain whitelist (in %s), so '. | '%s is configured with an email domain whitelist (in %s), so '. | ||||
'only users with a verified email address at one of these %s '. | 'only users with a verified email address at one of these %s '. | ||||
'allowed domain(s) will be able to register an account: %s', | 'allowed domain(s) will be able to register an account: %s', | ||||
PhabricatorPlatformSite::getName(), | |||||
$domains_link, | $domains_link, | ||||
phutil_count($domains_value), | phutil_count($domains_value), | ||||
phutil_tag('strong', array(), implode(', ', $domains_value))); | phutil_tag('strong', array(), implode(', ', $domains_value))); | ||||
$results[] = $this->newGuidance('core.auth.email-domains.on') | $results[] = $this->newGuidance('core.auth.email-domains.on') | ||||
->setMessage($message); | ->setMessage($message); | ||||
} else { | } else { | ||||
$message = pht( | $message = pht( | ||||
'Anyone who can browse to this Phabricator install will be able to '. | 'Anyone who can browse to this %s install will be able to '. | ||||
'register an account. To add email domain restrictions, configure '. | 'register an account. To add email domain restrictions, configure '. | ||||
'%s.', | '%s.', | ||||
PhabricatorPlatformSite::getName(), | |||||
$domains_link); | $domains_link); | ||||
$results[] = $this->newGuidance('core.auth.email-domains.off') | $results[] = $this->newGuidance('core.auth.email-domains.off') | ||||
->setMessage($message); | ->setMessage($message); | ||||
} | } | ||||
if ($approval_value) { | if ($approval_value) { | ||||
$message = pht( | $message = pht( | ||||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0