PDA

View Full Version : Free hosting integration



expertoasis
08 Nov 2005, 03:14 PM
Im a bit of a beginner with WHM/cpanel since i havent really used it on advanced level. Actually im having reseller account(i could easily upgrade/buy vps/dedicated if i find solution that works), but this can be done.

I need cpanel->"my customized CMS" integration. Havent seen something like this anywhere even if it should work. this is what i want:
When user signs up on my "portal" it automatically creates him an account in cpanel(if it is availible) with 0mb space and 0mb bandwith so he doesnt really get a hosting at all.
Now if he posts enough(has enough posts per day) i would want from him to be able to request the hosting(actually unlimit the hosting, to be precize). And then there would be the link to his cpanel where he can use it after "unlimiting".
Now, i want from it to syncronize automatically my CMS -> with cpanel lets say on the first day of the month: If he hasnt posted enough he loses his hosting and he can get it back again when he posts(activate it again through CMS).
In that way free hosting would be completely automatized.
Final solution would be free hosting service where users get what they deserve, and they are in their own control of it.
Im not sure if this can be done in PHP, since i have some skills with it, but not with CGI,PERL. If not, i would be looking forward for learning it.
Im looking for code, right documentation to do this, good links, - actually antything. Any response would be helpful.
Please dont say that if i cant do it i should read all the documentation and i will know it... i m asking you for advice here. Just write anything you can, after you have read this "not-that-short" text. Thanks in advance.

Rincewind
08 Nov 2005, 06:25 PM
Perfectly simple, you'll have to write the code yourself but nothing complex really if you have dont a bit of php before. The docs for the cpanel API are here.
http://www.cpanel.net/remoteaccess-php.html

You can't modify the size of the hosting, but if you just create then imediatly suspend the account. You can then use the API form the forum to unsuspend the account one they post enough. A simple php script on a cron job would check once a month and suspend those who have not kept up.

This won't automate everyting, you'll sill need to moderate your forum to stop people just posting spam all the time.