TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-15-2005, 01:45 PM   #1 (permalink)
The Acquainted
 
Join Date: May 2005
Posts: 106
Thanks: 0
jaswinder_rana is on a distinguished road
Default How to access functions of Cpanel!

Hi,
this is not a question, as you might have thought, but a little insight into how to automatically access functions of Capanel, like creating accounts and accessing accounts.

Cpanel has script(on some servers its class, mainly new ones), which is here
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
on some servers it is Account-class.php.inc, if its a class.

you include this and set up host name and user and access hash for WHM and then you can use any function.
if the file is simple like its not a class. then the following will do
PHP Code:
<?php

require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$host "localhost";
$user "";
$accesshash '';

$accts listaccts($host,$user,$accesshash,0);
print_r($accts);
?>
and if its a class then following would do
PHP Code:
$obj = new accounting();
$obj->host 'localhost';
$obj->user 'root';
$obj->accesshash 'cbff2cf02a6e55b04c9a0eb5d67a6b14
.................................................
75dc188960bb2a008821b34fddf95c02'
;
$accts $obj->listaccts();
print_r($accts); 
So, both above written scripts will list all the domains hosted on that server.
the only difference is the second one is class based.

hope this helps somebody
__________________
---------------------------
Errors = Improved Programming.
Portfolio

Last edited by jaswinder_rana : 07-15-2005 at 06:23 PM.
Send a message via MSN to jaswinder_rana
jaswinder_rana is offline  
Reply With Quote
Old 07-15-2005, 02:54 PM   #2 (permalink)
The Contributor
 
Join Date: Mar 2005
Posts: 81
Thanks: 0
AlEast is on a distinguished road
Default

What versions contain the class file? And is it one or the other or both? If you know, just found it interesting as I wasn't aware of the class.
__________________
NEWEDGE Services, Inc. - Developers of ClientExec
AlEast is offline  
Reply With Quote
Old 07-15-2005, 02:56 PM   #3 (permalink)
The Acquainted
 
Join Date: May 2005
Posts: 106
Thanks: 0
jaswinder_rana is on a distinguished road
Default

Not sure, but the one i used (which had class) is,
WHM 10.1.0 cPanel 10.2.0-R82
CentOS 3.5 i686 - WHM X v3.1.0
__________________
---------------------------
Errors = Improved Programming.
Portfolio
Send a message via MSN to jaswinder_rana
jaswinder_rana is offline  
Reply With Quote
Old 07-15-2005, 05:53 PM   #4 (permalink)
The Contributor
 
Join Date: Mar 2005
Posts: 81
Thanks: 0
AlEast is on a distinguished road
Default

Ok thanks.
__________________
NEWEDGE Services, Inc. - Developers of ClientExec
AlEast is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with cpanel login from my site suley Absolute Beginners 14 07-11-2005 03:03 PM


All times are GMT. The time now is 09:22 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design