From 052193ce2da1ac6ac44c3bd9db380cf8b4069aed Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 20 Jun 2013 14:04:20 -0700 Subject: [PATCH] Improve /auth/ behavior when a provider implementation is missing Summary: Ref T1536. This "should never happen", but can if you're developing custom providers. Improve the robustness of this interface in the presence of missing provider implementations. Test Plan: {F47008} Reviewers: chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T1536 Differential Revision: https://secure.phabricator.com/D6253 --- .../config/PhabricatorAuthListController.php | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/applications/auth/controller/config/PhabricatorAuthListController.php b/src/applications/auth/controller/config/PhabricatorAuthListController.php index adcb9ad492..6d3f09d48c 100644 --- a/src/applications/auth/controller/config/PhabricatorAuthListController.php +++ b/src/applications/auth/controller/config/PhabricatorAuthListController.php @@ -25,16 +25,24 @@ final class PhabricatorAuthListController if ($provider) { $name = $provider->getProviderName(); } else { - $name = $config->getProviderType(); + $name = $config->getProviderType().' ('.$config->getProviderClass().')'; } $item - ->setHeader($name) - ->setHref($edit_uri); + ->setHeader($name); - $domain = $provider->getProviderDomain(); - if ($domain !== 'self') { - $item->addAttribute($domain); + if ($provider) { + $item->setHref($edit_uri); + } else { + $item->addAttribute(pht('Provider Implementation Missing!')); + } + + $domain = null; + if ($provider) { + $domain = $provider->getProviderDomain(); + if ($domain !== 'self') { + $item->addAttribute($domain); + } } if ($config->getShouldAllowRegistration()) {