DB relations

Discussion in 'General' started by bin-online, Apr 25, 2006.

  1. bin-online

    bin-online New Member

    Hi I want to write an extension for typo3 to work with ispconfig.
    But i am not able to find anything to the db relation! I want to read out the domain names of this web and as input i have an username like web1_1.

    Can anbody say me wich are the links between the tables?

    Thank you for your help

    Eric
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which relation do you mean? Website to database or website to co-domain?
     
  3. bin-online

    bin-online New Member

    user --> domains

    I have the admin user and I want a list of all domains in this web.
    I tried it with the remote plugin but i find any way to get this informations out.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I assume you mean the admin system user, not db user?

    To get all domains of a website, you will have to query the DB directly.

    The tables isp_isp_user and isp_isp_web are connected by the isp_dep table.

    Try a query like this to get the main domain:

    Code:
    select doc_id, web_host, web_domain from isp_isp_web, isp_dep, isp_isp_user where isp_isp_web.doctype_id = isp_dep.parent_doctype_id and isp_isp_web.doc_id = isp_dep.parent_doc_id and isp_isp_user.doctype_id = isp_dep.child_doctype_id and isp_isp_user.doc_id = isp_dep.child_doc_id and isp_isp_user.user_username = 'web1_admin'
    To get the co-domains of a website where you know the main domain, you can use this query:

    Code:
    SELECT  domain_host,domain_domain  FROM isp_isp_web, isp_dep, isp_isp_domain WHERE isp_isp_web.doctype_id = isp_dep.parent_doctype_id AND isp_isp_web.doc_id = isp_dep.parent_doc_id AND isp_isp_domain.doctype_id = isp_dep.child_doctype_id AND isp_isp_domain.doc_id = isp_dep.child_doc_id AND isp_isp_web.web_domain =  'yourdomain.com' AND isp_isp_web.web_host =  'www'
     
  5. smartcall

    smartcall New Member

    More queries

    This is a great thread!

    I would like to learn some more.

    I need to create users, webs and resellers from within another application without using the remoting framework. I find this approach applicable in my case.

    So the questions are:

    1. Query to create a client with all corresponding attributes (mainly the personal data and login information) and a way to trigger the salutatory email, once the login information is there.

    2. Query to create web for a client with a particular hostingplan, hostname, IP address, DNS and MX. Invoice entry for the web. And a way to trigger the creation of the web and DNS entries.

    3. Creation of sub-web, not co-domain, for already existing web.

    4. Query to create invoices.

    5. Creation of a reseller with all corresponding limits and personal information and a way to trigger the salutatory email, once the login information is there.

    That would be a great deal of information. I would be very gratefull if you give it to the community.

    Thanks.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    What you want requires several thousand lines of code. Please have a look at the ISPConfig sources, I'am willing to help you if you have a specific question but i dont have the time to write you a complete second remoting framework here in the thread.
     

Share This Page