PasswordValidator question

PasswordValidator question

Postby Toby78 on Wed Sep 26, 2007 8:25 am

I would like to check the password against another database.

How can I access the database inside of a Validator class?

:?:

None of the Validator classe so far accesses the database......I have looked at them all.

Thanks!
Toby78
 
Posts: 17
Joined: Wed Sep 26, 2007 8:22 am

Postby jondaley on Wed Sep 26, 2007 12:40 pm

Do you mean check the password for the main logins? You probably don't want to write your own code for that, but instead use (or at least start with) one of the other providers:
http://wiki.lifetype.net/index.php/User_data_providers
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Postby Toby78 on Thu Sep 27, 2007 5:21 am

Where do you define which user data provider lifetype should use=

If I still want to use the default lifetype users table, and only simple make a "custom" database call inside the validator....how would I do that?

Thanks!
Toby78
 
Posts: 17
Joined: Wed Sep 26, 2007 8:22 am

Postby phunkphorce on Thu Sep 27, 2007 11:25 am

What exactly are you trying to do? I'm asking because I think you're getting confused.

The PasswordValidator class is only used to verify that when users change their password, the new password complies with certain rules defined there. The validator class is *not* used to authenticate users.

If you want to authenticate users against some other data source, you should use a custom user data provider. You can always copy the default LifetypeUserDataProvider (which ensures that you will still use LT's default user tables) class and make your customizations wherever necessary. The method names in that class are pretty self-describing so you should have no problem finding the right place to make your changes.

The functionality of user data providers is described here:

http://wiki.lifetype.net/index.php/User_data_providers

And the documentation related to how to create new providers is here:

http://wiki.lifetype.net/index.php/Deve ... _Providers
phunkphorce
Lifetype Expert
 
Posts: 9028
Joined: Mon Aug 25, 2003 6:34 am
Location: Suomessa

Postby Toby78 on Fri Sep 28, 2007 5:37 am

....as I see it there is only one data provider so far - and this one is only for one database.

i need to query a second database as well....it is just one simple query.
Toby78
 
Posts: 17
Joined: Wed Sep 26, 2007 8:22 am

Postby Nomad on Fri Sep 28, 2007 7:07 am

see post in request and suggestions - I assume this is related to that.

Both of these posts should really be in the configuration and installation forum btw ;)
Blog Ireland - now with video posting
Normally most write something meaningful here so many to choose from yet most oft ignored.
Nomad
Lifetype Expert
 
Posts: 645
Joined: Sat Feb 05, 2005 8:40 pm
Location: Eire

Postby Toby78 on Fri Sep 28, 2007 8:12 am

I found the reason..seems like a bug during installation. the plug_base_dir was not set..and it tried to access the url http://www.domain.com/{plog_base_dir}
I have changed it in the database directly and replaced {plog_base_dir} with a slash - now it works.
Toby78
 
Posts: 17
Joined: Wed Sep 26, 2007 8:22 am


Return to LifeType 2.0 Development

cron