Zubrag.com :: Forum

zubrag.com => Questions About Our Scripts => Topic started by: hws on March 28, 2009, 07:31:10 PM



Title: Addon creator script problems and how to delete these
Post by: hws on March 28, 2009, 07:31:10 PM
Hi,

My code is as follows:

Code:
$username = $_POST['username'];
$password = $_POST['password'];
$domain = $_POST['domain'];
$domprefix = $_POST['domprefix'];
// Creating cPanel main account Variables
// cPanel username
$cpanel_user = "******";
// cPanel password
$cpanel_password = "******";
// cPanel host
$cpanel_host = "******";
// cPanel theme/skin, usually "x"
$cpanel_skin = "x";
// Path to cURL on your server
$curl_path = "/usr/bin/curl";

// Set Up The Customer's Web Hosting Account
$database = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$username'");
$adduser = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adduser.html?user=$username&pass=$password'");
$asignuser = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/addusertodb.html?user=$cpanel_user_$username&db=$cpanel_user_$username&ALL=ALL'");
$dom = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/addon/doadddomain.html?domain=$domain.$domprefix&user=$domain&pass=$password'");
$ftp = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/ftp/doaddftp.html?login=$username&password=$password&homedir=$subdomain&quota=500'");
$popmail = exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/mail/doaddpop.html?email=$username&domain=$subdomain.your primary domain&password=$password&quota=20'");

However, i'm am currently using this script and it works fine but for some small things.

Firstly, after this script is run i check my cpanel and seen that the username typed in from the script has added to my domain (main hosting account) email address and not the domain (addon domain) email address that was added from the script. Is this normal?

Secondly, it the same for the database.

Finally, how do i use a delete from these if i want to cancel the account inserted.