Scripting the panel

Even if the panel's UI is designed to be quick and easy to use, you might want - as a sys admin - to script it in order to get an even higer level of automation.

As everything is stored in a regular MySQL database, one may think importing information in the database is the easiest solution to control the system. But that might not be always relevant as the panel may perform additional tasks after inserting (or modifying) a row in the database.

An easy way script the panel is to re-create the url sent to the system, as all forms uses the GET method (which means that all parameters are easily readable in the URL)

In order to handle authentication, dtc is always adding two parameters to each URL :
- adm_login, which holds you login as a regular, clear text
- adm_pass, which contains a password, which is a number, generated by the system, and variying from one query to the other.
When you log in, you put your real password in the authentication form (the first page), and then the system forwards a dynamically generated pass from one page to the other.

The trick is that you can replace the randomly generated adm_pass by your real password. Obviously, for security reason, you will only want to do that on your localhost or through an ssl connection.

This being said, you can easily reverse engineer any form to automate any action. For example, if you want to create a new email address, here are the parameters :

https://dtc.example.com/dtcadmin/index.php?
adm_login=*mylogin*
adm_pass=*mypass*
addrlink=*mydomain*%2Fmailboxs
edit_domain=$mydomain*
whatdoiedit=mails
newmail_login=*thenewaccountyouwanttocreate*
newmail_redirect1=
newmail_pass=*thepasswordyouwant*
newmail_redirect2=
newmail_deliver_localy=yes
newmail_spam_mailbox=SPAM
addnewmailtodomain=Ok

If everything go right, you'll see a full blown html page as an answer, otherwise, you'll see a text only error message.

Page last modified on October 21, 2007, at 05:57 PM EST