diff options
author | Stefan Kangas <skangas@skangas.se> | 2011-03-11 19:04:17 +0100 |
---|---|---|
committer | Stefan Kangas <skangas@skangas.se> | 2011-03-11 19:04:17 +0100 |
commit | f559605cb240edb57d1a0e0338b449e4ca767d51 (patch) | |
tree | 44d8202d276787fec6d2de9a2922854b8b8611bf /fripost-adduser | |
parent | 0dfd0f47ce5942e85aa8b270a4a9e6230339a32a (diff) |
adduser: die if user already exists
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-x | fripost-adduser | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fripost-adduser b/fripost-adduser index e6bc5ab..e4a4298 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -83,7 +83,9 @@ if ($conf->{pretend}) { exit 0; } -## TODO: Make sure the user does not already exist +die "User already exists" + if ($schema->resultset('Mailbox')->search({ + username => $user->{username} })->count); ## Insert user into database my $db_user = $schema->resultset('Mailbox')->new($user); |