I'm beginning my CB Plug-In Development learning, and have reviewed the API. I am having some troubles understanding the proper use of:
[code:1]
function onBeforeLogin ($username, $passwd2)
function onAfterLogin ($row, true)
[/code:1]
A few questions:
1. Is the onBeforeLogin function required in order to use the onAfterLogin function, or is that just in the event that you want to manipulate information pre-login?
2. I'm not sure what information needs to be in the '$row' and 'true' positions above. If I wanted to to create a plug-in that emailed the administrator every time a user logged in, would this suffice as the process.php file (assuming I had XML/Install/Uninstall files all correctly established)?
[code:1]
function onAfterLogin ($row, true) {
global $database, $my;
$userid = $my->id;
[here would be the php code to mail the administrator that userid has logged in]
}
[/code:1]
Please help me to better understand these functions so that I can further my adventures. I'm clearly missing a key element to understanding this but look forward to learning. Thanks.