Getting remoting framework working

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

  1. catdude

    catdude ISPConfig Developer

    I'm running ISPConfig 2.2.13 on Debian Sarge. Last night I rebuilt PHP to include the XML functions, installed the IONCube loader, and downloaded and installed the Remoting Framework.

    I also downloaded and unzipped the example code, copied "test.php" into "test2.php" and uncommented just the "Get Client" section, setting the kunde_title to the name of one of my configured clients.

    soap.lib.php and test2.php were copied into the doc root dir of one of my installed clients (www.varmints.us). I then went to http://www.varmints.us/test2.php. The script ran for a few seconds then terminated with a 500 error.

    Should I be able to run this script from the command line? When I execute "/home/ispconfig/php/bin/php ./test2.php" I get:

    Fatal error: Cannot redeclare class soapclient in /its/isp/hosted/web212/web/soap.lib.php on line 4101

    In that domain's error log I see:
    [Wed Aug 15 08:11:01 2007] [error] [client 69.66.10.200] FastCGI: comm with (dynamic) server "/its/isp/hosted/web212/fcgi/.php-fcgi-starter" aborted: (first read) idle timeout (30 sec)
    [Wed Aug 15 08:11:01 2007] [error] [client 69.66.10.200] FastCGI: incomplete headers (0 bytes) received from server "/its/isp/hosted/web212/fcgi/.php-fcgi-starter"

    I am reasonably new to ISPConfig, and am new to PHP. Ponters on what I might be doing wrong would be most welcome.
     
  2. catdude

    catdude ISPConfig Developer

    Working now

    Was a PHP config error. I was compiling the SOAP library into PHP, so loading the SOAP library again was causing an error. Working great now!

    One remaining question: I'm loving the SOAP interface - very helpful. Looking at the functions available to work with user records, I see user_list which returns info on a user if passed web_title or web_id, and user_get, which returns info if passed user_username or user_id. Is the a function similar to user_list that will return a list of all the users defined in ISPConfig?
     
  3. till

    till Super Moderator

    The function user_list returns the information for all users of a website while the function user_get returns only the details for just one user.
     
  4. catdude

    catdude ISPConfig Developer

    Function user_list in remoting framework

    Oh, that's cool! Then I have a question about the calling convention for that function.

    In the example provided in the remoting_example zip file, the example code for that function is:

    // User List
    $params = array ( 'sid' => $session_id,
    'module' => 'web',
    'function' => 'user_list',
    'params' => array ( web_title => 'test5.de' // web_title or web_id
    ));

    I modified that code by setting the web_title param to the title of one of my existing web sites. The code then gave me user info for every user defined within that client. What would I put in the "params" argument if I wanted to see all users for all clients defined in ISPConfig?
     
  5. till

    till Super Moderator

    There is no function to list all users from all websites.

    a) What you can do is to get a list of all websites on your server with the function:

    web_list

    and the parameter:

    'params' => array ( reseller_title => 'all' )

    and then iterate trough the website records and cll the user_list function for every website to get the users of the site.

    b) Or you modify the function user_list in the file /home/admispconfig/ispconfig/lib/classes/ispconfig_web.lib.php to return you all users when you set e.g. web_title = 'all' as the web_list function implements it already.
     

Share This Page