Fields like CGI/PHP/Anonymous FTP not passed

Woet

New member
Joined
Feb 2, 2009
Messages
3
I'm using this code:

Code:
$sock->query('/CMD_API_ACCOUNT_USER',
        array(
                'action' => 'create',
                'add' => 'Submit',
                'username' => $value['clientUsername'],
                'email' => $value['clientEmail'],
                'passwd' => $password,
                'passwd2' => $password,
                'domain' => $data['domain'],
                'bandwidth' => $data['bandwidth'],
                'quota' => $data['diskspace'],

                'uvdomains' => 'on',
                'unsubdomains' => 'on',
                'unemails' => 'on',
                'unemailf' => 'on',
                'unemailml' => 'on',
                'unemailr' => 'on',
                'umysql' => 'on',
                'udomainptr' => 'on',
                'uftp' => 'on',
                'aftp' => 'on',
                'cgi' => 'on',
                'php' => 'on',
                'spam' => 'on',
                'cron' => 'on',
                'catchall' => 'on',
                'suspend_at_limit' => 'on',
                'skin' => 'serverFFS'

                'ip' => $dedi,
                'notify' => 'no'
));

The problem is, these options are not actually enabled:
Code:
                'uftp' => 'on',
                'aftp' => 'on',
                'cgi' => 'on',
                'php' => 'on',
                'spam' => 'on',
                'cron' => 'on',
                'catchall' => 'on',
                'suspend_at_limit' => 'on',

Am I doing something wrong?
 
Hello,

It comes down to how a browser sends the data from a form. Our job with the API is to match what the browser sends.

The way a "checkbox" works with a browser, is that when it's checked (enabled) it's name and value are passed.

However, if a checkbox is not enabled (unchecked) then that name is not passed at all. This is how checkboxes work (don't ask me why the do it that way).

So to duplicate that with the API, if you want something that uses a checkbox to be disabled, then you must not pass it to DA at all. No name, no value, nothing.

This is rather quirky, but it's the nature of checkboxes and how they're transmitted by browsers.

John
 
Back
Top