Automating dreamhost panel

software development

#1

i want my users who i provide hosting for, to be able to edit dns, email address etc for there specific accounts. The problem is these people i dont trust to not “mess up” the panel settings which are already in place so allowing them access via ‘Account Privileges’ is not really an option.

Ill probably end up having to fix stuff myself

Is it allowed to automate dreamhost panel using CURL and if it is, why doesn’t it work

i purposefully left out the login process which i know works…

heres a simple example of editing bulk email just as a test, but it does not work

$url = “https://panel.dreamhost.com/index.cgi”;

$crl = curl_init();
curl_setopt($crl, CURLOPT_COOKIEFILE, “cookie.txt”);
curl_setopt($crl, CURLOPT_COOKIEJAR, “cookie.txt”);
curl_setopt($crl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crl, CURLOPT_POST, 1);
curl_setopt($crl, CURLOPT_HEADER, 1);
curl_setopt($crl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($crl, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($crl, CURLOPT_USERAGENT, “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)”);
curl_setopt($crl, CURLOPT_REFERER, “https://panel.dreamhost.com/index.cgi?tree=mail.addresses&current_step=Index&next_step=Bulk”);
curl_setopt($crl, CURLOPT_URL, $url);

$postdata = array(“tree”=>“mail.addresses”,
“domains”=>“mydomain.com”,
“current_step”=>“Bulk”,
“next_step”=>“BulkFinal”,
“text”=>"Email@email.com somebody@someplace.com");

curl_setopt ($crl, CURLOPT_POSTFIELDS, $postdata);

$result=curl_exec($crl);
$headers = curl_getinfo($crl);
print_r($headers);
print $result;


#2

Did you see the other threads related to this subject in these forums? :wink:

–rlparker