geeffland wrote:I have not seen the answer to my question in the plugin API manual so excuse me if it is buried in there somewhere
For a lot of events there is a "Before" and "After" version. I assume that the "Before" events are like those in many other languages so with that in mind...
If I call a Before event, say for registration or login, and in my code I determine that it should "cancel" and not continue with either the registration or login how do I pass this cancel message along so that it will gracefully dump out of the process it is in...
Here a small example:
[code:1]
$_PLUGINS->registerFunction( 'onBeforeUserRegistration', 'pluginExampleBeforeUserRegistration' );
/**
* Example registration verify user method
* Method is called before user data is stored in the database
* @param array holds the core mambo user data
* @param array holds the community builder user data
*/
function pluginExampleBeforeUserRegistration(&$user,&$cbUse) {
global $_POST, $_PLUGINS;
if ($_POST == $_POST) {
$_PLUGINS->raiseError(0);
$_PLUGINS->_setErrorMSG("Password has to be different from username!"«»);
return false;
}
return true;
}
[/code:1]