diff options
author | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-12-27 14:09:02 -0800 |
---|---|---|
committer | Julian Blake Kongslie <jblake@omgwallhack.org> | 2010-12-27 14:09:02 -0800 |
commit | ef695be134b8046c8b05cfe6c47f8856b7108c77 (patch) | |
tree | 6ba59f558d11f3bcfb8b82da104abae149ee9200 /pinyadmin | |
parent | fadbff800f910475df98af9aac683935ea7175e8 (diff) | |
parent | 3e9915449ee56f3b3c8106cb8b36ceb117d2d242 (diff) | |
download | piny-code-ef695be134b8046c8b05cfe6c47f8856b7108c77.tar.gz piny-code-ef695be134b8046c8b05cfe6c47f8856b7108c77.zip |
Merge branch 'master' of ssh://piny/srv/git/piny-code
Diffstat (limited to 'pinyadmin')
-rwxr-xr-x | pinyadmin/sbin/newuser | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser index c61cdec..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 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. |