Web Hosting Talk







View Full Version : cPanel website integration


gudzon
10-26-2006, 05:44 PM
Hello,

I'm using cPanel with Rvskin on my servers. I wonder whether it's possible somehow to integrate cPanel with my own website, so user could login and manage hosting from my own interface. I know I can add my own pages to Rvskin, but I'd like to have more than this. Are there some kind of APIs to use? If this is not possible with cPanel, perhaps any other panel provides this?

I would appreciate your advice.

Thank you,

Peter

foobic
10-26-2006, 07:56 PM
For CPanel the choice is between remote-access keys or using curl (or similar) with your password stored in plain text. Keys are obviously more secure but functions are limited to what's in the remote access API (although you can extend this if you're keen):
http://www.cpanel.net/remoteaccess.html
http://www.cpanel.net/remoteaccess-php.html

Also check out the CPanel forum - Backend/Scripts.

HTH

gudzon
10-26-2006, 08:46 PM
Thank you. I saw this, it's very limited.

foobic
10-26-2006, 09:18 PM
True, but it can be extended to do anything you would normally do through WHM by using the key-based authentication routines with your own form data. For example, I have a script to update a dns zone this way. I assume the same approach would work with CPanel commands, though I haven't tried this yet.

insanelymacintosh
10-27-2006, 03:06 AM
What exactly were you looking to integrate? The short answer is yes you can do it, but it will take some tricky PHP programming.

gudzon
10-29-2006, 03:26 PM
Thank you.

Ideally I would like to integrate all functions to my website, but, as you said, this could be tricky. At least I'd like my clients to be able to login to their control panels from my website.

Thanks,

Peter

foobic
10-29-2006, 05:48 PM
Ok, that's a different thing altogether. If you search there are some old login scripts around but they relied on redirecting with the old url syntax username:password@server.example.com - insecure and no longer works on MSIE.

I'd suggest you just put a form on your page submitting direct to the CPanel login, eg.

<form action="https://server.example.com:2083/login/" method="POST">
<p>Username: <input type="text" name="user" /></p>
<p>Password: <input type="password" name="pass" /></p>
<p><input type="submit" value="Login" /></p>
</form>
HTH

gudzon
10-29-2006, 05:52 PM
Thank you, I'll try this.