Automatic user creation script with PHP and SOAP

Discussion in 'Installation/Configuration' started by Jose Gosalbez, May 24, 2006.

  1. Jose Gosalbez

    Jose Gosalbez New Member

    I have installed the SOAP addon in ISPCONFIG and after I put the PHP examples in a server directory.

    I have created a remote user with the login "remote" and the pass "remote"

    Mi title for the domain is "Main"

    This is the code I Tried

    /******************************************* */

    include("soap.lib.php");

    // Insert here your 42go Server
    $server_url = "https://localhost:81";

    // creating object for SoapClient
    $soapclient = new soapclient($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' => 'remote',
    'pass' => 'remote');

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

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


    // Add a User
    $params = array ( 'sid' => $session_id,
    'module' => 'web',
    'function' => 'user_add',
    'params' => array ( web_title => 'main', // web_title or web_id
    user_username => 'prueba',
    user_name => 'prueba',
    user_email => 'prueba',
    user_passwort => '123456',
    user_speicher => 10,
    user_mailquota => 10,
    user_admin => 0
    ));

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


    /******************************************************/

    This script doesnt say anything... but the user is not added to "Main" account. Why?

    I have ISPCONFIG 2.2.2.... Need I a upgrade?
     
  2. falko

    falko Super Moderator ISPConfig Developer

    Is the URL correct? Are the username and password correct?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer


    Remoting is not supported by ISPConfig 2.2.2. Only the development releases support remoting yet!

    Before you update to 2.3.1-dev, dont forget to install the libxml2-dev package from your linux distribution, or the upgrade will fail.
     

Share This Page