Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    2

    Default Accounting.inc.php Functions AND Definitions

    I was wondering what params the php accounting functions have and also if there are also any over what is in the documentation. I have heard of a "whmreq"??

  2. #2
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    Look in the accounting.inc.php file. It's just what's in the docs, but you can make your own functions by looking at the current ones and the way whm works.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    2

    Default

    I cannot access my Accounting.inc.php I can only include it...

  4. #4
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    I think it's ok to post this here. If anyone thinks I should remove it, let me know.

    PHP Code:
    <?php
    # cpanel4 - Accounting.php.inc              Copyright(c) 1999-2002 John N. Koston
    #                                 All rights Reserved.
    # [email]nick@cpanel.net[/email]              [url]http://cpanel.net[/url]
    #
    # This file is governed by the cPanel license


    global $cpanelaccterr;


    function 
    suspend ($host,$user,$accesshash,$usessl,$suspenduser) {
            
    $result whmreq("/scripts/remote_suspend?user=${suspenduser}",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }
    function 
    unsuspend ($host,$user,$accesshash,$usessl,$suspenduser) {
            
    $result whmreq("/scripts/remote_unsuspend?user=${suspenduser}",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }
    function 
    killacct ($host,$user,$accesshash,$usessl,$killuser) {
            
    $result whmreq("/scripts/killacct?user=${killuser}&nohtml=1",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }
    function 
    showversion ($host,$user,$accesshash,$usessl) {
            
    $result whmreq("/scripts2/showversion",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }
    function 
    createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan) {
            
    $result whmreq("/scripts/wwwacct?remote=1&nohtml=1&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=${acctplan}",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }

    function 
    listaccts ($host,$user,$accesshash,$usessl) {
            
    $result whmreq("/scripts2/listaccts?nohtml=1&viewall=1",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }

            
    $page split("\n",$result);
            foreach (
    $page as $line) {
                    list(
    $acct,$contents) = split("="$line);
                    if (
    $acct != "") {
                            
    $allc split(","$contents);
                            
    $accts[$acct] = $allc;
                    }
            }
            return(
    $accts);
    }
    function 
    listpkgs ($host,$user,$accesshash,$usessl) {
            
    $result whmreq("/scripts/remote_listpkg",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }


            
    $page split("\n",$result);
            foreach (
    $page as $line) {
                    list(
    $pkg,$contents) = split("="$line);
                    if (
    $pkg != "") {
                            
    $allc split(","$contents);
                            
    $pkgs[$pkg] = $allc;
                    }
            }
            return(
    $pkgs);
    }
    function 
    whmreq ($request,$host,$user,$accesshash,$usessl) {

    //Not including code here because I don't think it's necessesary.  It should be obvious how this functinon works.

    }

  5. #5
    Member
    Join Date
    Dec 2004
    Location
    Nairobi - Kenya
    Posts
    10

    Default

    Hello

    Is there, or are there functions that relate to email account creation, subdomain creation in the Accounting.inc.php? (I want to create a webpage that allows users to signup for new email accounts)

    Regards

  6. #6
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    Accounting module only works with WHM, not cpanel. Those functions are cpanel functions, not WHM so you can't use it.

    There is a way to automate it with a custom php script by connecting to cpanel. I can write one for you for a fee - PM me with details if you're interested.

  7. #7
    Member
    Join Date
    Dec 2004
    Location
    Nairobi - Kenya
    Posts
    10

    Default

    I can create email addresses by simply sending the same variables to the action file called when creating new emails in cPanel, and so also subdomains. Thanks for your offer elleryjh.

    I just wanted to know if there were functions that has to do with emails, subdomains etc.

  8. #8
    Member
    Join Date
    Dec 2004
    Location
    Chandigarh
    Posts
    109

    Red face Need help with building scripts...

    Hello,

    I need to automate 3 simple tasks for WHM.

    1. Suspend Account
    2. Un-suspend Account
    3. Terminate Account

    Can someone tell me how do i start on this ? I would just be able to provide username and select weather to suspend, unsuspend or terminate the account and it should get done.

    Please help me.

    Thanks.
    Tapan Bhanot,
    Mobile: (091) 9888-488-488
    E-Mail / MSN: tapan@avissoftware.com

    http://www.avissoftware.com
    Low cost web hosting and domain registrations

Similar Threads & Tags
Similar threads

  1. PHP Accounting Functions
    By jlimited in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 12-27-2005, 08:26 PM
  2. Adding functions to Accounting.php.inc
    By giggsey in forum cPanel Developers
    Replies: 2
    Last Post: 08-05-2005, 07:22 AM
  3. Changing user email with PHP Accounting functions
    By remik in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-24-2005, 05:44 PM
  4. Cpanel PHP Accounting functions
    By andyf in forum cPanel and WHM Discussions
    Replies: 38
    Last Post: 02-08-2005, 07:11 PM
  5. Accounting.php.inc functions
    By whiteadi in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-15-2004, 12:14 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube