[vhffs-dev] [496] Slightly modified subscribe information check to have a more informative message on username errors .

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 496
Author:   beuss
Date:     2007-02-24 19:47:10 +0000 (Sat, 24 Feb 2007)

Log Message:
-----------
Slightly modified subscribe information check to have a more informative message on username errors.

Modified Paths:
--------------
    branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
    branches/vhffs_4.1/vhffs-panel/subscribe.pl


Modified: branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm
===================================================================
--- branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm	2007-02-24 14:07:51 UTC (rev 495)
+++ branches/vhffs_4.1/vhffs-api/src/Vhffs/User.pm	2007-02-24 19:47:10 UTC (rev 496)
@@ -203,7 +203,7 @@
 
 sub check_username($) {
     my $username = shift;
-    return ( defined($username) && length($username) >= 3 && length($username) <= 12 && ($username =~ /^[a-z0-9]+$/) );
+    return ( defined($username) && ($username =~ /^[a-z0-9]{3,12}$/) );
     
 }
 

Modified: branches/vhffs_4.1/vhffs-panel/subscribe.pl
===================================================================
--- branches/vhffs_4.1/vhffs-panel/subscribe.pl	2007-02-24 14:07:51 UTC (rev 495)
+++ branches/vhffs_4.1/vhffs-panel/subscribe.pl	2007-02-24 19:47:10 UTC (rev 496)
@@ -88,9 +88,9 @@
 	{
 		push(@errors, {error => gettext("You must declare your username")});
 	}
-	if( ( length ( $username ) < 3 ) || ( length ( $username ) > 12 ) )
+	if( ! Vhffs::User::check_username($username) )
 	{
-		push(@errors, {error => gettext("Username must contain between 3 and 12 characters")});
+		push(@errors, {error => gettext('Invalid username, it must contain between 3 and 12 alphanumeric characters, all in lowercase')});
 	}
 	if( ! defined $country )
 	{


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/