Differential D9431 Diff 22523 src/applications/config/option/PhabricatorAuthenticationConfigOptions.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/option/PhabricatorAuthenticationConfigOptions.php
| <?php | <?php | ||||
| final class PhabricatorAuthenticationConfigOptions | final class PhabricatorAuthenticationConfigOptions | ||||
| extends PhabricatorApplicationConfigOptions { | extends PhabricatorApplicationConfigOptions { | ||||
| public function getName() { | public function getName() { | ||||
| return pht("Authentication"); | return pht('Authentication'); | ||||
| } | } | ||||
| public function getDescription() { | public function getDescription() { | ||||
| return pht("Options relating to authentication."); | return pht('Options relating to authentication.'); | ||||
| } | } | ||||
| public function getOptions() { | public function getOptions() { | ||||
| return array( | return array( | ||||
| $this->newOption('auth.require-email-verification', 'bool', false) | $this->newOption('auth.require-email-verification', 'bool', false) | ||||
| ->setBoolOptions( | ->setBoolOptions( | ||||
| array( | array( | ||||
| pht("Require email verification"), | pht('Require email verification'), | ||||
| pht("Don't require email verification") | pht("Don't require email verification") | ||||
| )) | )) | ||||
| ->setSummary( | ->setSummary( | ||||
| pht("Require email verification before a user can log in.")) | pht('Require email verification before a user can log in.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "If true, email addresses must be verified (by clicking a link ". | 'If true, email addresses must be verified (by clicking a link '. | ||||
| "in an email) before a user can login. By default, verification ". | 'in an email) before a user can login. By default, verification '. | ||||
| "is optional unless {{auth.email-domains}} is nonempty.")), | 'is optional unless {{auth.email-domains}} is nonempty.')), | ||||
| $this->newOption('auth.require-approval', 'bool', true) | $this->newOption('auth.require-approval', 'bool', true) | ||||
| ->setBoolOptions( | ->setBoolOptions( | ||||
| array( | array( | ||||
| pht("Require Administrators to Approve Accounts"), | pht('Require Administrators to Approve Accounts'), | ||||
| pht("Don't Require Manual Approval"), | pht("Don't Require Manual Approval"), | ||||
| )) | )) | ||||
| ->setSummary( | ->setSummary( | ||||
| pht("Require administrators to approve new accounts.")) | pht('Require administrators to approve new accounts.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "Newly registered Phabricator accounts can either be placed ". | "Newly registered Phabricator accounts can either be placed ". | ||||
| "into a manual approval queue for administrative review, or ". | "into a manual approval queue for administrative review, or ". | ||||
| "automatically activated immediately. The approval queue is ". | "automatically activated immediately. The approval queue is ". | ||||
| "enabled by default because it gives you greater control over ". | "enabled by default because it gives you greater control over ". | ||||
| "who can register an account and access Phabricator.\n\n". | "who can register an account and access Phabricator.\n\n". | ||||
| "If your install is completely public, or on a VPN, or users can ". | "If your install is completely public, or on a VPN, or users can ". | ||||
| "only register with a trusted provider like LDAP, or you've ". | "only register with a trusted provider like LDAP, or you've ". | ||||
| "otherwise configured Phabricator to prevent unauthorized ". | "otherwise configured Phabricator to prevent unauthorized ". | ||||
| "registration, you can disable the queue to reduce administrative ". | "registration, you can disable the queue to reduce administrative ". | ||||
| "overhead.\n\n". | "overhead.\n\n". | ||||
| "NOTE: Before you disable the queue, make sure ". | "NOTE: Before you disable the queue, make sure ". | ||||
| "{{auth.email-domains}} is configured correctly for your ". | "{{auth.email-domains}} is configured correctly for your ". | ||||
| "install!")), | "install!")), | ||||
| $this->newOption('auth.email-domains', 'list<string>', array()) | $this->newOption('auth.email-domains', 'list<string>', array()) | ||||
| ->setSummary(pht("Only allow registration from particular domains.")) | ->setSummary(pht('Only allow registration from particular domains.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "You can restrict allowed email addresses to certain domains ". | "You can restrict allowed email addresses to certain domains ". | ||||
| "(like `yourcompany.com`) by setting a list of allowed domains ". | "(like `yourcompany.com`) by setting a list of allowed domains ". | ||||
| "here.\n\nUsers will only be allowed to register using email ". | "here.\n\nUsers will only be allowed to register using email ". | ||||
| "addresses at one of the domains, and will only be able to add ". | "addresses at one of the domains, and will only be able to add ". | ||||
| "new email addresses for these domains. If you configure this, ". | "new email addresses for these domains. If you configure this, ". | ||||
| "it implies {{auth.require-email-verification}}.\n\n". | "it implies {{auth.require-email-verification}}.\n\n". | ||||
| "You should omit the `@` from domains. Note that the domain must ". | "You should omit the `@` from domains. Note that the domain must ". | ||||
| "match exactly. If you allow `yourcompany.com`, that permits ". | "match exactly. If you allow `yourcompany.com`, that permits ". | ||||
| "`joe@yourcompany.com` but rejects `joe@mail.yourcompany.com`.")) | "`joe@yourcompany.com` but rejects `joe@mail.yourcompany.com`.")) | ||||
| ->addExample( | ->addExample( | ||||
| "yourcompany.com\nmail.yourcompany.com", | "yourcompany.com\nmail.yourcompany.com", | ||||
| pht('Valid Setting')), | pht('Valid Setting')), | ||||
| $this->newOption('auth.login-message', 'string', null) | $this->newOption('auth.login-message', 'string', null) | ||||
| ->setLocked(true) | ->setLocked(true) | ||||
| ->setSummary(pht("A block of HTML displayed on the login screen.")) | ->setSummary(pht('A block of HTML displayed on the login screen.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "You can provide an arbitrary block of HTML here, which will ". | "You can provide an arbitrary block of HTML here, which will ". | ||||
| "appear on the login screen. Normally, you'd use this to provide ". | "appear on the login screen. Normally, you'd use this to provide ". | ||||
| "login or registration instructions to users.")), | "login or registration instructions to users.")), | ||||
| $this->newOption('account.editable', 'bool', true) | $this->newOption('account.editable', 'bool', true) | ||||
| ->setBoolOptions( | ->setBoolOptions( | ||||
| array( | array( | ||||
| pht("Allow editing"), | pht('Allow editing'), | ||||
| pht("Prevent editing") | pht('Prevent editing') | ||||
| )) | )) | ||||
| ->setSummary( | ->setSummary( | ||||
| pht( | pht( | ||||
| "Determines whether or not basic account information is ". | 'Determines whether or not basic account information is '. | ||||
| "editable.")) | 'editable.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "Is basic account information (email, real name, profile ". | 'Is basic account information (email, real name, profile '. | ||||
| "picture) editable? If you set up Phabricator to automatically ". | 'picture) editable? If you set up Phabricator to automatically '. | ||||
| "synchronize account information from some other authoritative ". | 'synchronize account information from some other authoritative '. | ||||
| "system, you can disable this to ensure information remains ". | 'system, you can disable this to ensure information remains '. | ||||
| "consistent across both systems.")), | 'consistent across both systems.')), | ||||
| $this->newOption('account.minimum-password-length', 'int', 8) | $this->newOption('account.minimum-password-length', 'int', 8) | ||||
| ->setSummary(pht("Minimum password length.")) | ->setSummary(pht('Minimum password length.')) | ||||
| ->setDescription( | ->setDescription( | ||||
| pht( | pht( | ||||
| "When users set or reset a password, it must have at least this ". | 'When users set or reset a password, it must have at least this '. | ||||
| "many characters.")), | 'many characters.')), | ||||
| ); | ); | ||||
| } | } | ||||
| } | } | ||||