Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
Forked from stevewithington/muraUserBeans.cfm
Created May 5, 2014 02:21
Show Gist options
  • Save ronnieduke/35aefc1bc9c815f721e4 to your computer and use it in GitHub Desktop.
Save ronnieduke/35aefc1bc9c815f721e4 to your computer and use it in GitHub Desktop.
<cfscript>
// Place these methods in your Site, Theme, or Plugin's eventHandler.cfc
public any function onBeforeUserSave($) {
var newUserBean = arguments.$.event('userBean');
var oldUserBean = arguments.$.getBean('user').loadBy(userid=arguments.$.event('userid'));
// if you want to stuff the oldUserBean in the event
// $.event('oldUserBean', oldUserBean);
// here you could run any comparison logic between the oldUserBean and the newUserBean
}
public any function onBeforeUserUpdate($) {
var newUserBean = arguments.$.event('userBean');
var oldUserBean = arguments.$.getBean('user').loadBy(userid=arguments.$.event('userid'));
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment