diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index c6c685e358..292206e3d3 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1205,6 +1205,7 @@ phutil_register_library_map(array( 'PhabricatorSetupCheck' => 'applications/config/check/PhabricatorSetupCheck.php', 'PhabricatorSetupCheckAPC' => 'applications/config/check/PhabricatorSetupCheckAPC.php', 'PhabricatorSetupCheckExtraConfig' => 'applications/config/check/PhabricatorSetupCheckExtraConfig.php', + 'PhabricatorSetupCheckFacebook' => 'applications/config/check/PhabricatorSetupCheckFacebook.php', 'PhabricatorSetupCheckGD' => 'applications/config/check/PhabricatorSetupCheckGD.php', 'PhabricatorSetupCheckInvalidConfig' => 'applications/config/check/PhabricatorSetupCheckInvalidConfig.php', 'PhabricatorSetupCheckMail' => 'applications/config/check/PhabricatorSetupCheckMail.php', @@ -2557,6 +2558,7 @@ phutil_register_library_map(array( 'PhabricatorSettingsPanelSearchPreferences' => 'PhabricatorSettingsPanel', 'PhabricatorSetupCheckAPC' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckExtraConfig' => 'PhabricatorSetupCheck', + 'PhabricatorSetupCheckFacebook' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckGD' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckInvalidConfig' => 'PhabricatorSetupCheck', 'PhabricatorSetupCheckMail' => 'PhabricatorSetupCheck', diff --git a/src/applications/config/check/PhabricatorSetupCheckFacebook.php b/src/applications/config/check/PhabricatorSetupCheckFacebook.php new file mode 100644 index 0000000000..1dc8372020 --- /dev/null +++ b/src/applications/config/check/PhabricatorSetupCheckFacebook.php @@ -0,0 +1,37 @@ +newIssue('config.facebook.application-id') + ->setName(pht("Facebook Application ID Not Set")) + ->setMessage($message) + ->addPhabricatorConfig('facebook.auth-enabled') + ->addPhabricatorConfig('facebook.application-id'); + } + + if (!PhabricatorEnv::getEnvConfig('facebook.application-secret')) { + $message = pht( + 'You have enabled Facebook authentication, but have not provided a '. + 'Facebook Application Secret. Provide one or disable Facebook '. + 'authentication.'); + + $this->newIssue('config.facebook.application-secret') + ->setName(pht("Facebook Application Secret Not Set")) + ->setMessage($message) + ->addPhabricatorConfig('facebook.auth-enabled') + ->addPhabricatorConfig('facebook.application-secret'); + } + } +} diff --git a/src/infrastructure/PhabricatorSetup.php b/src/infrastructure/PhabricatorSetup.php index 322a8cdf2e..43f3149129 100644 --- a/src/infrastructure/PhabricatorSetup.php +++ b/src/infrastructure/PhabricatorSetup.php @@ -360,39 +360,6 @@ final class PhabricatorSetup { self::write("[OKAY] Basic configuration OKAY\n"); - - self::writeHeader('FACEBOOK INTEGRATION'); - $fb_auth = PhabricatorEnv::getEnvConfig('facebook.auth-enabled'); - if (!$fb_auth) { - self::write(" skip 'facebook.auth-enabled' not enabled.\n"); - } else { - self::write(" okay 'facebook.auth-enabled' is enabled.\n"); - $app_id = PhabricatorEnv::getEnvConfig('facebook.application-id'); - $app_secret = PhabricatorEnv::getEnvConfig('facebook.application-secret'); - - if (!$app_id) { - self::writeFailure(); - self::write( - "Setup failure! 'facebook.auth-enabled' is true but there is no ". - "setting for 'facebook.application-id'.\n"); - return; - } else { - self::write(" okay 'facebook.application-id' is set.\n"); - } - - if (!$app_secret) { - self::writeFailure(); - self::write( - "Setup failure! 'facebook.auth-enabled' is true but there is no ". - "setting for 'facebook.application-secret'."); - return; - } else { - self::write(" okay 'facebook.application-secret is set.\n"); - } - - self::write("[OKAY] Facebook integration OKAY\n"); - } - self::writeHeader("MySQL DATABASE & STORAGE CONFIGURATION"); $conf = PhabricatorEnv::newObjectFromConfig('mysql.configuration-provider'); @@ -496,12 +463,6 @@ final class PhabricatorSetup { usleep(20000); } - private static function writeNote($note) { - $note = "*** NOTE: ".wordwrap($note, 75, "\n", true); - $note = "\n".str_replace("\n", "\n ", $note)."\n\n"; - self::write($note); - } - public static function writeHeader($header) { $template = '>>>'.str_repeat('-', 77); $template = substr_replace(