xsell xsell
  • Quite a regular
  • Quite a regular
  • Joined: 2008/9/2 14:56
  • Group: Registered Users
  • Posts: 240
  • Posted on: 2008/9/28 0:09
Register New Name with space? #1
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 ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2008/9/28 14:32
Re: Register New Name with space? #2
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 xsell
  • Quite a regular
  • Quite a regular
  • Joined: 2008/9/2 14:56
  • Group: Registered Users
  • Posts: 240
  • Posted on: 2008/9/29 19:14
Re: Register New Name with space? #3
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 ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2008/9/30 5:36
Re: Register New Name with space? #4
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 xsell
  • Quite a regular
  • Quite a regular
  • Joined: 2008/9/2 14:56
  • Group: Registered Users
  • Posts: 240
  • Posted on: 2008/9/30 6:49
Re: Register New Name with space? #5
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 ghia
  • Community Support Member
  • Community Support Member
  • Joined: 2008/7/3 15:19
  • From Belgium
  • Group: Registered Users
  • Posts: 4946
  • Posted on: 2008/9/30 8:48
Re: Register New Name with space? #6
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 xsell
  • Quite a regular
  • Quite a regular
  • Joined: 2008/9/2 14:56
  • Group: Registered Users
  • Posts: 240
  • Posted on: 2008/9/30 18:09
Re: Register New Name with space? #7
Perfect !! Many Thx
Anonymous  
Re: Register New Name with space? #8
Thanks ghia
Kiwi_Chris Kiwi_Chris
  • Just popping in
  • Just popping in
  • Joined: 2009/1/3 18:57
  • Group: Registered Users
  • Posts: 79
  • Posted on: 2009/5/16 4:05
Re: Register New Name with space? #9
Brilliant, are you planning to correct this in the next release?
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team