serveria Posted September 22, 2019 Share Posted September 22, 2019 Hi, We're trying to create a module which would provision email accounts on a Virtualmin server (don't ask why it was requested by a customer). What we have so far is a sample WHMCS provisioning module from github and Virtualmin API documentation. We know the command which needs to be executed on a Vmin server it would be similar to this one: https://yourserver:10000/virtual-server/remote.cgi?program=create-user But how can we call this command from WHMCS? It should be somewhere around this place here: function provisioningmodule_CreateAccount(array $params) { try { // Call the service's provisioning function, using the values provided // by WHMCS in `$params`. // // A sample `$params` array may be defined as: // // ``` // array( // 'domain' => 'The domain of the service to provision', // 'username' => 'The username to access the new service', // 'password' => 'The password to access the new service', // 'configoption1' => 'The amount of disk space to provision', // 'configoption2' => 'The new services secret key', // 'configoption3' => 'Whether or not to enable FTP', // ... // ) // ``` } catch (Exception $e) { // Record the error in WHMCS's module log. logModuleCall( 'provisioningmodule', __FUNCTION__, $params, $e->getMessage(), $e->getTraceAsString() ); Please assist, any help will be appreciated... 0 Quote Link to comment Share on other sites More sharing options...
serveria Posted September 27, 2019 Author Share Posted September 27, 2019 (edited) Hi, Tried this so far: function provisioningmodule_CreateAccount(array $params) { try { $result = shell_exec("wget -O - --quiet --http-user=root --http-passwd=xxxxxx --no-check-certificate 'https://xx.xx.xx.xx:10000/virtual-server/remote.cgi?program=create-user --domain example.com --user jimmy --pass smeg --quota 1024'"); } but no go... WHMCS is giving me this error: Module Create Failed - Service ID: xxx - Error: Function Not Supported by Module Any suggestions? What are we doing wrong? Edited September 27, 2019 by serveria 0 Quote Link to comment Share on other sites More sharing options...
serveria Posted September 30, 2019 Author Share Posted September 30, 2019 Issue solved, just had to replace this: function provisioningmodule_CreateAccount(array $params) { with the actual module name: function yourmodulename_CreateAccount(array $params) 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.