summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin/newuser
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:28:25 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-04-24 13:28:25 -0700
commit4d19e0af572486ff0cd38b365dfc7411a8207837 (patch)
treea95b2febbba5a76dedd3ffc421b8f49d36193fa1 /pinyadmin/sbin/newuser
parentffab3ec34b9fd949a9877d0a19182b58911424da (diff)
downloadpiny-code-4d19e0af572486ff0cd38b365dfc7411a8207837.tar.gz
piny-code-4d19e0af572486ff0cd38b365dfc7411a8207837.zip
Adding new <32 character limit to usernames
Diffstat (limited to 'pinyadmin/sbin/newuser')
-rwxr-xr-xpinyadmin/sbin/newuser8
1 files changed, 4 insertions, 4 deletions
diff --git a/pinyadmin/sbin/newuser b/pinyadmin/sbin/newuser
index 7b864b7..a6bcf4d 100755
--- a/pinyadmin/sbin/newuser
+++ b/pinyadmin/sbin/newuser
@@ -80,8 +80,8 @@ if ( scalar @ARGV == 3 and $ARGV[0] eq "--batch" ) {
next;
};
- 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 ( $username !~ /^[a-zA-Z][a-zA-Z0-9_.-]{0,30}$/ ) {
+ print "Usernames must be less than 32 bytes long, consist only of letters, digits, underscores, periods, and dashes, and must start with a letter. Usernames are case sensitive.\n";
next
};
@@ -119,8 +119,8 @@ if ( scalar @ARGV == 3 and $ARGV[0] eq "--batch" ) {
# 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|iki)-/ ) { print "Username must not begin with git- or iki-!\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 ( $username =~ /^(git|iki)-/ ) { print "Username must not begin with git- or iki-!\n"; exit 3; };
+if ( $username !~ /^[a-zA-Z][a-zA-Z0-9_.-]{0,30}$/ ) { print "Usernames must be less than 32 bytes long, consist only of letters, digits, underscores, periods, and dashes, and must start with a letter. 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.