PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Problem with auth from DB when username have national chars

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Authentication
View previous topic :: View next topic  
Author Message
Andrea



Joined: 09 Jan 2008
Posts: 2

PostPosted: Wed Jan 09, 2008 6:45 am    Post subject: Problem with auth from DB when username have national chars Reply with quote

A have a problem with PEAR:Auth when username have national chars and i use a MySQL server. I need to set cp1251 encoding for example by "SET NAMES cp1251" by I can't understend how to do it when use this class... Can somebody help me with this problem?
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1011

PostPosted: Wed Jan 09, 2008 3:47 pm    Post subject: Reply with quote

You could initialize the Auth_Storage_DB (or _MDB2) class yourself. This class accepts a DB (or MDB2) instance. And the Auth constructor does not only accept the name of a storage container (e.g. 'DB') but also an already initialized container object. Therefore:
- init DB/MDB2 yourself
- $db->query('SET NAMES ...');
- init Auth_Storage_(M)DB(2) with $db
- init Auth with this container object

(untested, but should work)
Back to top
View user's profile Send private message
Andrea



Joined: 09 Jan 2008
Posts: 2

PostPosted: Thu Jan 10, 2008 5:24 am    Post subject: Reply with quote

Thank you for a lot!!! Extended class which i wrote work's excellent now!
In it i am also rewrite verifyPassword() function to use a salt field in DB also for authentication. If somebody need i can public it here...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Authentication All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software