-
☆ A M B ☆
- 711 Posts
Hi,
I am trying to write into a MODx site an SSO Login where it goes off and validates a user against a 3rd party user, and looking at this plugin event it looks like this might be a good way for me to drop my code in to say if a user is validated or not, however I cannot seem to find much documentation on MODx events and plugins.
Does anyone have any tips on how I can find out what can actually be used for a plugin at the event: OnBeforeWebLogin ?
Thanks Aaron
-
☆ A M B ☆
- 24,524 Posts
$modx->invokeEvent("OnBeforeWebLogin",
array(
"username" => $username,
"userpassword" => $givenPassword,
"rememberme" => $rememberme
));
A plugin based on this event will be processed before the weblogin.processor.inc.php file continues beyond this point. So you can do anything you want with your plugin code, including abort the login process with your own error messages, or override the rest of the login process, or just let it continue if your plugin is satisfied. In the case of this event, these values are available. You may have to experiment a bit (I’ve had to use a print_r or array_dump on the $modx object to find out exactly which array I’m dealing with) to find out how to access this array at this point.
-
☆ A M B ☆
- 711 Posts
Thanks for the reply
I have now created a plugin which uses this event which works pretty well.
Its has been coded to now check a remote .NET server to validate a users login details, and then logs the user into MODx by creating the sessions which WebLogin normally does.
I thought it would be a lot harder to implement than this but as usual MODx makes life easy.
Thanks again
Aaron