aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-adduser
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem.moulin@fripost.org>2012-04-28 17:51:04 +0200
committerGuilhem Moulin <guilhem.moulin@fripost.org>2012-04-28 17:51:04 +0200
commit21ac651a4d40472515f5f7d0dd0cd7d27682ee50 (patch)
treea6facdc7e832399778bdd6169910530856590a6f /fripost-adduser
parent5dd3d8d080b56d742de3c4b4782cfcde72c3f16f (diff)
wibble
Diffstat (limited to 'fripost-adduser')
-rwxr-xr-xfripost-adduser8
1 files changed, 4 insertions, 4 deletions
diff --git a/fripost-adduser b/fripost-adduser
index 633926e..168b80c 100755
--- a/fripost-adduser
+++ b/fripost-adduser
@@ -193,6 +193,10 @@ my ($domain, $login);
{
+ # Error if the domain is unknown.
+ die "Error: Unknown domain `" .$domain. "'.\n"
+ unless $ldap->domain->search({ domain => $domain })->count;
+
# Ensure that the username doesn't already exist.
die "Error: User `" .$user->{username}. "' already exists.\n"
if $ldap->user->search({ username => $user->{username} })->count;
@@ -206,10 +210,6 @@ my ($domain, $login);
say STDERR ".)";
exit 1;
}
-
- # Warn if the domain is unknown.
- warn "WARN: Unknown domain `" .$domain. "'.\n"
- unless $ldap->domain->search({ domain => $domain })->count;
}