Remoting in 2.3.2 does not create user in sys_user table

Discussion in 'General' started by NTAuthority, Jun 28, 2007.

  1. NTAuthority

    NTAuthority New Member

    After creating an client script to add a client, and a web for the client:

    PHP:
            include("soap.lib.php");

    // Insert here your 42go Server
    $server_url "http://www.xxxxx.net:81";

    // creating object for SoapClient
    $soapclient = new soapclient2($server_url.'/remote/index.php');

    // Username and Password of the remoting user (not identical
    // with the user to log into the web interface!)

    $parameters = array('user' => 'Bas',
                        
    'pass' =>  'xxxxx');

    // Login into 42go Server
    $session_id $soapclient->call('login',$parameters);

    // var_dump($session_id);

    // Error Check
    if($err $soapclient->getError()) die("Error: ".$err);

    $params = array (         'sid'        => $session_id,
                                            
    'module'         => 'kunde',
                                            
    'function'         => 'kunde_get',
                                            
    'params'        => array ( kunde_title => $userdata['username']));


    $kunde $soapclient->call('service',$params);

    if (!isset(
    $kunde['kunde_title'])) {

    // Error Check
    // if($err = $soapclient->getError()) die("Error: ".$err);

            
    $params = array (         'sid'        => $session_id,
                                            
    'module'         => 'kunde',
                                            
    'function'         => 'kunde_add',
                                            
    'params'        => array (         reseller_title => 'admin',
                                    
    kunde_title => $userdata['username'],
                                    
    kunde_anrede => 'Firma',  // Herr, Frau, Firma
                                    
    kunde_firma => 'dotbas.net client',
                                    
    kunde_vorname => $userdata['username'],
                                    
    kunde_name => 'Client',
                                    
    kunde_strasse => 'Straat',
                                    
    kunde_plz => 'Plaats',
                                    
    kunde_ort => 'Stad',
                                    
    kunde_land => 'Europa',
                                    
    kunde_telefon => '0123-456789',
                                    
    kunde_fax => '',
                                    
    kunde_email => $userdata['user_email'],
                                    
    kunde_internet => 'http://' $hostname,
                                    
    webadmin_user => $userdata['username'],
                                    
    webadmin_passwort => $_SESSION['wizarddata']['password'],
                                    
    kunde_province => 'Ergens'
                                    
    ));

    $kunde_id $soapclient->call('service',$params);
    // if($err = $soapclient->getError()) die("Error: ".$err);

    }
    $params = array (         'sid'        => $session_id,
                                            
    'module'         => 'web',
                                            
    'function'         => 'web_add',
                                            
    'params'        => array (         kunde_title => $userdata['username'], // reseller_title or reseller_group
                                    
    web_title => $hostname,
                                    
    web_host => $prefix,
                                    
    web_domain => substr($domain1),
                                    
    web_ip => '192.168.13.53',
                                    
    web_speicher => $dlim// MB
                                    
    web_dns => 0,
                                    
    web_userlimit => $flim,
                                    
    web_domainlimit => $slim,
                                    
    web_shell => 0,
                                    
    web_cgi => 1,
                                    
    web_standard_cgi => 1,
                                    
    web_php => 1,
                                    
    web_php_safe_mode => 0,
                                    
    web_ssi => 1,
                                    
    web_ftp => 1,
                                    
    web_frontpage => 0,
                                    
    web_mysql => 1,
                                    
    web_mysql_anzahl_dbs => $mlim,
                                    
    web_ssl => 0,
                                    
    web_anonftp => 0,
                                    
    web_anonftplimit => 0,
                                    
    web_wap => 0,
                                    
    web_individual_error_pages => 1
                                    
    ));

    $web_id $soapclient->call('service',$params);
    if(
    $err $soapclient->getError()) die("Error: ".$err);
    This script does not work correctly, as adding the web gives an:

    Error: Client: Parameter: cannot find client.

    This is because webadmin_userid is equal to 0 in isp_isp_kunde, which is because it is not set, and an user in sys_user is also not created.

    Is there an fix for this problem? :)

    -- Bas
     

Share This Page