CMD_MODIFY_USER, no document found

nieuwhier

Verified User
Joined
Sep 8, 2005
Messages
280
Location
Netherlands
Hi all,

I am trying to add a domain to a user. For that I want to enable unlimited domains, then add the domain, and after that i want to disable unlimited domains.

Adding a domain does work but I have problems changing the user throught the API. I am not sure if it is allowed only to change one item of the user ?

Find the code below.
Regards,
michel.

$Socket->query('/CMD_MODIFY_USER',
array('action' => 'customize',
'user' => $user,
'uvdomains' => 'OFF'));
 
Ok... one step further. I can change several attributes of the client (i still get the error: document not found but it works).

Concerning the uvdomains attribute :
I can change it to ON. It does not matter wich value I give as parameter. It always goes to on. The trick now is how to switch it off because the parameter OFF does not work :confused:
 
Nice talking to myself :D Well I hope someone else can use the information i post.

Ok, changing the unlimitted in limitted is not possible. The api does work different then when I do it manually. I think the api is more correct becase when I change it to limited manually than the number of domains will be zero wich is incorrect.

I now calculate the number of domains a user have and adds one to it and writes it to vdomains. That works fine for me now.
 
I'm posting only to point out that you can't really expect much in the way of replies in such a short timeframe; the forums aren't quite THAT active.

Jeff
 
Hello,

Try this command instead:
CMD_API_MODIFY_USER

It uses the same parameters as CMD_MODIFY_USER.

If you're settng the error while viewing CMD_MODIFY_USER through a browser, then either the file isn't there (or it's not readable), or the skin you're using doens't have the file in the files_reseller.conf file.

On a side note.. if you don't pass all the parameters as mentioned in http://www.directadmin.com/api.html#modify (for CMD_MODIFY_USER) .. things like php, ssl, cgi,dnscontrol etc.. will all end up being turned off becaus they're checkboxes... a non-existant checkbox in a form means "off".

John
 
Oeps you're right. The settings of checboxes are indeed empty now. And I was so happy that it worked now.

Perhaps when I explain what I am trying to do you'll have an advice:
My users are not allowed to add domains theirselfs. Therefore maximum number of domains should always be the same as the number of domains. But when I add a domain through the api I should add one first before adding the domain.

Isn't there a way that the admin can add domains to a user without the check on maxdomains ?
 
It's kind of a workaround but it works for me.

1) I add one to max number of domains
2) I add the domain
3) I submit the packet to the user again(we have no custom packages)
4) it works!!!

$Socket->query('/CMD_API_MODIFY_USER',
array('action' => 'package',
'user' => $user,
'package' => $package));
 
Back
Top