festr Posted July 31, 2014 Share Posted July 31, 2014 Hi I cannot figure out how to trigger terminate function (TerminateAccount) if I delete a product within admin area (delete from some client). Is that supposed to work or the terminate function is not executed on this action? 0 Quote Link to comment Share on other sites More sharing options...
Alex - Arvixe Posted July 31, 2014 Share Posted July 31, 2014 Which module are you using? Just deleting a product itself from WHMCS would not terminate it on the server, just, it'll delete from WHMCS. In future hit the 'Terminate' button in the products area of WHMCS before deleting it. If you want to terminate the account now you would need to login to WHM (assuming you're running cPanel but if not, the equal to WHM) and go to 'Terminate an Account'. 0 Quote Link to comment Share on other sites More sharing options...
festr Posted July 31, 2014 Author Share Posted July 31, 2014 I have coded my own module. It would be nice if whmcs can trigger server module terminate function when deleting it in whmcs area so accounts will not leave accounts on server. lets say that I need to terminate multiple accounts - I have to click on terminate button one by one and then delete it. 0 Quote Link to comment Share on other sites More sharing options...
Alex - Arvixe Posted July 31, 2014 Share Posted July 31, 2014 (edited) I have coded my own module. It would be nice if whmcs can trigger server module terminate function when deleting it in whmcs area so accounts will not leave accounts on server. lets say that I need to terminate multiple accounts - I have to click on terminate button one by one and then delete it. Think you will need an extension/hook added as deleting products from WHMCS does work as it is designed to and that is just deleting the records from WHMCS, not the server itself. Edited July 31, 2014 by Alex - Arvixe 0 Quote Link to comment Share on other sites More sharing options...
SeanP Posted July 31, 2014 Share Posted July 31, 2014 You could write a hook, that would run right before the service (client product) is deleted: http://docs.whmcs.com/Hooks:ServiceDelete Within the hook, just have it make an API call to Terminate the service: http://docs.whmcs.com/API:Module_Terminate This should execute a terminate, before deleting the service. If you only want this to happen for a specific module, you would have to put logic in your hook to only run the terminate, if the service is using the specific module. Otherwise, this will run for every server provisioning module you have. 0 Quote Link to comment Share on other sites More sharing options...
festr Posted August 11, 2014 Author Share Posted August 11, 2014 Thank you very much, it works like a charm. I have just added it in /include/hooks/ and added file my.php function vm_terminate_cloud($vars) { // do your stuff here } add_hook("ServiceDelete", 1, vm_terminate_cloud); 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.