NorCal Internet Posted March 24, 2009 Share Posted March 24, 2009 I searched through the forums, and am trying figure out a few things regarding "Action Hooks". I'm trying to tie WHMCS into various external functions, such as creating RADIUS accounts in FreeRADIUS, e-mail accounts directly on servers (Without hosting panels), etc. I'm in the progress of migrating from OptigoldISP, and already have a lot of automation scripts in place that I'd like to trigger with WHMCS, and it appears Action Hooks is a possible solution. While looking through the actionhooks.php file, I found the "AfterModuleCreate" function, with the remark: "This function runs when a module creation command complete successfully - various variables available"... This sounds like what I'm looking for, but I can't seem to find a list of available variables, other than those on other functions. Is there a list that I've missed? Secondly, is there a way to pass a product to the actionhooks.php process? I could use this to then determine what action to take (What script to fire) within the actionhook module... Is there another way to trigger external scripts, at account creation/suspension/cancelation/unsuspension that will allow actions based on the product? So far, I'm pretty excited to be making the switch. The support staff was great during my initial setup, helping work out a couple kinks. I'm looking forward to getting fully migrated over! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 24, 2009 Share Posted March 24, 2009 try using print_r($params); to get the variables 0 Quote Link to comment Share on other sites More sharing options...
NorCal Internet Posted March 25, 2009 Author Share Posted March 25, 2009 Thanks for the response, Sparky. Here's what I've entered: function actionhook_AfterModuleSuspend($vars) { # This function runs when a module suspension command completes success$ print_r($params); } When I place an account in "Suspended Status", it changes the color of the product in the drop down list, but I'm not seeing a list of paramaters... I'm assuming I'm missing something, or maybe the function isn't getting called because the module suspension command isn't completing sucessfully, and thus not calling this hook? 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted March 26, 2009 Share Posted March 26, 2009 use print_r($vars); for that one 0 Quote Link to comment Share on other sites More sharing options...
NorCal Internet Posted March 28, 2009 Author Share Posted March 28, 2009 Tried that...Same thing. I think I'm missing something here... Should what i'm adding to actionhooks.php cause a webpage to be displayed when I move a client to "Suspended" and "Save" the change? Should it load a basically blank page, with the available variables/parameters displayed? Or should I be looking somewhere else for that information? I appreciated the help Sparky. 0 Quote Link to comment Share on other sites More sharing options...
NorCal Internet Posted March 28, 2009 Author Share Posted March 28, 2009 OK... I had "Module" set to "None" for the product, because that seemed like the correct setting for someone not using a control panel. I set it to "Directadmin", since that didn't really seem to have any underlying settings for a control panel, and now I'm getting the variable list. So, is "Directadmin" NOT a panel? (I guess I could try googling it) and is that intended for building my own actions, or for other custome integrations? 0 Quote Link to comment Share on other sites More sharing options...
NorCal Internet Posted March 28, 2009 Author Share Posted March 28, 2009 I think I figured it out... Looks like I need to create my own module, and then set my product to that module. So, let's say I want to create a RADIUS account, I need to create a "RADIUS" module, create the various functions within it, and then set my RADIUS products to use that module. Does this sound right? I can see where this would work for most of my services (RADIUS, DSL, Hosting), but I can also see where adding e-mails may be an issue, at least without having a control panel of some type, where packages can be defined, and the users can add the e-mails themselves, or something can limit the number of accounts they can add... 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.