summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpinyadmin/sbin/newuser14
1 files changed, 6 insertions, 8 deletions
diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser
index ac3a51f..f2dabc3 100755
--- a/pinyadmin/sbin/newuser
+++ b/pinyadmin/sbin/newuser
@@ -114,14 +114,12 @@ if ( scalar @ARGV == 3 and $ARGV[0] eq "--batch" ) {
};
# All the correctness checks should be repeated here. There are multiple
-# pathways to get to this point, but only a single path from here on down. We
-# don't need friendly error messages; whatever UI got us to this point *should*
-# have already caught these.
-exit 3 if ( not defined $email or $email eq "" );
-exit 3 if ( not defined $username or $username eq "" );
-exit 3 if ( $username =~ /^(git|ikiwiki)-/ );
-exit 3 if ( $username !~ /^[a-zA-Z0-9_.][a-zA-Z0-9_.-]+$/ );
-exit 3 if ( not defined $password or $password eq "" );
+# pathways to get to this point, but only a single path from here on down.
+if ( not defined $email or $email eq "" ) { print "Email address is undefined!\n"; exit 3; };
+if ( not defined $username or $username eq "" ) { print "Username is undefined!\n"; exit 3; };
+if ( $username =~ /^(git|ikiwiki)-/ ) { print "Username must not begin with git- or ikiwiki-!\n"; exit 3; };
+if ( $username !~ /^[a-zA-Z0-9_.][a-zA-Z0-9_.-]+$/ ) { print "Usernames must consist only of letters, digits, underscores, periods, and dashes, and not start with a dash. Usernames are case sensitive.\n" };
+if ( not defined $password or $password eq "" ) { print "Password is undefined!\n"; exit 3; };
# Here on down is the actual creation code.