Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/storage/PhabricatorAuthProviderConfig.php
| <?php | <?php | ||||
| final class PhabricatorAuthProviderConfig | final class PhabricatorAuthProviderConfig | ||||
| extends PhabricatorAuthDAO | extends PhabricatorAuthDAO | ||||
| implements | implements | ||||
| PhabricatorApplicationTransactionInterface, | PhabricatorApplicationTransactionInterface, | ||||
| PhabricatorPolicyInterface { | PhabricatorPolicyInterface, | ||||
| PhabricatorDestructibleInterface { | |||||
| protected $providerClass; | protected $providerClass; | ||||
| protected $providerType; | protected $providerType; | ||||
| protected $providerDomain; | protected $providerDomain; | ||||
| protected $isEnabled; | protected $isEnabled; | ||||
| protected $shouldAllowLogin = 0; | protected $shouldAllowLogin = 0; | ||||
| protected $shouldAllowRegistration = 0; | protected $shouldAllowRegistration = 0; | ||||
| ▲ Show 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | switch ($capability) { | ||||
| return PhabricatorPolicies::POLICY_ADMIN; | return PhabricatorPolicies::POLICY_ADMIN; | ||||
| } | } | ||||
| } | } | ||||
| public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | public function hasAutomaticCapability($capability, PhabricatorUser $viewer) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* -( PhabricatorDestructibleInterface )----------------------------------- */ | |||||
| public function destroyObjectPermanently( | |||||
| PhabricatorDestructionEngine $engine) { | |||||
| $viewer = $engine->getViewer(); | |||||
| $config_phid = $this->getPHID(); | |||||
| $accounts = id(new PhabricatorExternalAccountQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withProviderConfigPHIDs(array($config_phid)) | |||||
| ->newIterator(); | |||||
| foreach ($accounts as $account) { | |||||
| $engine->destroyObject($account); | |||||
| } | |||||
| $identifiers = id(new PhabricatorExternalAccountIdentifierQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withProviderConfigPHIDs(array($config_phid)) | |||||
| ->newIterator(); | |||||
| foreach ($identifiers as $identifier) { | |||||
| $engine->destroyObject($identifier); | |||||
| } | |||||
| $this->delete(); | |||||
| } | |||||
| } | } | ||||