#1 (permalink)  
Old 07-09-2009, 12:33 PM
Registered User
 
Join Date: Jul 2009
Posts: 19
paulipv is on a distinguished road
XML-API 1.0 beta

We have finished a beta that including the Accounting actions.

We have attached the code for testing.

Available functions:

1. createacct($array) -> create new account (see examples.php for a demo).
2. accountsummary($user) -> return account details
3. modifyacctdomain($user , $newdomain , $currentdomain=optional) modify the username primary domain
4. modifyacctuser($current_user , $new_user) -> changing the current username

5. editquota($user , $newquota) -> modify user quota
6. changepw($user , $pass=optional) -> change user password (if you dont set the pass, a new password 8char will be generated.

7. suspendacct($user , $reason) -> suspend an account
8. unsuspendacct($user) -> unsuspend account
9. removeacct($user , $keepdns) -> remove an account
10. listacct() -> list all server accounts
11. searchacct($search, $searchtype) -> allowed search types, domain,owner, user, ip, package.

12. changeacctpackage($user,$newpackage) -> not working at the moment.

so please ask if you dont understand something.
have any idea? just say it and if its ok we will implement it.

@see examples.php for a account creation demo.


Every function will return an array which looks like:

PHP Code:

  
// Example of change account password.
 
$result $instanceofclass->accounting()->changepw('myuser','mypass');

 if (
$result['status'] == 1) {
 echo 
'Password succesfully changed';
 echo 
'New pass '.$result['set']['pass'].' ';
 
}



Array
(
    [
obj] => changepw
    
[server] => 1.1.1.1
    
[time] => 1247156381
    
[date] => 2009-07-09 19:19:41
    
[remote_addr] => 192.168.0.1
    
[set] => Array
        (
            [
username] => myuser
            
[pass] => mypass
        
)

    [
get] => Array
        (
            [
rawout] => Changing password for myuser Password for myuser has been changed Updating ftp passwords for myuser Ftp password files updatedFtp vhost passwords synced

            
[app] => postgresql
            
[services] => 
            [
status] => 1
            
[statusmsg] => Password changed for user myuser
        
)

    [
status] => 1
    
[statusmsg] => Password changed for user myuser



listacct() returns something like this:

access a user from list simple
$result['get']['username']


PHP Code:
Array
(
    [
status] => 1
    
[statusmsg] => Ok
    
[obj] => getacctlist
    
[server] => central.ipvhost.ro
    
[time] => 1247157066
    
[date] => 2009-07-09 19:31:06
    
[remote_addr] => 192.168.0.1
    
[get] => Array
        (
            [
myuser] => Array
                (
                    [
disklimit] => unlimited
                    
[diskused] => 0M
                    
[domain] => mydomainblog.com
                    
[email] => myname@myemail.com
                    
[ip] => 1.1.1.1
                    
[maxaddons] => unlimited
                    
[maxftp] => unlimited
                    
[maxlst] => unlimited
                    
[maxparked] => unlimited
                    
[maxpop] => unlimited
                    
[maxsql] => unlimited
                    
[maxsub] => unlimited
                    
[owner] => root
                    
[partition] => home
                    
[plan] => WHM-IPV
                    
[startdate] => 09 Jul 09 19:01
                    
[suspended] => 0
                    
[suspendreason] => not suspended
                    
[suspendtime] => 
                    [
theme] => x3
                    
[unix_startdate] => 1247155314
                    
[user] => myuser
                    
[acct] => 
                )

            [
myuser1] => Array
                (
                    [
disklimit] => unlimited
                    
[diskused] => 0M
                    
[domain] => mydomainblog.com
                    
[email] => myname@myemail.com
                    
[ip] => 1.1.1.1
                    
[maxaddons] => unlimited
                    
[maxftp] => unlimited
                    
[maxlst] => unlimited
                    
[maxparked] => unlimited
                    
[maxpop] => unlimited
                    
[maxsql] => unlimited
                    
[maxsub] => unlimited
                    
[owner] => root
                    
[partition] => home
                    
[plan] => WHM-IPV
                    
[startdate] => 09 Jul 09 19:01
                    
[suspended] => 0
                    
[suspendreason] => not suspended
                    
[suspendtime] => 
                    [
theme] => x3
                    
[unix_startdate] => 1247155314
                    
[user] => myuser1
                    
[acct] => 
                )

        )


Attached Files
File Type: zip WHM.zip (5.8 KB, 9 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
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

BB 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
xml-api/accountsummary monaghan cPanel and WHM Discussions 4 06-25-2008 04:57 PM
XML-API is any of these possible? neo4242002 Developer Discussions 3 03-17-2008 02:46 PM
xml-api connection eugui Developer Discussions 1 02-20-2008 01:00 PM
XML API: always get login screen, not XML sldff3ald Developer Discussions 3 09-19-2007 10:29 AM
How do I use the xml - api? rhopperger Developer Discussions 3 05-19-2007 09:07 AM


All times are GMT -5. The time now is 09:46 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc