mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-25 16:22:43 +01:00
Warn users about using bin/accountadmin
for first time setup
Summary: The "easy setup" is sort of an exaggeration since it basically just amounts to getting you logged in correctly, but it will probably be more true in the future. Test Plan: Ran `bin/accountadmin` with zero and more than zero accounts. Reviewers: asherkin, btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7678
This commit is contained in:
parent
1b026fa629
commit
e19ad8ab8a
1 changed files with 23 additions and 0 deletions
|
@ -4,6 +4,29 @@
|
|||
$root = dirname(dirname(dirname(__FILE__)));
|
||||
require_once $root.'/scripts/__init_script__.php';
|
||||
|
||||
$table = new PhabricatorUser();
|
||||
$any_user = queryfx_one(
|
||||
$table->establishConnection('r'),
|
||||
'SELECT * FROM %T LIMIT 1',
|
||||
$table->getTableName());
|
||||
$is_first_user = (!$any_user);
|
||||
|
||||
if ($is_first_user) {
|
||||
echo pht(
|
||||
"WARNING\n\n".
|
||||
"You're about to create the first account on this install. Normally, you ".
|
||||
"should use the web interface to create the first account, not this ".
|
||||
"script.\n\n".
|
||||
"If you use the web interface, it will drop you into a nice UI workflow ".
|
||||
"which gives you more help setting up your install. If you create an ".
|
||||
"account with this script instead, you will skip the setup help and you ".
|
||||
"will not be able to access it later.");
|
||||
if (!phutil_console_confirm(pht("Skip easy setup and create account?"))) {
|
||||
echo pht("Cancelled.")."\n";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
echo "Enter a username to create a new account or edit an existing account.";
|
||||
|
||||
$username = phutil_console_prompt("Enter a username:");
|
||||
|
|
Loading…
Reference in a new issue