aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-01-15 17:19:45 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-01-15 17:19:45 +0000
commit004add5e820c96f2384d1c793041a224f4ae7044 (patch)
treef1d24601833b12c3fa9f8b5a4cf07fb017bb7703
parent8e9d354af15afcb26c1a56b279f9c03f2fbd75ca (diff)
downloadsemanticscuttle-004add5e820c96f2384d1c793041a224f4ae7044.tar.gz
semanticscuttle-004add5e820c96f2384d1c793041a224f4ae7044.tar.bz2
Interface Fix: too short username are forbidden during registration
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@236 b3834d28-1941-0410-a4f8-b48e95affb8f
-rw-r--r--register.php2
-rw-r--r--services/userservice.php4
2 files changed, 4 insertions, 2 deletions
diff --git a/register.php b/register.php
index 9bee1db..bc1196a 100644
--- a/register.php
+++ b/register.php
@@ -49,7 +49,7 @@ if (POST_SUBMITTED != '') {
// Check if username is valid (length, authorized characters)
} elseif (!$userservice->isValidUsername($posteduser)) {
- $tplVars['error'] = T_('This username is not valid (too long, forbidden characters...), please make another choice.');
+ $tplVars['error'] = T_('This username is not valid (too short, too long, forbidden characters...), please make another choice.');
// Check if e-mail address is valid
} elseif (!$userservice->isValidEmail(POST_MAIL)) {
diff --git a/services/userservice.php b/services/userservice.php
index ad79d34..fa0d5c9 100644
--- a/services/userservice.php
+++ b/services/userservice.php
@@ -445,7 +445,9 @@ class UserService {
}
function isValidUsername($username) {
- if (strlen($username) > 24) {
+ if (strlen($username) < 4) {
+ return false;
+ }elseif (strlen($username) > 24) {
// too long usernames are cut by database and may cause bugs when compared
return false;
} elseif (preg_match('/(\W)/', $username) > 0) {