Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorAuthProvider.php
| Show All 10 Lines | abstract class PhabricatorAuthProvider { | ||||
| public function hasProviderConfig() { | public function hasProviderConfig() { | ||||
| return (bool)$this->providerConfig; | return (bool)$this->providerConfig; | ||||
| } | } | ||||
| public function getProviderConfig() { | public function getProviderConfig() { | ||||
| if ($this->providerConfig === null) { | if ($this->providerConfig === null) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "Call attachProviderConfig() before getProviderConfig()!"); | 'Call attachProviderConfig() before getProviderConfig()!'); | ||||
| } | } | ||||
| return $this->providerConfig; | return $this->providerConfig; | ||||
| } | } | ||||
| public function getConfigurationHelp() { | public function getConfigurationHelp() { | ||||
| return null; | return null; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | abstract class PhabricatorAuthProvider { | ||||
| public function buildRefreshForm( | public function buildRefreshForm( | ||||
| PhabricatorAuthLinkController $controller) { | PhabricatorAuthLinkController $controller) { | ||||
| return $this->renderLoginForm($controller->getRequest(), $mode = 'refresh'); | return $this->renderLoginForm($controller->getRequest(), $mode = 'refresh'); | ||||
| } | } | ||||
| protected function renderLoginForm( | protected function renderLoginForm( | ||||
| AphrontRequest $request, | AphrontRequest $request, | ||||
| $mode) { | $mode) { | ||||
| throw new Exception("Not implemented!"); | throw new Exception('Not implemented!'); | ||||
| } | } | ||||
| public function createProviders() { | public function createProviders() { | ||||
| return array($this); | return array($this); | ||||
| } | } | ||||
| protected function willSaveAccount(PhabricatorExternalAccount $account) { | protected function willSaveAccount(PhabricatorExternalAccount $account) { | ||||
| return; | return; | ||||
| } | } | ||||
| public function willRegisterAccount(PhabricatorExternalAccount $account) { | public function willRegisterAccount(PhabricatorExternalAccount $account) { | ||||
| return; | return; | ||||
| } | } | ||||
| protected function loadOrCreateAccount($account_id) { | protected function loadOrCreateAccount($account_id) { | ||||
| if (!strlen($account_id)) { | if (!strlen($account_id)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "loadOrCreateAccount(...): empty account ID!"); | 'loadOrCreateAccount(...): empty account ID!'); | ||||
| } | } | ||||
| $adapter = $this->getAdapter(); | $adapter = $this->getAdapter(); | ||||
| $adapter_class = get_class($adapter); | $adapter_class = get_class($adapter); | ||||
| if (!strlen($adapter->getAdapterType())) { | if (!strlen($adapter->getAdapterType())) { | ||||
| throw new Exception( | throw new Exception( | ||||
| "AuthAdapter (of class '{$adapter_class}') has an invalid ". | "AuthAdapter (of class '{$adapter_class}') has an invalid ". | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | public function isDefaultRegistrationProvider() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function shouldRequireRegistrationPassword() { | public function shouldRequireRegistrationPassword() { | ||||
| return false; | return false; | ||||
| } | } | ||||
| public function getDefaultExternalAccount() { | public function getDefaultExternalAccount() { | ||||
| throw new Exception("Not implemented!"); | throw new Exception('Not implemented!'); | ||||
| } | } | ||||
| 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 186 Lines • Show Last 20 Lines | |||||