Using user_add function from remote Framework

Discussion in 'Installation/Configuration' started by catdude, Aug 16, 2007.

  1. catdude

    catdude ISPConfig Developer ISPConfig Developer

    I have created a client, "Dan M test", on my ISPConfig machine. This client was assigned client #462. I am calling the SOAP interface with:

    $params = array ( 'sid' => $session_id,
    'module' => 'web',
    'function' => 'web_get',
    'params' => array( web_title => '', // Reseller1, admin, all

    and getting back:
    [web_title] =>
    [doc_id] => 382
    [doctype_id] => 1013
    [web_host] => www
    [web_domain] =>
    <snipped for space>
    [web_ip] =>
    [server_id] => 1
    [optionen_mysql_user] => web382
    [optionen_mysql_passwort] =>
    <snipped for space>
    [web_id] => 382

    I also defined an e-mail address, [email protected]. I can fetch this user's settings using:
    $params = array ( 'sid' => $session_id,
    'module' => 'web',
    'function' => 'user_get',
    'params' => array( user_username => 'varmints.us_dan', // Reseller1, admin, all
    which returns:
    [doc_id] => 362
    [doctype_id] => 1014
    [user_username] => varmints.us_dan
    [user_passwort] =>
    <snipped for space>
    [user_name] => Dan M
    [status] =>
    [user_id] => 362

    Now I am trying to add an e-mail address, [email protected]. The code I'm trying to use is:
    $params = array( 'sid' => $session_id, 'module' => 'web',
    'function' => 'user_add',
    'params' => array(
    web_id => 382,
    user_username => 'varmints.us_test',
    user_name => 'test',
    user_email => 'test',
    user_passwort => 'test',
    user_speicher => 100,
    user_mailquota => 100 ,
    user_admin => 0
    When I run this code it does not produce an error message. However, when I log into ISPConfig and look at I only see the [email protected] user. I get the same result if I replace web_id => 382 with web_title => ''.

    It appears that I'm misunderstanding something about the user_add function. Could someone please tell me what I'm doing wrong?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I can't see a error in your code. Is a line for the user varmints.us_test added to the database table isp_isp_user ?
  3. catdude

    catdude ISPConfig Developer ISPConfig Developer

    SOAP interface not adding user

    No, there's not.
    mysql> select user_username, user_name from isp_isp_user where user_username like 'varmint%';
    | user_username | user_name |
    | varmints.info_dan | My User |
    | varmints.us_brian | Brian |
    2 rows in set (0.00 sec)

    That 2nd user was added by one of my coworkers for testing purposes.
  4. catdude

    catdude ISPConfig Developer ISPConfig Developer

    An additional lead...

    I am looking now at ispconfig_web.lib.php. In function user_add I see that the fields user_speicher and user_mailquota must be defined or an error mesage will be generated.

    I added those fields to my call, and I'm still not seeing the user added. The new user is not in isp_isp_user.

    I also put together a script to add a client. That to does not report any errors, but doesn't add the client. It looks like I can do lists and gets of the various categories fo data, but can't add records via the Remoting Framework.

Share This Page