onklmaps Posted January 31, 2017 Share Posted January 31, 2017 Hi, I want to change the whm package directly after module is created. The reason I want this, is that my Installatron script needs to run with with full privileges first, but I want to downgrade the cpanel privileges after the installatron script has started. So therefore i run the installatron function at hook afterModuleCreate with priority 1 first, and then my other script with priority 2. Installatron runs great, and my other script runs to, but fails to do what is intended: to change WHM package from "full-featured-whm-package" to "limited-whm-package". Just to clarify: package = plan. Please see the code: <?php function downPackage($vars) { $command = 'ModuleChangePackage'; $postData = array( 'accountid' => $vars['params']['accountid'], 'user' => $vars['params']['username'], 'pkg' => 'limited-whm-package', // New whm-package I want to change too. ); $adminUsername = 'admin'; $results = localAPI($command, $postData, $adminUsername); } add_hook("AfterModuleCreate",2,"downPackage"); ?> Looking inside #whmcs admin panel > System Module Debug Log > Request", i see that the request contains the old package name?! Why is that, and how can I correct it? user=my_cpanel_user&pkg=full-featured-whm-package Thank you 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.