1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-22 18:28:47 +02:00
phorge-phorge/src/applications/config/check/PhabricatorSetupCheckFacebook.php
epriestley a8bd1f4998 Move Facebook setup checks to post-install
Summary: Technically we should have these for all the OAuth providers but I don't think anyone really has trouble with them and it can probably be done generically after T1536. Preserve the functionality, at least.

Test Plan: Broke my config, verified warnings appeared.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2228

Differential Revision: https://secure.phabricator.com/D4506
2013-01-19 08:42:15 -08:00

37 lines
1.3 KiB
PHP

<?php
final class PhabricatorSetupCheckFacebook extends PhabricatorSetupCheck {
protected function executeChecks() {
$fb_auth = PhabricatorEnv::getEnvConfig('facebook.auth-enabled');
if (!$fb_auth) {
return;
}
if (!PhabricatorEnv::getEnvConfig('facebook.application-id')) {
$message = pht(
'You have enabled Facebook authentication, but have not provided a '.
'Facebook Application ID. Provide one or disable Facebook '.
'authentication.');
$this->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');
}
}
}