Skip to content

Instantly share code, notes, and snippets.

@howellcc
Created February 4, 2016 15:13
Show Gist options
  • Save howellcc/53d96e11abf476c72fc0 to your computer and use it in GitHub Desktop.
Save howellcc/53d96e11abf476c72fc0 to your computer and use it in GitHub Desktop.
[MuraCMS] Redirect a user directly to a plugin upon logging into the administrator.
//Place this function in a plugin's eventHandler.cfc. It will redirect a member of "Plugin Users" to the plugin immediately upon logging in.
public any function onDashboardReplacement(required struct $){
var returnString = "";
//Does user have permission to the plugin?
if(application.permUtility.getModulePerm(application[variables.framework.applicationKey].pluginConfig.getModuleID(), session.siteid)){
if($.currentUser().isInGroup("Plugin Users") && ! $.currentUser().isInGroup("Admin")){
returnString = "<script>
location.href='#application.configBean.getContext()#/plugins/#variables.framework.package#/';
</script>";
}
}
return returnString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment