Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How does THT connect to cPanel?
#1
I'm a little curious on how THT actually connects to cPanel. So far, from what I've gathered is that it uses cURL. In WHM.php, I see signup() and remote(). signup() calls remote() after generating the URL. From what I see, cURL then goes in and creates the account.

I'm quite new with this stuff, and just generally want to learn how cPanel and THT work together. Sorry if I sound noobish and/or posted in the wrong section.

Thanks.
Reply
#2
Here you go: http://www.cpanel.net/developer/interfacing.html Wink
- KuJoe
Reply
#3
Yup. cURL calls in on the WHM XML-API. We might change it to JSON though. As WHM now has a JSON API. And it's easier to do stuff with JSON in PHP than XML.
Kevin Mark - TheHostingTool Lead Developer
Reply
#4
Holy, I wasn't expecting a reply to be honest. Awesome though, I had a hunch that it was cURL. I'll probably most defiantly reply back after I get a trial of cPanel up so I can mess around with THT and cPanel.

Thank you again.
Reply
#5
(04-27-2010, 10:56 PM)Diablosblizz Wrote: Holy, I wasn't expecting a reply to be honest. Awesome though, I had a hunch that it was cURL. I'll probably most defiantly reply back after I get a trial of cPanel up so I can mess around with THT and cPanel.

Thank you again.

Glad to be of service. Wink
Kevin Mark - TheHostingTool Lead Developer
Reply
#6
So I'm still trying to get cPanel up and running on a box, meanwhile I've taken a look at the code a bit more. At first, for some reason, I wasn't figuring out how cPanel get's the plan. I figure that the plan numbers have to match. So, I'm trying to figure out where THT get's the plan number:

PHP Code:
"&plan="$main->getvar['fplan'] .""

I don't get where getvar is... I'm assuming that $main (which is included each function) is class_main.php, but I can't find a getvar function (again assuming that getvar is a function).

Would it be possible to lead me to the file that $main includes? Thanks.
Reply
#7
$main is included and initialized in /includes/compiler.php It comes from /includes/class_main.php To further answer your question, $main->getvar is an array as apposed to a function or method.
Kevin Mark - TheHostingTool Lead Developer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)