@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Move LDAP config into PHP

Summary: This config section is weak (poorly documented) and inconsistent (keys with "_" instead of "-") but I'm going to keep punting on improving it until after T1536.

Test Plan: Loaded, examined LDAP config.

Reviewers: btrahan, codeblock

Reviewed By: codeblock

CC: aran

Maniphest Tasks: T2255

Differential Revision: https://secure.phabricator.com/D4322

+80 -10
+8 -8
conf/default.conf.php
··· 683 683 'ldap.auth-enabled' => false, 684 684 685 685 // The LDAP server hostname 686 - 'ldap.hostname' => '', 686 + 'ldap.hostname' => null, 687 687 688 688 // The LDAP server port 689 689 'ldap.port' => 389, 690 690 691 691 // The LDAP base domain name 692 - 'ldap.base_dn' => '', 692 + 'ldap.base_dn' => null, 693 693 694 694 // The attribute to be regarded as 'username'. Has to be unique 695 - 'ldap.search_attribute' => '', 695 + 'ldap.search_attribute' => null, 696 696 697 697 // Perform a search to find a user 698 698 // Many LDAP installations do not have the username in the dn, if this is ··· 700 700 'ldap.search-first' => false, 701 701 702 702 // The attribute to search for if you have to search for a user 703 - 'ldap.username-attribute' => '', 703 + 'ldap.username-attribute' => null, 704 704 705 705 // The attribute(s) to be regarded as 'real name'. 706 706 // If more then one attribute is supplied the values of the attributes in ··· 709 709 710 710 // A domain name to use when authenticating against Active Directory 711 711 // (e.g. 'example.com') 712 - 'ldap.activedirectory_domain' => '', 712 + 'ldap.activedirectory_domain' => null, 713 713 714 714 // The LDAP version 715 715 'ldap.version' => 3, ··· 717 717 // LDAP Referrals Option 718 718 // Whether referrals should be followed by the client 719 719 // Should be set to 0 if you use Windows 2003 AD 720 - 'ldap.referrals' => 1, 720 + 'ldap.referrals' => true, 721 721 722 722 // The anonymous user name to use before searching a user. 723 723 // Many LDAP installations require login even before searching a user, set 724 724 // this option to enable it. 725 - 'ldap.anonymous-user-name' => '', 725 + 'ldap.anonymous-user-name' => null, 726 726 727 727 // The password of the LDAP anonymous user. 728 - 'ldap.anonymous-user-password' => '', 728 + 'ldap.anonymous-user-password' => null, 729 729 730 730 731 731 // -- Disqus OAuth ---------------------------------------------------------- //
+1 -1
src/__celerity_resource_map__.php
··· 727 727 ), 728 728 'config-options-css' => 729 729 array( 730 - 'uri' => '/res/c67b0cbf/rsrc/css/application/config/config-options.css', 730 + 'uri' => '/res/6f7f64e8/rsrc/css/application/config/config-options.css', 731 731 'type' => 'css', 732 732 'requires' => 733 733 array(
+2
src/__phutil_library_map__.php
··· 874 874 'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/PhabricatorJavelinLinter.php', 875 875 'PhabricatorJumpNavHandler' => 'applications/search/engine/PhabricatorJumpNavHandler.php', 876 876 'PhabricatorKeyValueDatabaseCache' => 'applications/cache/PhabricatorKeyValueDatabaseCache.php', 877 + 'PhabricatorLDAPConfigOptions' => 'applications/config/option/PhabricatorLDAPConfigOptions.php', 877 878 'PhabricatorLDAPLoginController' => 'applications/auth/controller/PhabricatorLDAPLoginController.php', 878 879 'PhabricatorLDAPProvider' => 'applications/auth/ldap/PhabricatorLDAPProvider.php', 879 880 'PhabricatorLDAPRegistrationController' => 'applications/auth/controller/PhabricatorLDAPRegistrationController.php', ··· 2205 2206 'PhabricatorInlineSummaryView' => 'AphrontView', 2206 2207 'PhabricatorJavelinLinter' => 'ArcanistLinter', 2207 2208 'PhabricatorKeyValueDatabaseCache' => 'PhutilKeyValueCache', 2209 + 'PhabricatorLDAPConfigOptions' => 'PhabricatorApplicationConfigOptions', 2208 2210 'PhabricatorLDAPLoginController' => 'PhabricatorAuthController', 2209 2211 'PhabricatorLDAPRegistrationController' => 'PhabricatorAuthController', 2210 2212 'PhabricatorLDAPUnknownUserException' => 'Exception',
+1 -1
src/applications/config/option/PhabricatorApplicationConfigOptions.php
··· 46 46 if (!is_array($value)) { 47 47 throw new PhabricatorConfigValidationException( 48 48 pht( 49 - "Option '%s' must be a list of strings, but value is not a ". 49 + "Option '%s' must be a list of strings, but value is not ". 50 50 "an array.", 51 51 $option->getKey())); 52 52 }
+68
src/applications/config/option/PhabricatorLDAPConfigOptions.php
··· 1 + <?php 2 + 3 + final class PhabricatorLDAPConfigOptions 4 + extends PhabricatorApplicationConfigOptions { 5 + 6 + public function getName() { 7 + return pht("Integration with LDAP"); 8 + } 9 + 10 + public function getDescription() { 11 + return pht("LDAP authentication and integration options."); 12 + } 13 + 14 + public function getOptions() { 15 + return array( 16 + $this->newOption('ldap.auth-enabled', 'bool', false) 17 + ->setOptions( 18 + array( 19 + pht("Disable LDAP Authentication"), 20 + pht("Enable LDAP Authentication"), 21 + )) 22 + ->setDescription( 23 + pht('Enable LDAP for authentication and registration.')), 24 + $this->newOption('ldap.hostname', 'string', null) 25 + ->setDescription(pht('LDAP server host name.')), 26 + $this->newOption('ldap.port', 'int', 389) 27 + ->setDescription(pht('LDAP server port.')), 28 + $this->newOption('ldap.anonymous-user-name', 'string', null) 29 + ->setDescription( 30 + pht('Username to login to LDAP server with.')), 31 + $this->newOption('ldap.anonymous-user-password', 'string', null) 32 + ->setDescription( 33 + pht('Password to login to LDAP server with.')), 34 + 35 + // TODO: I have only a vague understanding of what these options do; 36 + // improve the documentation here and provide examples. 37 + 38 + $this->newOption('ldap.base_dn', 'string', null) 39 + ->setDescription(pht('LDAP base domain name.')), 40 + $this->newOption('ldap.search_attribute', 'string', null), 41 + $this->newOption('ldap.search-first', 'bool', false) 42 + ->setOptions( 43 + array( 44 + pht("Disabled"), 45 + pht("Enabled"), 46 + )), 47 + $this->newOption('ldap.username-attribute', 'string', null), 48 + $this->newOption('ldap.real_name_attributes', 'list<string>', array()) 49 + ->setDescription( 50 + pht( 51 + "Attribute or attributes to use as the user's real name. If ". 52 + "multiple attributes are provided, they will be joined with ". 53 + "spaces.")), 54 + $this->newOption('ldap.activedirectory_domain', 'string', null), 55 + $this->newOption('ldap.version', 'int', 3), 56 + $this->newOption('ldap.referrals', 'bool', true) 57 + ->setOptions( 58 + array( 59 + pht("Do Not Follow Referrals"), 60 + pht("Follow Referrals"), 61 + )) 62 + ->setDescription( 63 + pht("You may need to disable this if you use Windows 2003 ". 64 + "Active Directory.")), 65 + ); 66 + } 67 + 68 + }