Jump to content

actionhooks.php - Variables Question


NorCal Internet

Recommended Posts

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!

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated