A couple of weeks ago I posted a "hack" to enable Active Directory (LDAP)
authentication by adding code to the common_check_user() function, and that
works, but I don't think that it is the best way to approach alternate
authentication methods. I've reworked it using the Event::handler and would
like input from the developers.
As it is written now I just add the handler at the begining of the
common_check_user() function and if there is a plugin that acts on this
event then that is as far as it goes and it returns $user.
// add a login handler
$user = null;
if (Event::handle('CheckUser', array($nickname, $password, &$user))){
return $user;
}
We probably want to allow for simultaneous methods, with some sort of order
precedent, and a default. (i.e. try LDAP and if it fails then try the local
account.) But before I go any further I would like to hear some
suggestions.
Is this the best way to introduce authentication plugins? Maybe there
should be both a "Start" and "End" handle ??
As far as the plugins are concerned I have this working with the adLDAP
plugin and a PEAR Net_Ldap2 plugin. They merely authenticate the user:pass
credietials and return the $user array if authenticated.
I'll post the code at my clone of dev
http://gitorious.org/~jsloan/laconica/jsloan-sandbox<http://gitorious.org/%7Ejsloan/laconica/jsloan-sandbox>
thanks
jim sloan
_______________________________________________
Laconica-dev mailing list
[email protected]
http://mail.laconi.ca/mailman/listinfo/laconica-dev