[Newbie] Remote API Scripts For ISPConfig 3

Discussion in 'Installation/Configuration' started by hichichachac, May 19, 2015.

  1. till

    till Super Moderator Staff Member ISPConfig Developer

    This means that there is a code error in that file, try this:

    PHP:
    <?php

    /*
    $domain_id = $client->sites_ftp_user_add($session_id, $client_id, $params_ftp);
    */
    $params = array( 'server_id' => '1',
    'parent_domain_id' => $domain_id,
    'username' => $myusername,
    'password' => $mypassword,
    'quota_size' => '-1',
    'active' => 'y',
    'uid' => 'web'.$domain_id,
    'gid' => 'client'.$client_id,
    'dir' => '/var/www/clients/client'.$client_id.'/web'.$domain_id,
    'quota_files' => '100',
    'ul_ratio' => '-1',
    'dl_ratio' => '200',
    'ul_bandwidth' => '-1',
    'dl_bandwidth' => '100',);



    $username 'xxx';
    $password 'yyy';
    $soap_location 'https://ip-address:8080/remote/index.php';
    $soap_uri 'https://ip-address:8080/remote/';


    $client = new SoapClient(null, array('location' => $soap_location,

    'uri' => $soap_uri));
    try {
    //* Login to the remote server
    if($session_id $client->login($username,$password)) {
    echo 
    'Logged into remote server sucessfully. The SessionID is '.$session_id.'';
    }


    //* Logout
    if($client->logout($session_id)) {
    echo 
    "FTP Created";
    }

    } catch (
    SoapFault $e) {
    die(
    'SOAP Error: '.$e->getMessage());
    echo 
    "Please contact the server administator";
    }
    ?>
     
    hichichachac likes this.
  2. hichichachac

    hichichachac New Member

    After changing back as your advice, it seems to have run.
    In browser, infomation is "Logged into remote server sucessfully. The SessionID is f3c45ebedbc0f6a791e62c0653dadce2FTP Created", it seem simple:eek:?
    But in error.log of apache, still have the following error message:
    "PHP Notice: Undefined variable: domain_id in /var/www/html/index.php on line 7
    PHP Notice: Undefined variable: myusername in /var/www/html/index.php on line 8
    PHP Notice: Undefined variable: mypassword in /var/www/html/index.php on line 9
    PHP Notice: Undefined variable: domain_id in /var/www/html/index.php on line 12
    PHP Notice: Undefined variable: client_id in /var/www/html/index.php on line 13
    PHP Notice: Undefined variable: client_id in /var/www/html/index.php on line 14
    PHP Notice: Undefined variable: domain_id in /var/www/html/index.php on line 14"
    What do you think, Till?
     
  3. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    I have to be honest with you: If you don't know what those messages mean and where they come from, you should think about hiring a programmer to create a script for your needs.
    This will lead nowhere …
     
    hichichachac likes this.
  4. hichichachac

    hichichachac New Member

    Hi Till,
    You can share practical experiences with API is made available so it should integrate more functionality into ISPConfig or write a new application to perform some desired functionality through the API has been provided? With new bie as me.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    The api is made to connect other applications or your website with ispconfig, to perform tasks automatically in ispconfig, to control ispconfig remotely, to sync data with ispconfig and to import and export data into ispconfig. Almost all ll tasks that can be done within ispconfig interface can also be done from the api. One example is the ispconfig whmcs extension that controla ispconfig remotely from whmcs or the ispconfig roundcube plugins that allows roundcube to show and later mailfilters, autoresponders, email passwords etc.
     
    hichichachac likes this.
  6. hichichachac

    hichichachac New Member

    Thanks Till.
    I have one other question that need you advise: if i use a resever proxy server for my websites, isp config will be used in this model somehow? whether we should integrate resever proxy to ispconfig or not?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    hichichachac likes this.
  8. hichichachac

    hichichachac New Member

  9. till

    till Super Moderator Staff Member ISPConfig Developer

    We dont have any documents on that third party addon.you might want to ask its author at github if he has one.
     
  10. hichichachac

    hichichachac New Member

    Thanks Till, i wil try discover it.
    I have a question follow: I understand that ispconfig allow we can create and redirect one web site to another web site or to a specific directory on the same server, but don't support redirect to web site on another server, is it correct?

    I'm thinking that ispconfig module for reverse proxys don't support to do this work :(
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    A redirect and a proxy are different things. you can use any kind of redirect in ispconfig that is supported by apache and nginx, so you can redirect to a local directory or to a different server in ISPConfig.

    Prxying is not a redirect, a proxy fetches content from another server and delivers it.
     
    hichichachac likes this.
  12. hichichachac

    hichichachac New Member

    Thanks Till,

    So after one web site has created on ispconfig, i can config redirect it to another web site on another server, that's right? And how do it?
     
    Last edited: Jul 17, 2015
  13. hichichachac

    hichichachac New Member

    The problem above has resolved, i tried and it'ok, thanks Till.
     
  14. hichichachac

    hichichachac New Member

    Hi Till,
    I have a question about conf and conf-custom,the difference between them?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Files in conf-custom override files in conf and they don't get overwritten on updates.
     
    hichichachac likes this.
  16. hichichachac

    hichichachac New Member

    So if i want modify one file on conf folder, i shoul copy it to conf-custom folder and modify at here, that's right?
     
  17. hichichachac

    hichichachac New Member

    Hi Till,
    If i'm learning about writing plugin for ispconfig, Can you give me a document to guide about plugin of ispconfig? (example i want to know objects, funtions are used to write plugin somewhere?)
     
  18. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no tutorial available on that topic. You should take a look at the code of the existing plugins.
     
  19. Ilko

    Ilko New Member

    Hi, I see Till was talking about ispconfig whmcs extension above. I tried searching for this but could not find it. Can you please give me a link so I can take a look into it. Sounds interesting.
    Thank you in advance.
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page