1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Fix broken references to auth adapters

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

Auditors: epriestley
This commit is contained in:
Joshua Spence 2014-07-22 21:18:15 +10:00
parent 701bb2ac6e
commit f4b05312cd
23 changed files with 48 additions and 48 deletions

View file

@ -1,7 +1,7 @@
<?php
$config_map = array(
'PhabricatorAuthProviderLDAP' => array(
'PhabricatorLDAPAuthProvider' => array(
'enabled' => 'ldap.auth-enabled',
'registration' => true,
'type' => 'ldap',
@ -16,7 +16,7 @@ $config_map = array(
'type' => 'disqus',
'domain' => 'disqus.com',
),
'PhabricatorAuthProviderOAuthFacebook' => array(
'PhabricatorFacebookAuthProvider' => array(
'enabled' => 'facebook.auth-enabled',
'registration' => 'facebook.registration-enabled',
'permanent' => 'facebook.auth-permanent',
@ -43,7 +43,7 @@ $config_map = array(
'type' => 'google',
'domain' => 'google.com',
),
'PhabricatorAuthProviderPassword' => array(
'PhabricatorPasswordAuthProvider' => array(
'enabled' => 'auth.password-auth-enabled',
'enabled-default' => false,
'registration' => false,
@ -105,42 +105,42 @@ foreach ($config_map as $provider_class => $spec) {
}
switch ($provider_class) {
case 'PhabricatorAuthProviderOAuthFacebook':
case 'PhabricatorFacebookAuthProvider':
$config->setProperty(
PhabricatorAuthProviderOAuthFacebook::KEY_REQUIRE_SECURE,
PhabricatorFacebookAuthProvider::KEY_REQUIRE_SECURE,
(int)PhabricatorEnv::getEnvConfigIfExists(
'facebook.require-https-auth'));
break;
case 'PhabricatorAuthProviderLDAP':
case 'PhabricatorLDAPAuthProvider':
$ldap_map = array(
PhabricatorAuthProviderLDAP::KEY_HOSTNAME
PhabricatorLDAPAuthProvider::KEY_HOSTNAME
=> 'ldap.hostname',
PhabricatorAuthProviderLDAP::KEY_PORT
PhabricatorLDAPAuthProvider::KEY_PORT
=> 'ldap.port',
PhabricatorAuthProviderLDAP::KEY_DISTINGUISHED_NAME
PhabricatorLDAPAuthProvider::KEY_DISTINGUISHED_NAME
=> 'ldap.base_dn',
PhabricatorAuthProviderLDAP::KEY_SEARCH_ATTRIBUTES
PhabricatorLDAPAuthProvider::KEY_SEARCH_ATTRIBUTES
=> 'ldap.search_attribute',
PhabricatorAuthProviderLDAP::KEY_USERNAME_ATTRIBUTE
PhabricatorLDAPAuthProvider::KEY_USERNAME_ATTRIBUTE
=> 'ldap.username-attribute',
PhabricatorAuthProviderLDAP::KEY_REALNAME_ATTRIBUTES
PhabricatorLDAPAuthProvider::KEY_REALNAME_ATTRIBUTES
=> 'ldap.real_name_attributes',
PhabricatorAuthProviderLDAP::KEY_VERSION
PhabricatorLDAPAuthProvider::KEY_VERSION
=> 'ldap.version',
PhabricatorAuthProviderLDAP::KEY_REFERRALS
PhabricatorLDAPAuthProvider::KEY_REFERRALS
=> 'ldap.referrals',
PhabricatorAuthProviderLDAP::KEY_START_TLS
PhabricatorLDAPAuthProvider::KEY_START_TLS
=> 'ldap.start-tls',
PhabricatorAuthProviderLDAP::KEY_ANONYMOUS_USERNAME
PhabricatorLDAPAuthProvider::KEY_ANONYMOUS_USERNAME
=> 'ldap.anonymous-user-name',
PhabricatorAuthProviderLDAP::KEY_ANONYMOUS_PASSWORD
PhabricatorLDAPAuthProvider::KEY_ANONYMOUS_PASSWORD
=> 'ldap.anonymous-user-password',
// Update the old "search first" setting to the newer but similar
// "always search" setting.
PhabricatorAuthProviderLDAP::KEY_ALWAYS_SEARCH
PhabricatorLDAPAuthProvider::KEY_ALWAYS_SEARCH
=> 'ldap.search-first',
PhabricatorAuthProviderLDAP::KEY_ACTIVEDIRECTORY_DOMAIN
PhabricatorLDAPAuthProvider::KEY_ACTIVEDIRECTORY_DOMAIN
=> 'ldap.activedirectory_domain',
);

View file

@ -109,7 +109,7 @@ final class PhabricatorAuthOneTimeLoginController
unset($unguarded);
$next = '/';
if (!PhabricatorAuthProviderPassword::getPasswordProvider()) {
if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) {
$next = '/settings/panel/external/';
} else if (PhabricatorEnv::getEnvConfig('account.editable')) {

View file

@ -494,7 +494,7 @@ final class PhabricatorAuthRegisterController
}
private function loadSetupAccount() {
$provider = new PhabricatorAuthProviderPassword();
$provider = new PhabricatorPasswordAuthProvider();
$provider->attachProviderConfig(
id(new PhabricatorAuthProviderConfig())
->setShouldAllowRegistration(1)

View file

@ -10,7 +10,7 @@ final class PhabricatorEmailLoginController
public function processRequest() {
$request = $this->getRequest();
if (!PhabricatorAuthProviderPassword::getPasswordProvider()) {
if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) {
return new Aphront400Response();
}

View file

@ -15,7 +15,7 @@ final class PhabricatorAuthManagementLDAPWorkflow
$console = PhutilConsole::getConsole();
$console->getServer()->setEnableLog(true);
$provider = PhabricatorAuthProviderLDAP::getLDAPProvider();
$provider = PhabricatorLDAPAuthProvider::getLDAPProvider();
if (!$provider) {
$console->writeOut(
"%s\n",

View file

@ -101,7 +101,7 @@ final class PhabricatorAuthManagementRefreshWorkflow
}
$provider = $providers[$key];
if (!($provider instanceof PhabricatorAuthProviderOAuth2)) {
if (!($provider instanceof PhabricatorOAuth2AuthProvider)) {
$console->writeOut(
"> %s\n",
pht('Skipping, provider is not an OAuth2 provider.'));

View file

@ -149,7 +149,7 @@ abstract class PhabricatorAuthProvider {
/**
* Should we allow the adapter to be marked as "trusted"
* This is true for all adapters except those that allow the user to type in
* emails (@see PhabricatorAuthProviderPassword)
* emails (@see PhabricatorPasswordAuthProvider)
*/
public function shouldAllowEmailTrustConfiguration() {
return true;

View file

@ -265,7 +265,7 @@ final class PhabricatorJIRAAuthProvider extends PhabricatorOAuth1AuthProvider {
$providers = self::getAllEnabledProviders();
foreach ($providers as $provider) {
if ($provider instanceof PhabricatorAuthProviderOAuth1JIRA) {
if ($provider instanceof PhabricatorJIRAAuthProvider) {
return $provider;
}
}

View file

@ -465,7 +465,7 @@ final class PhabricatorLDAPAuthProvider extends PhabricatorAuthProvider {
$providers = self::getAllEnabledProviders();
foreach ($providers as $provider) {
if ($provider instanceof PhabricatorAuthProviderLDAP) {
if ($provider instanceof PhabricatorLDAPAuthProvider) {
return $provider;
}
}

View file

@ -104,7 +104,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
public function getAdapter() {
if (!$this->adapter) {
$adapter = new PhutilAuthAdapterEmpty();
$adapter = new PhutilEmptyAuthAdapter();
$adapter->setAdapterType('password');
$adapter->setAdapterDomain('self');
$this->adapter = $adapter;
@ -330,7 +330,7 @@ final class PhabricatorPasswordAuthProvider extends PhabricatorAuthProvider {
$providers = self::getAllEnabledProviders();
foreach ($providers as $provider) {
if ($provider instanceof PhabricatorAuthProviderPassword) {
if ($provider instanceof PhabricatorPasswordAuthProvider) {
return $provider;
}
}

View file

@ -14,7 +14,7 @@ final class DifferentialJIRAIssuesField
}
public function isFieldEnabled() {
return (bool)PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
return (bool)PhabricatorJIRAAuthProvider::getJIRAProvider();
}
public function canDisableField() {
@ -66,7 +66,7 @@ final class DifferentialJIRAIssuesField
}
private function buildDoorkeeperRefs($value) {
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$provider = PhabricatorJIRAAuthProvider::getJIRAProvider();
$refs = array();
if ($value) {
@ -97,11 +97,11 @@ final class DifferentialJIRAIssuesField
}
public function shouldAppearInEditView() {
return PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
return PhabricatorJIRAAuthProvider::getJIRAProvider();
}
public function shouldAppearInApplicationTransactions() {
return PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
return PhabricatorJIRAAuthProvider::getJIRAProvider();
}
public function readValueFromRequest(AphrontRequest $request) {

View file

@ -27,7 +27,7 @@ final class DoorkeeperBridgeAsana extends DoorkeeperBridge {
$id_map = mpull($refs, 'getObjectID', 'getObjectKey');
$viewer = $this->getViewer();
$provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider();
$provider = PhabricatorAsanaAuthProvider::getAsanaProvider();
if (!$provider) {
return;
}

View file

@ -22,7 +22,7 @@ final class DoorkeeperBridgeJIRA extends DoorkeeperBridge {
$id_map = mpull($refs, 'getObjectID', 'getObjectKey');
$viewer = $this->getViewer();
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$provider = PhabricatorJIRAAuthProvider::getJIRAProvider();
if (!$provider) {
return;
}

View file

@ -49,7 +49,7 @@ final class PhabricatorAsanaConfigOptions
$viewer = $request->getUser();
$provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider();
$provider = PhabricatorAsanaAuthProvider::getAsanaProvider();
if (!$provider) {
return null;
}

View file

@ -15,7 +15,7 @@ final class DoorkeeperRemarkupRuleJIRA
$match_issue = $matches[2];
// TODO: When we support multiple instances, deal with them here.
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$provider = PhabricatorJIRAAuthProvider::getJIRAProvider();
if (!$provider) {
return $matches[0];
}

View file

@ -445,7 +445,7 @@ final class DoorkeeperFeedWorkerAsana extends DoorkeeperFeedWorker {
private function getProvider() {
if (!$this->provider) {
$provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider();
$provider = PhabricatorAsanaAuthProvider::getAsanaProvider();
if (!$provider) {
throw new PhabricatorWorkerPermanentFailureException(
'No Asana provider configured.');
@ -515,7 +515,7 @@ final class DoorkeeperFeedWorkerAsana extends DoorkeeperFeedWorker {
return $phid_map;
}
$provider = PhabricatorAuthProviderOAuthAsana::getAsanaProvider();
$provider = PhabricatorAsanaAuthProvider::getAsanaProvider();
$accounts = id(new PhabricatorExternalAccountQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())

View file

@ -16,7 +16,7 @@ final class DoorkeeperFeedWorkerJIRA extends DoorkeeperFeedWorker {
* This worker is enabled when a JIRA authentication provider is active.
*/
public function isEnabled() {
return (bool)PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
return (bool)PhabricatorJIRAAuthProvider::getJIRAProvider();
}
@ -105,12 +105,12 @@ final class DoorkeeperFeedWorkerJIRA extends DoorkeeperFeedWorker {
/**
* Get the active JIRA provider.
*
* @return PhabricatorAuthProviderOAuth1JIRA Active JIRA auth provider.
* @return PhabricatorJIRAAuthProvider Active JIRA auth provider.
* @task internal
*/
private function getProvider() {
if (!$this->provider) {
$provider = PhabricatorAuthProviderOAuth1JIRA::getJIRAProvider();
$provider = PhabricatorJIRAAuthProvider::getJIRAProvider();
if (!$provider) {
throw new PhabricatorWorkerPermanentFailureException(
'No JIRA provider configured.');

View file

@ -18,7 +18,7 @@ abstract class PhabricatorPeopleController extends PhabricatorController {
if ($viewer->getIsAdmin()) {
$nav->addLabel(pht('User Administration'));
if (PhabricatorAuthProviderLDAP::getLDAPProvider()) {
if (PhabricatorLDAPAuthProvider::getLDAPProvider()) {
$nav->addFilter('ldap', pht('Import from LDAP'));
}

View file

@ -130,7 +130,7 @@ final class PhabricatorPeopleLdapController
$search = $request->getStr('query');
$ldap_provider = PhabricatorAuthProviderLDAP::getLDAPProvider();
$ldap_provider = PhabricatorLDAPAuthProvider::getLDAPProvider();
if (!$ldap_provider) {
throw new Exception('No LDAP provider enabled!');
}

View file

@ -550,7 +550,7 @@ EOBODY;
$new_username = $this->getUserName();
$password_instructions = null;
if (PhabricatorAuthProviderPassword::getPasswordProvider()) {
if (PhabricatorPasswordAuthProvider::getPasswordProvider()) {
$engine = new PhabricatorAuthSessionEngine();
$uri = $engine->getOneTimeLoginURI(
$this,

View file

@ -124,7 +124,7 @@ final class PhamePost extends PhameDAO
$options = array();
if ($current == 'facebook' ||
PhabricatorAuthProviderOAuthFacebook::getFacebookApplicationID()) {
PhabricatorFacebookAuthProvider::getFacebookApplicationID()) {
$options['facebook'] = 'Facebook';
}
if ($current == 'disqus' ||

View file

@ -147,7 +147,7 @@ final class PhamePostView extends AphrontView {
}
private function renderFacebookComments() {
$fb_id = PhabricatorAuthProviderOAuthFacebook::getFacebookApplicationID();
$fb_id = PhabricatorFacebookAuthProvider::getFacebookApplicationID();
if (!$fb_id) {
return null;
}

View file

@ -25,7 +25,7 @@ final class PhabricatorSettingsPanelPassword
// ...or this install doesn't support password authentication at all.
if (!PhabricatorAuthProviderPassword::getPasswordProvider()) {
if (!PhabricatorPasswordAuthProvider::getPasswordProvider()) {
return false;
}