Page MenuHomePhabricator

D20119.id48034.diff
No OneTemporary

D20119.id48034.diff

diff --git a/src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php b/src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php
--- a/src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php
+++ b/src/applications/auth/guidance/PhabricatorAuthProvidersGuidanceEngineExtension.php
@@ -10,6 +10,26 @@
}
public function generateGuidance(PhabricatorGuidanceContext $context) {
+ $configs = id(new PhabricatorAuthProviderConfigQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withIsEnabled(true)
+ ->execute();
+
+ $allows_registration = false;
+ foreach ($configs as $config) {
+ $provider = $config->getProvider();
+ if ($provider->shouldAllowRegistration()) {
+ $allows_registration = true;
+ break;
+ }
+ }
+
+ // If no provider allows registration, we don't need provide any warnings
+ // about registration being too open.
+ if (!$allows_registration) {
+ return array();
+ }
+
$domains_key = 'auth.email-domains';
$domains_link = $this->renderConfigLink($domains_key);
$domains_value = PhabricatorEnv::getEnvConfig($domains_key);

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 5, 11:19 PM (19 m, 27 s ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7717414
Default Alt Text
D20119.id48034.diff (1 KB)

Event Timeline