Quote from: mausmalone at Oct 29, 2009, 03:03 PM
Just a side note, I threw together a quickie LDAP Authentication module and made a thread for it here: http://modxcms.com/forums/index.php?topic=38967.0 It functions in MODx 1.1.
I’m trying out revolution now but am having a hard time porting the plugin - or finding any information that will help me out. I can see the MODx framework stuffing username/password into $loginAttributes, then passing that to invokeEvent(), which then takes that as a variable named $params and from there .... I’m lost. I don’t know how to get at those parameters from inside the plugin in revolution.
The variables available in OnManagerAuthentication are:
$user (the user object) -- use $user->get(’fieldname’) for the member variables.
$password (I think this is the encrypted password, not what the user enters - not sure).
$rememberme
Note, though that OnManagerAuthentication fires after the user has been found and authenticated in the MODx db and is determined to be headed for the Manager, but before the user has been determined to be authorized to access the Manager context.
So I think you might want OnBeforeManagerLogin instead, which comes before any attempt to authenticate the user, but after the login form is submitted.
Variables available in OnBeforeManagerLogin:
$username: string entered by user
$password: string entered by user
$attributes: array -- $rememberme, $logincontext( =’mgr’’).
I think returning false there will prevent the regular MODx authentication, but I’m not sure.
You may have trouble on success, though, if the user isn’t in the MODx DB and authorized for the ’mgr’ context. Not sure about that either.
Hope this helps.