I wrote this script one day for fun a few months ago and I decided to share it since I really haven't used it and I release most of my scripts under gnu gpl anyway 
I honestly do not know the state of this script as I wrote / tested it to some degree a few months ago. Therefore I do not know what still works or never worked. I do know that I originally tested a bunch of the functionality. However, I do not think I tested subdomains extensively (as I found a bug or two related to subs when documenting it just now) and that makes me think other parts *may* not be tested. Remember, the script was written a few months ago so html for some parts could possibly have changed (requiring regex change) and if so just tell me.
Originally the script was designed to be run as root so I have no idea if URLs that it access are valid for resellers as well (I would guess they are). Never tested for reseller account though (only as root). The original file is PHP 5, so I have produced both PHP 5 and PHP 4 versions, with PHP 4 version completely untested (simply has PHP 5 specific tags stripped out).
The primary functions are as follows:
createAccount()
changeOwner()
addReseller()
setResellerLimits()
suspendAccount()
enableAccount()
deleteAccount()
getAccountList()
getPackageList()
getError()
isReseller()
isUser()
isDomain()
getUser()
getPackage()
getDomain()
getAllDomains()
isSubdomain()
getSubdomains()
getAllSubdomains()
Most of those functions accept various arguments and I just now went through and tried to document the large majority of it. The methods are fairly well commented but I haven't gone through the code to comment any of it yet as I usually do. Again, this was original intended for private use exclusively so I didn't count on others seeing this... so feel free to point out errors. The main goal of the script was to add reseller functionality.
If for nothing else, this script would certainly be a good start on a more developed interface to cPanel API for various people who make such requests. I attached a version / identification to it in the event I decide to develop it.
You can find download attached. Use _PHP4 version of file if you have PHP 4.x (not tested).
I honestly do not know the state of this script as I wrote / tested it to some degree a few months ago. Therefore I do not know what still works or never worked. I do know that I originally tested a bunch of the functionality. However, I do not think I tested subdomains extensively (as I found a bug or two related to subs when documenting it just now) and that makes me think other parts *may* not be tested. Remember, the script was written a few months ago so html for some parts could possibly have changed (requiring regex change) and if so just tell me.
Originally the script was designed to be run as root so I have no idea if URLs that it access are valid for resellers as well (I would guess they are). Never tested for reseller account though (only as root). The original file is PHP 5, so I have produced both PHP 5 and PHP 4 versions, with PHP 4 version completely untested (simply has PHP 5 specific tags stripped out).
The primary functions are as follows:
createAccount()
changeOwner()
addReseller()
setResellerLimits()
suspendAccount()
enableAccount()
deleteAccount()
getAccountList()
getPackageList()
getError()
isReseller()
isUser()
isDomain()
getUser()
getPackage()
getDomain()
getAllDomains()
isSubdomain()
getSubdomains()
getAllSubdomains()
Most of those functions accept various arguments and I just now went through and tried to document the large majority of it. The methods are fairly well commented but I haven't gone through the code to comment any of it yet as I usually do. Again, this was original intended for private use exclusively so I didn't count on others seeing this... so feel free to point out errors. The main goal of the script was to add reseller functionality.
If for nothing else, this script would certainly be a good start on a more developed interface to cPanel API for various people who make such requests. I attached a version / identification to it in the event I decide to develop it.
You can find download attached. Use _PHP4 version of file if you have PHP 4.x (not tested).
Attachments
-
11.1 KB Views: 207
Last edited: