Created
February 4, 2016 15:13
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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