Part of the EllisLab Network
   
 
Userauth has problem with collation?
Posted: 03 February 2008 08:29 AM   [ Ignore ]  
Summer Student
Total Posts:  14
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 09:15 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  14
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 12:55 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  467
Joined  08-26-2006

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

Profile
 
 
Posted: 11 February 2008 04:09 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  14
Joined  01-10-2007
tomcode - 10 February 2008 12: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 04:19 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  467
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.

Profile
 
 
Posted: 11 February 2008 04:40 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  14
Joined  01-10-2007
tomcode - 11 February 2008 04: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 04:47 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  467
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 ...

Profile
 
 
Posted: 11 February 2008 05:13 AM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  14
Joined  01-10-2007
tomcode - 11 February 2008 04: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 05:24 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  467
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.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 721, on January 06, 2010 09:38 AM
Total Registered Members: 115020 Total Logged-in Users: 59
Total Topics: 122453 Total Anonymous Users: 5
Total Replies: 647342 Total Guests: 504
Total Posts: 769795    
Members ( View Memberlist )