Welcome Guest, Not a member yet? Register   Sign In
Userauth has problem with collation?
#1

[eluser]Dave Nuttall[/eluser]
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"!!!
#2

[eluser]Dave Nuttall[/eluser]
SOLVED!

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

When I added to config/database.php:
Code:
$active_record = TRUE;

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

and
Code:
$config['directory_trigger'] = 'd';
into config/config.php

the Userauth works as expected!!!
#3

[eluser]tomcode[/eluser]
Have You tried whether special chars like é à ç are correctly handled with Your configuration changes ?
#4

[eluser]Dave Nuttall[/eluser]
[quote author="tomcode" date="1202691317"]Have You tried whether special chars like é à ç are correctly handled with Your configuration changes ?[/quote]

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
#5

[eluser]tomcode[/eluser]
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.
#6

[eluser]Dave Nuttall[/eluser]
[quote author="tomcode" date="1202746795"]Well, You could put some characters like é, è, à, ç, ü, ï (just copy them) into a user fullname and a group description.
[/quote]

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
#7

[eluser]tomcode[/eluser]
Well, already thanks for Your testing. Then :

Try
Code:
$db['default']['char_set'] = "latin1";
$db['default']['dbcollat'] = "latin1_swedish_ci";

This might / should work. Hopefully ...
#8

[eluser]Dave Nuttall[/eluser]
[quote author="tomcode" date="1202748465"]Well...Then :

This might / should work. Hopefully ...[/quote]

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
#9

[eluser]tomcode[/eluser]
Nice to know that it works.

Quote: 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.




Theme © iAndrew 2016 - Forum software by © MyBB