Dubz31337 Posted April 11, 2014 Share Posted April 11, 2014 I'm not sure if this is the correct board to post in or not, but here it goes. I'm developing an addon for WHMCS (my first one in fact) and I have a couple questions about the hooks for it. First off, is there a way to have the hook cancel the action that it's for? For instance, let's say I make a hook for an administrator editing a client. I create my function add the hook for "ClientEdit". My question is, if I want to run a test to see if the administrator is allowed to do this, how would I abort the edit if they aren't allowed? Even if I call a die(); the settings are still saved. I know I could probably "hide" the client form the administrators' view, but that won't stop them from going into the URL and changing the ID to a client they cannot see. This is just an example, I need to be able to abort edits for various things and simply denying the permission isn't going to work. I'd explain more but I'd rather not spoil the addon for someone else to make on their own. Secondly, is there a way to grab the $vars variable, commonly found in the output function? I know I can grab the settings from the database and rebuild it, however I also need to get the language screens, found in $vars['_lang'], into the array, but I'm not sure as to how I should call it properly (to support multiple languages). Thanks in advanced! Any help would be appreciated. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.