non-latin charasters in usernames (phpbb integration)

non-latin charasters in usernames (phpbb integration)

Postby Char0day on Wed Oct 03, 2007 7:12 am

Hello.
Does anybody knows how can I use non-latin charasters in user names?
I already have phpbb forum with near 100 users. Most of them use ciryllic user names. So I made subdomains for users (user select subdomain name by himself), and activate phpbbd data provider.
All looks fine except usernames with non-latin charasters. User can not login.
How can I solve this problem? I want user can login with non-latin usernames.
Thank you. :)
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Postby phunkphorce on Thu Oct 04, 2007 3:15 am

I don't think that's going to be possible...
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby Char0day on Thu Oct 04, 2007 6:31 am

I find file usernamevalidator.class.php and change regexp rule
Code: Select all
define( "ONLY_ALPHANUMERIC_REGEXP", "^([a-z0-9]*)$" );

on next expression:
Code: Select all
define( "ONLY_ALPHANUMERIC_REGEXP", "^([a-zа-я0-9]*)$" );

and change file encoding to utf8.
But it is not work properly.
The problem is not so easy, as at the first look?
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Postby phunkphorce on Fri Oct 05, 2007 6:04 pm

You're looking in the wrong place, the UsernameValidator class is only used when creating new usernames, and it is not used when using the integration with phpbb2.

Are you familiar with PHP? I think that the only solution here is to debug the code and see what's going on. Authentication is performed in Phpbb2UserDataProvider::authenticateUser() (inside file class/dao/userdata/phpbb2userdataprovider.class.php) and I would first of all see what parameter the function is getting as $user and $pass and then see why the SQL query is failing.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby Char0day on Sun Oct 07, 2007 9:46 pm

I have somt experience in php, but not as a proffy. But I have experience in C/C++, and oop, and can read code.
So, I'll look in code Phpbb2UserDataProvider::authenticateUser() with debugger.
And what about localized usernames in future versions of lifetype?
Is it possible?
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Postby Char0day on Fri Oct 19, 2007 6:39 am

So, now I can login with user names with non-latin characters.

I create lifetype db in cp1251 (forum db also in cp1251), and use localization files of the blog in cp1251 too.
I add "Set Names cp1251" in every method of class Phpbb2UserDataProvider, and set default charset cp1251 everywhere in the blog.
Char0day
 
Posts: 24
Joined: Wed Oct 03, 2007 6:59 am
Location: Russia, Nakhodka

Postby phunkphorce on Sat Oct 20, 2007 3:05 am

So it was an encoding problem after all... Thanks for your troubleshooting, we'll probably update the wiki documentation to reflect this case.
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa


Return to Localization

cron