Try to help users more easily get a default login

This commit is contained in:
Oliver Gorwits
2014-02-02 18:00:18 +00:00
parent dedc7f1867
commit a71a69aca4
2 changed files with 12 additions and 3 deletions

View File

@@ -9,6 +9,7 @@
* [#69] Add search by layers to device search * [#69] Add search by layers to device search
* [#77] Log user access * [#77] Log user access
* Try to help users more easily get a default login
[BUG FIXES] [BUG FIXES]

View File

@@ -100,10 +100,10 @@ $bool = $term->ask_yn(
deploy_db() if $bool; deploy_db() if $bool;
my $users = schema('netdisco')->resultset('User'); my $users = schema('netdisco')->resultset('User');
if ($users->count == 0 and setting('no_auth')) { if ($users->count == 0) {
say ''; say '';
$bool = $term->ask_yn( $bool = $term->ask_yn(
prompt => 'Would you like the default web user to have Admin rights (discover, etc)?', prompt => 'Would you like a default web user with Admin rights (discover, etc)?',
default => 'n', default => 'n',
); );
@@ -113,11 +113,15 @@ if ($users->count == 0 and setting('no_auth')) {
admin => 'true', admin => 'true',
port_control => 'true', port_control => 'true',
}); });
if (not setting('no_auth')) {
say '';
say '*** Done. Please add "no_auth: true" to your ~/environments/deployment.yml file. ***';
}
} }
else { else {
say ''; say '';
$bool = $term->ask_yn( $bool = $term->ask_yn(
prompt => 'Would you like the default web user to have Port Control rights?', prompt => 'Would you like a default web user with Port Control rights?',
default => 'n', default => 'n',
); );
if ($bool) { if ($bool) {
@@ -125,6 +129,10 @@ if ($users->count == 0 and setting('no_auth')) {
username => 'guest', username => 'guest',
port_control => 'true', port_control => 'true',
}); });
if (not setting('no_auth')) {
say '';
say '*** Done. Please add "no_auth: true" to your ~/environments/deployment.yml file. ***';
}
} }
} }
} }