Addition to API

Dark_Wizard

Verified User
Joined
Oct 3, 2006
Messages
47
I would like to see the addition of changing a users package with the API...can this be added?
 
Hm, never noticed it didn't exist. I'd appreciate it being added!
 
After talking, it does exist.

The API is just a browser replacement, all funcitons are the same.
The only difference is that if you use an CMD_API function, the results are parseable.
You can use all regular CMD_anything functions with the API, you just wont get a parseable output.
So, yes, you can set packages.

In the DA interface, the command is CMD_MODIFY_USER .. so we'll lookup CMD_API_MODIFY_USER in the versions system:

http://www.directadmin.com/features.php?id=390

not much documentation with it, but knowing the command is the same as for the interface version, we just look at the html source:
PHP:
<table class=list cellpadding=3 cellspacing=1>
<tr><td class=listtitle colspan=3>Change Package for User freddy</td></tr>
<form action="CMD_MODIFY_USER" method="POST">
<input type=hidden name=action value=package>
<input type=hidden name=user value="freddy">
<tr><td class=list>Set Package to</td><td class=list align=center><select class=selectlclass name=package>
<option selected value="">-- Select Package</option >
<option value="deleteme">deleteme</option >
<option value="newpackage">newpackage</option >
<option value="newpackage26">newpackage26</option >
<option value="newpackage5">newpackage5</option >
</select ></td><td class=list><input type=submit value="Save"></td></tr>
</form>
which would give you:

cmd: CMD_API_MODIFY_USER
method: POST
action=package
user=freddy
package=thepackageyouwant
 
Back
Top