API & Interface Inconsistency

Discussion in 'Developers' Forum' started by abdi, Oct 3, 2012.

  1. abdi

    abdi Member

    I realized that when creating a client through the API am expected to pass the reseller_id to which this client will belong to. (The Idea is good!)

    However, creating the same client through the web interface, am not required to to select a reseller to whom this client should belong to. This is also not the case when editing the client ...(as admin)

    Isn't this inconsistency?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thats not a inconsistency as clients that belong to a reseller are created in the interface by the reseller and get assigned to this reseller automatically.
     
  3. abdi

    abdi Member

    Thanks for that response ...

    Till am developing a module for AWBS.com billing system with which accounts should be created instantly through API. (I will share it here when its done). I kindly request you to offer me help when ever I will need it.

    If I ask foolish or already answered questions, please have mercy :)

    Also, where do we post suggestions for I know I will have many in this course ...
     
  4. abdi

    abdi Member

    Question #1:

    If I provide template_master can I then NOT pass the rest of the limit varibles? ie

    limit_maildomain (int(11))
    limit_mailbox (int(11))
    limit_mailalias (int(11)) and etc ...
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post feature requests in the bugtracker:

    http://bugtracker.ispconfig.org

    You should be able to payy any variable that is available in the corresponding database table.
     
  6. abdi

    abdi Member

    Till I just realized that despite these 2 being already defined in the template_master I am required (MUST) pass them in the API:

    'web_php_options' & 'ssh_chroot'

    However, all of the variables (including those 2 above) are set to the default of template_master which is good, but again renders those 2 must define variables useless. Thus I think they must be optional just like the rest of the limit variables.
     
    Last edited: Oct 3, 2012
  7. abdi

    abdi Member

    Till, what is the difference between domains_domain_add and sites_web_domain_add
     
  8. abdi

    abdi Member

    Till more problems with API,

    Am getting this error (when I try adding a domain name with sites_web_domain_add):

    data_processing_errorpm_process_idle_timeout_error_regex<br /> pm_max_requests_error_regex<br /> SOAP Error: pm_process_idle_timeout_error_regex
    pm_max_requests_error_regex

    Please help me understand the problem / cause

    Joseph
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Ensure that you passed the correct values for the variables mentioned in the error message as part of the array:

    pm_process_idle_timeout
    pm_max_requests
     
  10. abdi

    abdi Member

    Thanks for that information Till,

    May I suggest you add it to the API documentation specifically on the file "/remoting_client/API-docs/sites_web_domain_add.html"

    You could also add it to the examples give in the example folder ...

    Thanks, Joseph
     
  11. abdi

    abdi Member

    Till, again today I hit a bump ..
    Now my AWBS module is ready and can create clients, domains and email domains all as 1 client known by the billing module.

    What I now need is a user to click a singe button on the billing interface like "Control Panel" then there he would be automatically logged into ISPConfig.

    I have the logins stored with my billing APP so I can easily add them as hidden fields. I have also searched the forums with no success ..

    If its not possible, then do you mind giving me the name of the logged in user SESSION and or what other sessions must be created on successfull user login I could create a script that validates directly with the db if the form redirect fails ..
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look at the file /usr/local/ispconfig/interface/login/index.php if you like to know how a valid ispconfig session is setup.
     
  13. abdi

    abdi Member

    Till, I also did notice that when you rename the database through API, much as it gets renamed in the "web_database" the physical database it self is NOT renamed.

    Is it a bug or is working as expected?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Take a look at the interface, as you see there, the database name is locked and can not be changed after you created it. So the same applies to the api.
     
  15. abdi

    abdi Member

    Client Delete Issues

    Hello Till,

    What is the difference between client_delete and client_delete_everything commands?

    My understanding would be:

    client_delete_everything deletes everything that belongs to that client, and that is sites, domains, email domains, email accounts, databases and ie EVERYTHING

    While client_delete should only delete the client leaving the rest of the information in system ..

    Unfortunatly client_delete_everything does not return anything and ONLY deletes the client leaving the rest of the information like sites in place ..

    Am I missing something?

    Thanks, Joseph
     
  16. abdi

    abdi Member

    Any help over there Till ?

    Also noticed that sites_web_domain_delete command does not return affected rows as indicated in the documentation, just returns nothing ..so you really can't tell if all went well by comparing the return variables.
     
    Last edited: Oct 25, 2012
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    I will check that until the relaese of the final version.
     
  18. abdi

    abdi Member

    Am sorry for the double posting, but since this thread is about API inconsistencies, may I kindly request you to check this too:

    While in the creation of a domain name via API, I do set the following:

    [.....]
    'stats_password' => 'my_password',
    'stats_type' => 'awstats',
    [.....]

    Expecting that Stats will be enabled automatically. Unfortunately, they are NOT. I have again to login to control panel to enable them. Is this how it functions or something missing?

    NB: The /var/www/clients/client30/web49/web/stats/.htpasswd_stats wouldn't be created through API not until enabled through ISPConfig Panel.
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page