Differential D20645 Diff 49252 src/applications/auth/controller/config/PhabricatorAuthNewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/config/PhabricatorAuthNewController.php
| <?php | <?php | ||||
| final class PhabricatorAuthNewController | final class PhabricatorAuthNewController | ||||
| extends PhabricatorAuthProviderConfigController { | extends PhabricatorAuthProviderConfigController { | ||||
| public function handleRequest(AphrontRequest $request) { | public function handleRequest(AphrontRequest $request) { | ||||
| $this->requireApplicationCapability( | $this->requireApplicationCapability( | ||||
| AuthManageProvidersCapability::CAPABILITY); | AuthManageProvidersCapability::CAPABILITY); | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $cancel_uri = $this->getApplicationURI(); | $cancel_uri = $this->getApplicationURI(); | ||||
| $locked_config_key = 'auth.lock-config'; | |||||
| $is_locked = PhabricatorEnv::getEnvConfig($locked_config_key); | |||||
| if ($is_locked) { | |||||
| $message = pht( | |||||
| 'Authentication provider configuration is locked, and can not be '. | |||||
| 'changed without being unlocked. See the configuration setting %s '. | |||||
| 'for details.', | |||||
| phutil_tag( | |||||
| 'a', | |||||
| array( | |||||
| 'href' => '/config/edit/'.$locked_config_key, | |||||
| ), | |||||
| $locked_config_key)); | |||||
| $dialog = id(new AphrontDialogView()) | |||||
| ->setUser($viewer) | |||||
| ->setMethod('GET') | |||||
| ->setTitle(pht('Authentication Config Locked')) | |||||
| ->appendChild($message) | |||||
| ->addCancelButton($cancel_uri); | |||||
| return id(new AphrontDialogResponse())->setDialog($dialog); | |||||
| } | |||||
| $providers = PhabricatorAuthProvider::getAllBaseProviders(); | $providers = PhabricatorAuthProvider::getAllBaseProviders(); | ||||
| $configured = PhabricatorAuthProvider::getAllProviders(); | $configured = PhabricatorAuthProvider::getAllProviders(); | ||||
| $configured_classes = array(); | $configured_classes = array(); | ||||
| foreach ($configured as $configured_provider) { | foreach ($configured as $configured_provider) { | ||||
| $configured_classes[get_class($configured_provider)] = true; | $configured_classes[get_class($configured_provider)] = true; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines | |||||