3.1 Remote API - client_add: sys_user insert fails if client parameter 'usertheme' is empty
When registering a client using the remote API: client_add($session_id, $reseller_id, $params)
with the parameter 'usertheme' empty, the client gets inserted,
but the
remoting.inc.php: klientadd(...): $app->remoting_lib->ispconfig_sysuser_add($params, $insert_id);
call will produce a silent database error (Column 'app_theme' cannot be null), and so the sys_user record will not be created.
This is particularly dangerous, because of all the remote API calls:
sites_web_domain_add($session_id, $client_id, $params)
sites_ftp_user_add($session_id, $client_id, $params)
sites_database_add($session_id, $client_id, $params)
- etc...
These records will be generated with the wrong sys_userid and sys_groupid values, because the provided $client_id doesn't exist in the sys_user and sys_group tables.
Providing the 'usertheme' parameter with 'default' value solves this problem, but the API should raise an error, or fill this parameter if empty.