1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-23 02:38:48 +02:00
phorge-phorge/src/applications/config/check/PhabricatorSetupCheckAuth.php
epriestley 32f6c88896 Add first-time-setup registration flow
Summary:
Ref T1536. Currently, when you install Phabricator you're dumped on the login screen and have to consult the documentation to learn about `bin/accountadmin`.

Instead, detect that an install is running first-time setup:

  - It has no configured providers; and
  - it has no user accounts.

We can safely deduce that such an install isn't configured yet, and let the user create an admin account from the web UI.

After they login, we raise a setup issue and lead them to configure authentication.

(This could probably use some UI and copy tweaks.)

Test Plan:
{F46738}

{F46739}

Reviewers: chad, btrahan

Reviewed By: chad

CC: aran

Maniphest Tasks: T1536

Differential Revision: https://secure.phabricator.com/D6228
2013-06-19 16:28:48 -07:00

27 lines
839 B
PHP

<?php
final class PhabricatorSetupCheckAuth extends PhabricatorSetupCheck {
protected function executeChecks() {
$providers = PhabricatorAuthProvider::getAllEnabledProviders();
if (!$providers) {
$message = pht(
'You have not configured any authentication providers yet. You '.
'should add a provider (like username/password, LDAP, or GitHub '.
'OAuth) so users can register and log in. You can add and configure '.
'providers %s.',
phutil_tag(
'a',
array(
'href' => '/auth/',
),
pht('using the "Auth" application')));
$this
->newIssue('auth.noproviders')
->setShortName(pht('No Auth Providers'))
->setName(pht('No Authentication Providers Configured'))
->setMessage($message);
}
}
}