onklmaps Posted February 1, 2017 Share Posted February 1, 2017 Hi, After much trial and error I'm asking here, and hopefully getting some insight from one of you experts I want to change the whm package directly after a client has ordered a cpanel hosting account from whmcs. The reason I want to do this, is that my Installatron auto-installer hook script needs to call the Installatron API from the cPanel-account. As soon as the initial call is done, root takes over and finishes the task, and the cPanel-account no longer needs the Installatron feature activated. So therefore, at AfterModuleCreate-hook i run the installatron script with priority 1 first, and then my downgrade script with priority 2. Both scripts run fine, but my downgrade script fails to do what is intended. It does not change to the downgraded whm-package, but keeps the full featured one. Please see the code: <?php function downPackage($vars) { $command = 'ModuleChangePackage'; $postData = array( 'accountid' => $vars['params']['accountid'], 'user' => $vars['params']['username'], 'pkg' => 'name_of_the_downgraded_whm_package', // New whm-package I want to change too. ); $adminUsername = 'admin'; $results = localAPI($command, $postData, $adminUsername); } add_hook("AfterModuleCreate",2,"downPackage"); ?> Please see the System Module Debug Log > Request: user=cpaneluser&pkg=name_of_full_featured_whm_package Request has the wrong pkg name! Why is that, and how can I correct it? 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.