Why is an account of unlimited space and bandwidth being created, if I'm my package has limits?
My php code uses this to create a cpanel account.
[PHP]$task2=$whm->createAccount('testdomain.com','testuser','changeme','testpassword123','hostingz_HL5');[/PHP]
The package has 500MB space and 1500MB bandwidth.
/http://imageshack.com/a/img6/5731/qgp4.png
But when I check my email or the account created in WHM, it says that the account has unlimited space and bandwidth.
/http://imagizer.imageshack.us/v2/800x600q90/43/r6m8.png
How can I stop this unlimited space and bandwidth giving, and have WHM respect the package's limits when creating an account?
-
In that account creation email, the package is HL5 not hostingz_FH5. If you've copied and pasted the php code, you are missing a closing single quote after the package name. It's not clear how you are calling the API as I'm not familiar with the $whm object you are using but you may want to follow the createacct example in the Examples for cPanel's PHP API class: 0 -
from what i know. cpanel api (/https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php) can be use to create and modify such as change package cpanel account as well. and, from what we have know, php was run very fast. so i think, based on that opinion, call the createacct can be run first, and after that you can update for the package. modify an account can be done based on changepackage function (/https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php#L1203) create account can be done based on function createacct (/https://github.com/CpanelInc/xmlapi-php/blob/master/xmlapi.php#L956) this will i do, if i were in your position [PHP] include_once ('xmlapi.php'); $call = new xmlapi($ip); $call -> password_auth('root',$yourpassword); $call -> set_debug(1); $account = array(username => 'theusername',password => 'thepassword',domain => 'thedomain.tld'); $call -> createacct($account); $call -> changepackage('theusername','package_name'); [/PHP] hope that's help 0 -
Thanks for the code sample. I'll try the code sample if the whm.php class file cannot be used. I never thought about using code to change the package, after the account is created. Here's the whm.php file code I was using. The problem is that even when I specify the package to use when creating the hosting account, it creates an unlimited account instead of respecting the package I chose to use. 0 -
i have the same problem, if i use 'quota' example $account = array(username => 'theusername', password => 'thepassword', domain => 'thedomain.tld', 'quota' => '3500'); doesn't working, if i check WHM i see unlimited as quota instead of 3500 How is possible fixing this problem ? any help please? thanks in advance 0
Please sign in to leave a comment.
Comments
7 comments