client_update

Discussion in 'Developers' Forum' started by eulet22, Jul 29, 2013.

  1. eulet22

    eulet22 New Member

    Hi all!
    If I do a client_update with the remoting api I come into the following trouble:
    PHP:
    <?php
    error_reporting
    (E_ALL);
    ini_set('display_errors''1');

    require (
    'config.inc.php');

    $client = new SoapClient(null, array('location' => $soap_location,
                                         
    'uri'      => $soap_uri,
                                         
    'trace' => 1,
                                         
    'exceptions' => 1));

    try {
        if(
    $session_id $client->login($username,$password)) {
            echo 
    'Logged successfull. Session ID:'.$session_id.'<br />';
        }

        
    $reseller_id 1;

        
    //static parameters
        
    $client_id 75;

        
    //* Get the client record
        // $client_record = $client->client_get($session_id, $reseller_id);
        
    $client_record $client->client_get($session_id$client_id);
       
    //* Change parameters


        
    $affected_rows $client->client_update($session_id$client_id,      $reseller_id$client_record);

        echo 
    "Number of records that have been changed in the database: ".$affected_rows."<br>";

        if(
    $client->logout($session_id)) {
            echo 
    'Logged out.<br />';
        }

    } catch (
    SoapFault $e) {
        echo 
    '<pre>'.$client->__getLastResponse().'</pre>';
        die(
    'SOAP Error: '.$e->getMessage());
    The update fails with sys_userid and sys_groupid empty error!
    But when I print_r($client_record) the two fields are not empty!
    Here is the output:
    Code:
    db->query(UPDATE `client` SET `company_name` = '', `contact_name` = 'don t delete', `customer_no` = '', `username` = 'dont', `password` = '$1$5TdFZS9r$t3n/mSLt2IGvoS5tW.LDe0', `language` = 'de', `usertheme` = 'default', `street` = '', `zip` = '', `city` = '', `state` = '', `country` = 'DE', `telephone` = '', `mobile` = '', `fax` = '', `email` = '[email protected]', `internet` = 'http://', `icq` = '', `vat_id` = '', `company_id` = '', `bank_account_owner` = '', `bank_account_number` = '', `bank_code` = '', `bank_name` = '', `bank_account_iban` = '', `bank_account_swift` = '', `notes` = '', `paypal_email` = '', `template_master` = '4', `template_additional` = '', `default_mailserver` = '1', `limit_maildomain` = '-1', `limit_mailbox` = '-1', `limit_mailalias` = '-1', `limit_mailaliasdomain` = '-1', `limit_mailmailinglist` = '-1', `limit_mailforward` = '-1', `limit_mailcatchall` = '-1', `limit_mailrouting` = '0', `limit_mailfilter` = '-1', `limit_fetchmail` = '-1', `limit_mailquota` = '-1', `limit_spamfilter_wblist` = '0', `limit_spamfilter_user` = '0', `limit_spamfilter_policy` = '0', `default_webserver` = '1', `limit_web_domain` = '-1', `limit_web_quota` = '-1', `web_php_options` = 'no,fast-cgi', `limit_cgi` = 'n', `limit_ssi` = 'n', `limit_perl` = 'n', `limit_ruby` = 'n', `limit_python` = 'n', `force_suexec` = 'y', `limit_hterror` = 'n', `limit_wildcard` = 'n', `limit_ssl` = 'n', `limit_web_aliasdomain` = '-1', `limit_web_subdomain` = '-1', `limit_ftp_user` = '-1', `limit_shell_user` = '0', `ssh_chroot` = 'no', `limit_webdav_user` = '0', `default_dnsserver` = '1', `limit_dns_zone` = '-1', `limit_dns_slave_zone` = '-1', `limit_dns_record` = '-1', `limit_client` = '0', `default_dbserver` = '1', `limit_database` = '-1', `limit_cron` = '2', `limit_cron_type` = 'url', `limit_cron_frequency` = '5', `limit_traffic_quota` = '-1', `limit_openvz_vm` = '0', `limit_openvz_vm_template_id` = '0', `limit_aps` = '-1', `sys_userid` = , `sys_groupid` =  WHERE client_id = 75) called at [/usr/local/ispconfig/interface/lib/classes/remoting.inc.php:2913]
    
    Thx for your help!
    Paul
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you have a reseller with ID 1?
     
  3. eulet22

    eulet22 New Member

    It also doesn't work with reseller id=0 (I don't have any resellers)

    Thx
    Paul
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you dont have any resellers, then reseller_id has to be 0.

    And you are sure that there is a client in the "client"database table were client_id = 75?
     

Share This Page