Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProvider.php
| Show All 14 Lines | abstract class PhabricatorAuthProvider extends Phobject { | ||||
| public function getProviderConfig() { | public function getProviderConfig() { | ||||
| if ($this->providerConfig === null) { | if ($this->providerConfig === null) { | ||||
| throw new PhutilInvalidStateException('attachProviderConfig'); | throw new PhutilInvalidStateException('attachProviderConfig'); | ||||
| } | } | ||||
| return $this->providerConfig; | return $this->providerConfig; | ||||
| } | } | ||||
| public function getProviderConfigPHID() { | |||||
| return $this->getProviderConfig()->getPHID(); | |||||
| } | |||||
| public function getConfigurationHelp() { | public function getConfigurationHelp() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| public function getDefaultProviderConfig() { | public function getDefaultProviderConfig() { | ||||
| return id(new PhabricatorAuthProviderConfig()) | return id(new PhabricatorAuthProviderConfig()) | ||||
| ->setProviderClass(get_class($this)) | ->setProviderClass(get_class($this)) | ||||
| ->setIsEnabled(1) | ->setIsEnabled(1) | ||||
| ▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | abstract class PhabricatorAuthProvider extends Phobject { | ||||
| public function newDefaultExternalAccount() { | public function newDefaultExternalAccount() { | ||||
| return $this->newExternalAccount(); | return $this->newExternalAccount(); | ||||
| } | } | ||||
| protected function newExternalAccount() { | protected function newExternalAccount() { | ||||
| $config = $this->getProviderConfig(); | $config = $this->getProviderConfig(); | ||||
| $adapter = $this->getAdapter(); | $adapter = $this->getAdapter(); | ||||
| return id(new PhabricatorExternalAccount()) | $account = id(new PhabricatorExternalAccount()) | ||||
| ->setAccountType($adapter->getAdapterType()) | |||||
| ->setAccountDomain($adapter->getAdapterDomain()) | |||||
| ->setProviderConfigPHID($config->getPHID()) | ->setProviderConfigPHID($config->getPHID()) | ||||
| ->attachAccountIdentifiers(array()); | ->attachAccountIdentifiers(array()); | ||||
| // TODO: Remove this when these columns are removed. They no longer have | |||||
| // readers or writers (other than this callsite). | |||||
| $account | |||||
| ->setAccountType($adapter->getAdapterType()) | |||||
| ->setAccountDomain($adapter->getAdapterDomain()); | |||||
| return $account; | |||||
| } | } | ||||
| public function getLoginOrder() { | public function getLoginOrder() { | ||||
| return '500-'.$this->getProviderName(); | return '500-'.$this->getProviderName(); | ||||
| } | } | ||||
| protected function getLoginIcon() { | protected function getLoginIcon() { | ||||
| return 'Generic'; | return 'Generic'; | ||||
| ▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines | |||||