aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-adduser
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-03-12 13:35:19 +0100
committerStefan Kangas <skangas@skangas.se>2011-03-12 13:35:19 +0100
commit2b9012f0d2631a6a6705fbe914f6cb8223d3d2e1 (patch)
treeb5663842d991b68428aaef010a11ef05bf2a6796 /fripost-adduser
parentdf00a5d274e5c06162255ac68b213afe66ec56b0 (diff)
adduser will not echo the password
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-xfripost-adduser19
1 files changed, 4 insertions, 15 deletions
diff --git a/fripost-adduser b/fripost-adduser
index 28141da..15a4447 100755
--- a/fripost-adduser
+++ b/fripost-adduser
@@ -41,26 +41,18 @@ sub read_user_info {
domain => $domain,
maildir => $maildir,
active => $active,
- password => smd5($password),
+ password => $password,
};
print Dumper $user;
- say "Using password $password";
- # Ask the user if the information is OK
- my $confirmed = prompt "Is this OK? ", -yn;
-
- if ($confirmed) {
- return $user;
- } else {
- return undef;
- }
+ return $user;
}
## Get command line options
our $conf = LoadFile('default.yml');
GetOptions(
- 'dbi_dsn' => \$conf->{dbi_dsn},
+ 'dbi_dsn' => \$conf->{dbi_dsn},
'admuser=s' => \$conf->{admuser},
'admpass=s' => \$conf->{admpass},
'pretend' => \$conf->{pretend},
@@ -75,10 +67,7 @@ say "Adding a new virtual user.";
my $user = read_user_info();
-if (!defined $user) {
- say "Aborted by user.";
- exit 1;
-}
+ask_if_ok_or_abort();
if ($conf->{pretend}) {
say "Nothing to do since we are pretending...";