esje Posted May 2, 2014 Share Posted May 2, 2014 Hi there, How can I get WHMCS to run a terminal command after someone has signed up for my service? I need to parse username/password, "createseedbox username password", I have looked at hooks and looking for someone to educate me on how to do this. Thanks 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted May 6, 2014 Share Posted May 6, 2014 If you are not currently using a provision module, you could create your own and in the CreateAccount function execute the command. http://docs.whmcs.com/Provisioning_Module_Developer_Docs e.g. function modulename_CreateAccount($params) { exec('createseedbox '.escapeshellarg($params['username']) . ' ' . escapeshellarg($params['password'])); } Or if you are using an existing provision module, then you would want to use the AfterModuleCreate hook. http://docs.whmcs.com/Hooks:Products/Services#AfterModuleCreate That would look something like this, but you may also want to add an if statement and only run this based on the module or product type. function create_seedbox($vars) { exec('createseedbox '.escapeshellarg($vars['params']['username']) . ' ' . escapeshellarg($vars['params']['password'])); } add_hook("AfterModuleCreate",1,"create_seedbox"); 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.