@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.

Fix broken references to auth adapters

This was broken in D9999 but somehow didn't fail linting or unit tests.

Auditors: epriestley

+48 -48
+19 -19
resources/sql/patches/20130619.authconf.php
··· 1 1 <?php 2 2 3 3 $config_map = array( 4 - 'PhabricatorAuthProviderLDAP' => array( 4 + 'PhabricatorLDAPAuthProvider' => array( 5 5 'enabled' => 'ldap.auth-enabled', 6 6 'registration' => true, 7 7 'type' => 'ldap', ··· 16 16 'type' => 'disqus', 17 17 'domain' => 'disqus.com', 18 18 ), 19 - 'PhabricatorAuthProviderOAuthFacebook' => array( 19 + 'PhabricatorFacebookAuthProvider' => array( 20 20 'enabled' => 'facebook.auth-enabled', 21 21 'registration' => 'facebook.registration-enabled', 22 22 'permanent' => 'facebook.auth-permanent', ··· 43 43 'type' => 'google', 44 44 'domain' => 'google.com', 45 45 ), 46 - 'PhabricatorAuthProviderPassword' => array( 46 + 'PhabricatorPasswordAuthProvider' => array( 47 47 'enabled' => 'auth.password-auth-enabled', 48 48 'enabled-default' => false, 49 49 'registration' => false, ··· 105 105 } 106 106 107 107 switch ($provider_class) { 108 - case 'PhabricatorAuthProviderOAuthFacebook': 108 + case 'PhabricatorFacebookAuthProvider': 109 109 $config->setProperty( 110 - PhabricatorAuthProviderOAuthFacebook::KEY_REQUIRE_SECURE, 110 + PhabricatorFacebookAuthProvider::KEY_REQUIRE_SECURE, 111 111 (int)PhabricatorEnv::getEnvConfigIfExists( 112 112 'facebook.require-https-auth')); 113 113 break; 114 - case 'PhabricatorAuthProviderLDAP': 114 + case 'PhabricatorLDAPAuthProvider': 115 115 116 116 $ldap_map = array( 117 - PhabricatorAuthProviderLDAP::KEY_HOSTNAME 117 + PhabricatorLDAPAuthProvider::KEY_HOSTNAME 118 118 => 'ldap.hostname', 119 - PhabricatorAuthProviderLDAP::KEY_PORT 119 + PhabricatorLDAPAuthProvider::KEY_PORT 120 120 => 'ldap.port', 121 - PhabricatorAuthProviderLDAP::KEY_DISTINGUISHED_NAME 121 + PhabricatorLDAPAuthProvider::KEY_DISTINGUISHED_NAME 122 122 => 'ldap.base_dn', 123 - PhabricatorAuthProviderLDAP::KEY_SEARCH_ATTRIBUTES 123 + PhabricatorLDAPAuthProvider::KEY_SEARCH_ATTRIBUTES 124 124 => 'ldap.search_attribute', 125 - PhabricatorAuthProviderLDAP::KEY_USERNAME_ATTRIBUTE 125 + PhabricatorLDAPAuthProvider::KEY_USERNAME_ATTRIBUTE 126 126 => 'ldap.username-attribute', 127 - PhabricatorAuthProviderLDAP::KEY_REALNAME_ATTRIBUTES 127 + PhabricatorLDAPAuthProvider::KEY_REALNAME_ATTRIBUTES 128 128 => 'ldap.real_name_attributes', 129 - PhabricatorAuthProviderLDAP::KEY_VERSION 129 + PhabricatorLDAPAuthProvider::KEY_VERSION 130 130 => 'ldap.version', 131 - PhabricatorAuthProviderLDAP::KEY_REFERRALS 131 + PhabricatorLDAPAuthProvider::KEY_REFERRALS 132 132 => 'ldap.referrals', 133 - PhabricatorAuthProviderLDAP::KEY_START_TLS 133 + PhabricatorLDAPAuthProvider::KEY_START_TLS 134 134 => 'ldap.start-tls', 135 - PhabricatorAuthProviderLDAP::KEY_ANONYMOUS_USERNAME 135 + PhabricatorLDAPAuthProvider::KEY_ANONYMOUS_USERNAME 136 136 => 'ldap.anonymous-user-name', 137 - PhabricatorAuthProviderLDAP::KEY_ANONYMOUS_PASSWORD 137 + PhabricatorLDAPAuthProvider::KEY_ANONYMOUS_PASSWORD 138 138 => 'ldap.anonymous-user-password', 139 139 // Update the old "search first" setting to the newer but similar 140 140 // "always search" setting. 141 - PhabricatorAuthProviderLDAP::KEY_ALWAYS_SEARCH 141 + PhabricatorLDAPAuthProvider::KEY_ALWAYS_SEARCH 142 142 => 'ldap.search-first', 143 - PhabricatorAuthProviderLDAP::KEY_ACTIVEDIRECTORY_DOMAIN 143 + PhabricatorLDAPAuthProvider::KEY_ACTIVEDIRECTORY_DOMAIN 144 144 => 'ldap.activedirectory_domain', 145 145 ); 146 146
+1 -1
src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php
··· 109 109 unset($unguarded); 110 110 111 111 $next = '/'; 112 - if (!PhabricatorAuthProviderPassword::getPasswordProvider()) { 112 + if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) { 113 113 $next = '/settings/panel/external/'; 114 114 } else if (PhabricatorEnv::getEnvConfig('account.editable')) { 115 115
+1 -1
src/applications/auth/controller/PhabricatorAuthRegisterController.php
··· 494 494 } 495 495 496 496 private function loadSetupAccount() { 497 - $provider = new PhabricatorAuthProviderPassword(); 497 + $provider = new PhabricatorPasswordAuthProvider(); 498 498 $provider->attachProviderConfig( 499 499 id(new PhabricatorAuthProviderConfig()) 500 500 ->setShouldAllowRegistration(1)
+1 -1
src/applications/auth/controller/PhabricatorEmailLoginController.php
··· 10 10 public function processRequest() { 11 11 $request = $this->getRequest(); 12 12 13 - if (!PhabricatorAuthProviderPassword::getPasswordProvider()) { 13 + if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) { 14 14 return new Aphront400Response(); 15 15 } 16 16
+1 -1
src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
··· 15 15 $console = PhutilConsole::getConsole(); 16 16 $console->getServer()->setEnableLog(true); 17 17 18 - $provider = PhabricatorAuthProviderLDAP::getLDAPProvider(); 18 + $provider = PhabricatorLDAPAuthProvider::getLDAPProvider(); 19 19 if (!$provider) { 20 20 $console->writeOut( 21 21 "%s\n",
+1 -1
src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
··· 101 101 } 102 102 103 103 $provider = $providers[$key]; 104 - if (!($provider instanceof PhabricatorAuthProviderOAuth2)) { 104 + if (!($provider instanceof PhabricatorOAuth2AuthProvider)) { 105 105 $console->writeOut( 106 106 "> %s\n", 107 107 pht('Skipping, provider is not an OAuth2 provider.'));
+1 -1
src/applications/auth/provider/PhabricatorAuthProvider.php
··· 149 149 /** 150 150 * Should we allow the adapter to be marked as "trusted" 151 151 * This is true for all adapters except those that allow the user to type in 152 - * emails (@see PhabricatorAuthProviderPassword) 152 + * emails (@see PhabricatorPasswordAuthProvider) 153 153 */ 154 154 public function shouldAllowEmailTrustConfiguration() { 155 155 return true;
+1 -1
src/applications/auth/provider/PhabricatorJIRAAuthProvider.php
··· 265 265 $providers = self::getAllEnabledProviders(); 266 266 267 267 foreach ($providers as $provider) { 268 - if ($provider instanceof PhabricatorAuthProviderOAuth1JIRA) { 268 + if ($provider instanceof PhabricatorJIRAAuthProvider) { 269 269 return $provider; 270 270 } 271 271 }
+1 -1
src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
··· 465 465 $providers = self::getAllEnabledProviders(); 466 466 467 467 foreach ($providers as $provider) { 468 - if ($provider instanceof PhabricatorAuthProviderLDAP) { 468 + if ($provider instanceof PhabricatorLDAPAuthProvider) { 469 469 return $provider; 470 470 } 471 471 }
+2 -2
src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
··· 104 104 105 105 public function getAdapter() { 106 106 if (!$this->adapter) { 107 - $adapter = new PhutilAuthAdapterEmpty(); 107 + $adapter = new PhutilEmptyAuthAdapter(); 108 108 $adapter->setAdapterType('password'); 109 109 $adapter->setAdapterDomain('self'); 110 110 $this->adapter = $adapter; ··· 330 330 $providers = self::getAllEnabledProviders(); 331 331 332 332 foreach ($providers as $provider) { 333 - if ($provider instanceof PhabricatorAuthProviderPassword) { 333 + if ($provider instanceof PhabricatorPasswordAuthProvider) { 334 334 return $provider; 335 335 } 336 336 }
+4 -4
src/applications/differential/customfield/DifferentialJIRAIssuesField.php
··· 14 14 } 15 15 16 16 public function isFieldEnabled() { 17 - return (bool)PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 17 + return (bool)PhabricatorJIRAAuthProvider::getJIRAProvider(); 18 18 } 19 19 20 20 public function canDisableField() { ··· 66 66 } 67 67 68 68 private function buildDoorkeeperRefs($value) { 69 - $provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 69 + $provider = PhabricatorJIRAAuthProvider::getJIRAProvider(); 70 70 71 71 $refs = array(); 72 72 if ($value) { ··· 97 97 } 98 98 99 99 public function shouldAppearInEditView() { 100 - return PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 100 + return PhabricatorJIRAAuthProvider::getJIRAProvider(); 101 101 } 102 102 103 103 public function shouldAppearInApplicationTransactions() { 104 - return PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 104 + return PhabricatorJIRAAuthProvider::getJIRAProvider(); 105 105 } 106 106 107 107 public function readValueFromRequest(AphrontRequest $request) {
+1 -1
src/applications/doorkeeper/bridge/DoorkeeperBridgeAsana.php
··· 27 27 $id_map = mpull($refs, 'getObjectID', 'getObjectKey'); 28 28 $viewer = $this->getViewer(); 29 29 30 - $provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider(); 30 + $provider = PhabricatorAsanaAuthProvider::getAsanaProvider(); 31 31 if (!$provider) { 32 32 return; 33 33 }
+1 -1
src/applications/doorkeeper/bridge/DoorkeeperBridgeJIRA.php
··· 22 22 $id_map = mpull($refs, 'getObjectID', 'getObjectKey'); 23 23 $viewer = $this->getViewer(); 24 24 25 - $provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 25 + $provider = PhabricatorJIRAAuthProvider::getJIRAProvider(); 26 26 if (!$provider) { 27 27 return; 28 28 }
+1 -1
src/applications/doorkeeper/option/PhabricatorAsanaConfigOptions.php
··· 49 49 50 50 $viewer = $request->getUser(); 51 51 52 - $provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider(); 52 + $provider = PhabricatorAsanaAuthProvider::getAsanaProvider(); 53 53 if (!$provider) { 54 54 return null; 55 55 }
+1 -1
src/applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleJIRA.php
··· 15 15 $match_issue = $matches[2]; 16 16 17 17 // TODO: When we support multiple instances, deal with them here. 18 - $provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 18 + $provider = PhabricatorJIRAAuthProvider::getJIRAProvider(); 19 19 if (!$provider) { 20 20 return $matches[0]; 21 21 }
+2 -2
src/applications/doorkeeper/worker/DoorkeeperFeedWorkerAsana.php
··· 445 445 446 446 private function getProvider() { 447 447 if (!$this->provider) { 448 - $provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider(); 448 + $provider = PhabricatorAsanaAuthProvider::getAsanaProvider(); 449 449 if (!$provider) { 450 450 throw new PhabricatorWorkerPermanentFailureException( 451 451 'No Asana provider configured.'); ··· 515 515 return $phid_map; 516 516 } 517 517 518 - $provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider(); 518 + $provider = PhabricatorAsanaAuthProvider::getAsanaProvider(); 519 519 520 520 $accounts = id(new PhabricatorExternalAccountQuery()) 521 521 ->setViewer(PhabricatorUser::getOmnipotentUser())
+3 -3
src/applications/doorkeeper/worker/DoorkeeperFeedWorkerJIRA.php
··· 16 16 * This worker is enabled when a JIRA authentication provider is active. 17 17 */ 18 18 public function isEnabled() { 19 - return (bool)PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 19 + return (bool)PhabricatorJIRAAuthProvider::getJIRAProvider(); 20 20 } 21 21 22 22 ··· 105 105 /** 106 106 * Get the active JIRA provider. 107 107 * 108 - * @return PhabricatorAuthProviderOAuth1JIRA Active JIRA auth provider. 108 + * @return PhabricatorJIRAAuthProvider Active JIRA auth provider. 109 109 * @task internal 110 110 */ 111 111 private function getProvider() { 112 112 if (!$this->provider) { 113 - $provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider(); 113 + $provider = PhabricatorJIRAAuthProvider::getJIRAProvider(); 114 114 if (!$provider) { 115 115 throw new PhabricatorWorkerPermanentFailureException( 116 116 'No JIRA provider configured.');
+1 -1
src/applications/people/controller/PhabricatorPeopleController.php
··· 18 18 19 19 if ($viewer->getIsAdmin()) { 20 20 $nav->addLabel(pht('User Administration')); 21 - if (PhabricatorAuthProviderLDAP::getLDAPProvider()) { 21 + if (PhabricatorLDAPAuthProvider::getLDAPProvider()) { 22 22 $nav->addFilter('ldap', pht('Import from LDAP')); 23 23 } 24 24
+1 -1
src/applications/people/controller/PhabricatorPeopleLdapController.php
··· 130 130 131 131 $search = $request->getStr('query'); 132 132 133 - $ldap_provider = PhabricatorAuthProviderLDAP::getLDAPProvider(); 133 + $ldap_provider = PhabricatorLDAPAuthProvider::getLDAPProvider(); 134 134 if (!$ldap_provider) { 135 135 throw new Exception('No LDAP provider enabled!'); 136 136 }
+1 -1
src/applications/people/storage/PhabricatorUser.php
··· 550 550 $new_username = $this->getUserName(); 551 551 552 552 $password_instructions = null; 553 - if (PhabricatorAuthProviderPassword::getPasswordProvider()) { 553 + if (PhabricatorPasswordAuthProvider::getPasswordProvider()) { 554 554 $engine = new PhabricatorAuthSessionEngine(); 555 555 $uri = $engine->getOneTimeLoginURI( 556 556 $this,
+1 -1
src/applications/phame/storage/PhamePost.php
··· 124 124 $options = array(); 125 125 126 126 if ($current == 'facebook' || 127 - PhabricatorAuthProviderOAuthFacebook::getFacebookApplicationID()) { 127 + PhabricatorFacebookAuthProvider::getFacebookApplicationID()) { 128 128 $options['facebook'] = 'Facebook'; 129 129 } 130 130 if ($current == 'disqus' ||
+1 -1
src/applications/phame/view/PhamePostView.php
··· 147 147 } 148 148 149 149 private function renderFacebookComments() { 150 - $fb_id = PhabricatorAuthProviderOAuthFacebook::getFacebookApplicationID(); 150 + $fb_id = PhabricatorFacebookAuthProvider::getFacebookApplicationID(); 151 151 if (!$fb_id) { 152 152 return null; 153 153 }
+1 -1
src/applications/settings/panel/PhabricatorSettingsPanelPassword.php
··· 25 25 26 26 // ...or this install doesn't support password authentication at all. 27 27 28 - if (!PhabricatorAuthProviderPassword::getPasswordProvider()) { 28 + if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) { 29 29 return false; 30 30 } 31 31