Jump to content

changePackage fails to change package?!


onklmaps

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated