xoops forums

xsell

Quite a regular
Posted on: 2008/9/28 0:09
xsell
xsell (Show more)
Quite a regular
Posts: 242
Since: 2008/9/2 1
#1

Register New Name with space?

Hello

How do you Sign up new Name with Space between parts , like " johny Sparks" , i could do it with 2.18.2 by commit some codes on register.php file , but i dont know how to do it with XOOPS 2.30

XOOPS - XOOPS 2.3.0
PHP - 5.2.3
MySQL - 5.0.67
Server API - apache2handler

ghia

Community Support Member
Posted on: 2008/9/28 14:32
ghia
ghia (Show more)
Community Support Member
Posts: 4946
Since: 2008/7/3 1
#2

Re: Register New Name with space?

Try with change of
switch ($xoopsConfigUser['uname_test_level']) {
        case 
0:
            
// strict
            
$restriction '/[^a-zA-Z0-9_-]/';
            break;
        case 
1:
            
// medium
            
$restriction '/[^a-zA-Z0-9_-<>,.$%#@!\'"]/';
            break;
        case 2:
            // loose
            
$restriction = '/[00-40]/';
            break;
        }

in /class/userutility.php to
switch ($xoopsConfigUser['uname_test_level']) {
        case 
0:
            
// strict
            
$restriction '/[^a-zA-Z0-9 _-]/';
            break;
        case 
1:
            
// medium
            
$restriction '/[^a-zA-Z0-9 _-<>,.$%#@!\'"]/';
            break;
        case 2:
            // loose
            
$restriction = '/[00-3133-40]/';
            break;
        }
.

Edit: Are there some blocks in the code window or is it me?
Anyway the modifs are: add a space after 0-9 (two occurences) and modify the third restriction to \000-\031\033-\040

xsell

Quite a regular
Posted on: 2008/9/29 19:14
xsell
xsell (Show more)
Quite a regular
Posts: 242
Since: 2008/9/2 1
#3

Re: Register New Name with space?

Thx ..

I could not read your Code , but i follow your Direction , and it did work ..with Select the level of strictness for username filtering : set to Strict but i use the third Choice .Light ( Recommended For multi byts Chars . which allow me use foreign Letter not only English letter ..

How to get it to work when i set it to light level of strictness ..

ghia

Community Support Member
Posted on: 2008/9/30 5:36
ghia
ghia (Show more)
Community Support Member
Posts: 4946
Since: 2008/7/3 1
#4

Re: Register New Name with space?

I try to post again:
Quote:

switch ($xoopsConfigUser['uname_test_level']) {
case 0:
// strict
$restriction = '/[^a-zA-Z0-9 \_\-]/';
break;
case 1:
// medium
$restriction = '/[^a-zA-Z0-9 \_\-\<\>\,\.\$\%\#\@\!\\\'\"]/';
break;
case 2:
// loose
$restriction = '/[\000-\037]/';
break;
}

I don't know why the code window behaves in such a strange way (a XOOPS 2.3.0 problem?).

xsell

Quite a regular
Posted on: 2008/9/30 6:49
xsell
xsell (Show more)
Quite a regular
Posts: 242
Since: 2008/9/2 1
#5

Re: Register New Name with space?

Yes that How i edited too but like i Said this well Work if from Control Panel : System >>Preferences »» User Info Settings
then Down to : Select the level of strictness for username filtering ..

if i Set it to 'stric ' that edited way well work .. but if i set it to ' light' it well not work ..

and i have it setted for 'Light' to allow other Character to be registered with space in thier user name ,since most of my users use none English letters .

ghia

Community Support Member
Posted on: 2008/9/30 8:48
ghia
ghia (Show more)
Community Support Member
Posts: 4946
Since: 2008/7/3 1
#6

Re: Register New Name with space?

Sorry, my mistake!
The code values seems to be octal in stead of the assumed decimal.
So it is /[\000-\037]/ and not /[\000-\031\033-\040]/.
I corrected it in my earlier post also.
Beware that it allows also other punctuation like ():; etc., but that's also the case with the unmodified source.

xsell

Quite a regular
Posted on: 2008/9/30 18:09
xsell
xsell (Show more)
Quite a regular
Posts: 242
Since: 2008/9/2 1
#7

Re: Register New Name with space?

Perfect !! Many Thx

Anonymous

Posted on: 2008/12/11 8:47
Anonymous
Anonymous (Show more)
Posts: 0
Since:
#8

Re: Register New Name with space?

Thanks ghia

Kiwi_Chris

Just popping in
Posted on: 2009/5/16 4:05
Kiwi_Chris
Kiwi_Chris (Show more)
Just popping in
Posts: 79
Since: 2009/1/3 1
#9

Re: Register New Name with space?

Brilliant, are you planning to correct this in the next release?