Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F81953
D7570.diff
All Users
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D7570.diff
View Options
diff --git a/src/applications/auth/controller/config/PhabricatorAuthEditController.php b/src/applications/auth/controller/config/PhabricatorAuthEditController.php
--- a/src/applications/auth/controller/config/PhabricatorAuthEditController.php
+++ b/src/applications/auth/controller/config/PhabricatorAuthEditController.php
@@ -169,14 +169,35 @@
$cancel_uri = $this->getApplicationURI();
}
- $str_registration = hsprintf(
- '<strong>%s:</strong> %s',
- pht('Allow Registration'),
+ $config_name = 'auth.email-domains';
+ $config_href = '/config/edit/'.$config_name.'/';
+
+ $email_domains = PhabricatorEnv::getEnvConfig($config_name);
+ if ($email_domains) {
+ $registration_warning = pht(
+ "Users will only be able to register with a verified email address ".
+ "at one of the configured [[ %s | %s ]] domains: **%s**",
+ $config_href,
+ $config_name,
+ implode(', ', $email_domains));
+ } else {
+ $registration_warning = pht(
+ "NOTE: Any user who can browse to this install's login page will be ".
+ "able to register a Phabricator account. To restrict who can register ".
+ "an account, configure [[ %s | %s ]].",
+ $config_href,
+ $config_name);
+ }
+
+ $str_registration = array(
+ phutil_tag('strong', array(), pht('Allow Registration:')),
+ ' ',
pht(
'Allow users to register new Phabricator accounts using this '.
'provider. If you disable registration, users can still use this '.
'provider to log in to existing accounts, but will not be able to '.
- 'create new accounts.'));
+ 'create new accounts.'),
+ );
$str_link = hsprintf(
'<strong>%s:</strong> %s',
@@ -229,6 +250,7 @@
1,
$str_registration,
$v_registration))
+ ->appendRemarkupInstructions($registration_warning)
->appendChild(
id(new AphrontFormCheckboxControl())
->addCheckbox(
diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php
--- a/src/applications/auth/controller/config/PhabricatorAuthListController.php
+++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php
@@ -90,9 +90,43 @@
id(new PhabricatorCrumbView())
->setName(pht('Auth Providers')));
+ $config_name = 'auth.email-domains';
+ $config_href = '/config/edit/'.$config_name.'/';
+ $config_link = phutil_tag(
+ 'a',
+ array(
+ 'href' => $config_href,
+ 'target' => '_blank',
+ ),
+ $config_name);
+
+ $warning = new AphrontErrorView();
+
+ $email_domains = PhabricatorEnv::getEnvConfig($config_name);
+ if ($email_domains) {
+ $warning->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
+ $warning->setTitle(pht('Registration is Restricted'));
+ $warning->appendChild(
+ pht(
+ 'Only users with a verified email address at one of the %s domains '.
+ 'will be able to register a Phabricator account: %s',
+ $config_link,
+ phutil_tag('strong', array(), implode(', ', $email_domains))));
+ } else {
+ $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
+ $warning->setTitle(pht('Anyone Can Register an Account'));
+ $warning->appendChild(
+ pht(
+ 'Anyone who can browse to this Phabricator install will be able to '.
+ 'register an account. To restrict who can register an account, '.
+ 'configure %s.',
+ $config_link));
+ }
+
return $this->buildApplicationPage(
array(
$crumbs,
+ $warning,
$list,
),
array(
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/mb/dh/qin75vtzjnkd5n7a
Default Alt Text
D7570.diff (3 KB)
Attached To
Mode
D7570: Clarify registration rules more aggressively when configuring auth
Attached
Detach File
Event Timeline
Log In to Comment