Part of the EllisLab Network
   
 
Userauth has problem with collation?
Posted: 03 February 2008 10:29 AM   [ Ignore ]  
Summer Student
Total Posts:  9
Joined  01-10-2007

I wanted to take a good look at the “userauth” package, but have run into an error that probably just takes a small tweak, but as a new CI user, it’s not clear where to make an adjustment.

The environment is Windows/XP with Apache2.2, MySql 5.x and PHP5.

The userauth package works perfectly on CI 1.5.4.

If I attempt to duplicate with CI 1.6, I get these four errors:

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 198

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$dbcollat
Filename: database/DB_driver.php
Line Number: 198

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 200

A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_DB_mysql_driver::$char_set
Filename: database/DB_driver.php
Line Number: 204
- - - - -
Looking at the code in DB_driver.php, it looks like CI-1.6 doesn’t get the character set from the database?

The database uses the InnoDB engine and the default collation is latin1_swedish_ci.

Thanks to anyone who understands all the pieces enough to prescribe a “fix”!!!

 Signature 

Retired de la vida loca
San Antonio, Texas

Profile
 
 
Posted: 03 February 2008 11:15 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  9
Joined  01-10-2007

SOLVED!

Overlaying the userauth does not take new configuation variables into consideration.

When I added to config/database.php:

$active_record TRUE;

$db['default']['char_set'"utf8";
$db['default']['dbcollat'"utf8_general_ci"

and

$config['directory_trigger''d'

into config/config.php

the Userauth works as expected!!!

 Signature 

Retired de la vida loca
San Antonio, Texas

Profile
 
 
Posted: 10 February 2008 02:55 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  663
Joined  08-26-2006

Have You tried whether special chars like é à ç are correctly handled with Your configuration changes ?

 Signature 

Die Wirklichkeit ist das, was übrig bleibt, wenn man aufgehört hat, daran zu glauben.

Profile
 
 
Posted: 11 February 2008 06:09 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  9
Joined  01-10-2007
tomcode - 10 February 2008 07:55 PM

Have You tried whether special chars like é à ç are correctly handled with Your configuration changes ?

I didn’t think of checking since I almost never worry about anything but North American English.

What could you suggest as a test?

If it turns out that special chars FAIL, then what?

TIA.

Dave

 Signature 

Retired de la vida loca
San Antonio, Texas

Profile
 
 
Posted: 11 February 2008 06:19 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  663
Joined  08-26-2006

Well, You could put some characters like é, è, à, ç, ü, ï (just copy them)  into a user fullname and a group description.

If they show up nicly, then I’ll publish an update of userAuth for CI 1.6 with Your changements. That’ll be not very clean, but should do it for some weeks until I’ve got more time. (Flashvars, database configs - userAuth is latin_1 based).

If not, You might want to fix it Yourself, like I said userAuth is latin_1 based .... and CI 1.6 comes utf-8 prefigured.

 Signature 

Die Wirklichkeit ist das, was übrig bleibt, wenn man aufgehört hat, daran zu glauben.

Profile
 
 
Posted: 11 February 2008 06:40 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  9
Joined  01-10-2007
tomcode - 11 February 2008 11:19 AM

Well, You could put some characters like é, è, à, ç, ü, ï (just copy them)  into a user fullname and a group description.

OK, that failed and produced an error that displayed VALID SQL (which I was able to use to create a ci_users record).

But the user does NOT show up when I refresh/logout/login as admin even though the record exists in the database.

Should I try something else or just tell all to disregard my initial “eureka”?

TIA.
Dave

 Signature 

Retired de la vida loca
San Antonio, Texas

Profile
 
 
Posted: 11 February 2008 06:47 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  663
Joined  08-26-2006

Well, already thanks for Your testing. Then :

Try

$db['default']['char_set'"latin1";
$db['default']['dbcollat'"latin1_swedish_ci"

This might / should work. Hopefully ...

 Signature 

Die Wirklichkeit ist das, was übrig bleibt, wenn man aufgehört hat, daran zu glauben.

Profile
 
 
Posted: 11 February 2008 07:13 AM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  9
Joined  01-10-2007
tomcode - 11 February 2008 11:47 AM

Well…Then :

This might / should work. Hopefully ...

YUP.  Seems to allow me to create/update users or groups with special chars in username, groupname or fullname.

Thanks.  Your patience with me is refreshing!

Dave

 Signature 

Retired de la vida loca
San Antonio, Texas

Profile
 
 
Posted: 11 February 2008 07:24 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  663
Joined  08-26-2006

Nice to know that it works.

Your patience with me is refreshing!

I don’t feel like been patient with You. You had a problem, I could help you, that’s what this place is for, no ? And, You saved me already some testing.

 Signature 

Die Wirklichkeit ist das, was übrig bleibt, wenn man aufgehört hat, daran zu glauben.

Profile