aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-adduser
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-03-11 19:04:17 +0100
committerStefan Kangas <skangas@skangas.se>2011-03-11 19:04:17 +0100
commitf559605cb240edb57d1a0e0338b449e4ca767d51 (patch)
tree44d8202d276787fec6d2de9a2922854b8b8611bf /fripost-adduser
parent0dfd0f47ce5942e85aa8b270a4a9e6230339a32a (diff)
adduser: die if user already exists
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-xfripost-adduser4
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);