Do you have a master reseller? But, THT only supports the root way of making resellers.
If you have WHMPHP, your in luck!!
First, open THTROOT/includes/servers/whm.php
After the comments, add
We put it one directory below because it will be included twice when you make a server.
Find:
Add After:
Find:
Replace Function With:
Find:
Replace Function With:
Find:
Replace Function With:
Find:
Replace Function With:
Download Attachment
Place in: THTROOT/includes/
Your resellers must user the server ID 1. If you have to, switch the server id.
You will need 2 servers of the same details.
One with ID 1 for WHMPHP, one with another ID for whm.
Feel free to IM me for support:
[email protected]
[email protected]
jerryinchost (Yahoo)
ismywb (Skype)
edit: forgot to attach whmphp.php
If you have WHMPHP, your in luck!!
First, open THTROOT/includes/servers/whm.php
After the comments, add
PHP Code:
require_once('THTPATHFULL/includes/whmphp.php');
We put it one directory below because it will be included twice when you make a server.
Find:
PHP Code:
private $server;
Add After:
PHP Code:
private $pass = "CPANEL PASS";
private $whmphp;
private $user = "CPANEL USERNAME"; // This may be refrenceable
function whm() {
$this->whmphp = new whmphp("YOURIP",$this->user,$this->pass); // Not localhost
}
Find:
PHP Code:
public function signup($server, $reseller, $user = '', $email = '', $pass = '') {
Replace Function With:
PHP Code:
public function signup($server, $reseller, $user = '', $email = '', $pass = '') {
global $main;
global $db;
if ($user == '') { $user = $main->getvar['username']; }
if ($email == '') { $email = $main->getvar['email']; }
if ($pass == '') { $pass = $main->getvar['password']; }
$this->server = $server;
if ($reseller) {
$r = $this->whmphp->createreseller($main->getvar['fplan'],$user,$pass,$main->getvar['fdom'],$email);
echo $r[1];
return $r[0];
} else {
$action = "/xml-api/createacct".
"?username=". $user . "".
"&password=". $pass ."".
"&domain=". $main->getvar['fdom'] ."".
"&plan=". $main->getvar['fplan'] ."".
"&contactemail=". $email ."";
$command = $this->remote($action);
if($command->result->status == 1) {
return true;
}
else {
echo "Error: ". $command->result->statusmsg;
}
}
}
Find:
PHP Code:
public function suspend($user, $server, $reason = false) {
Replace Function With:
PHP Code:
public function suspend($user, $server, $reason = false) {
$this->server = $server;
if ($server == 1) {
return $this->whmphp->suspendreseller($user);
} else {
$action = "/xml-api/suspendacct?user=" . strtolower($user);
$command = $this->remote($action);
if($reason == false) {
$command = $this->remote($action);
}
else {
$command = $this->remote($action . "&reason=" . str_replace(" ", "%20", $reason));
}
if($command->result->status == 1) {
return true;
}
else {
return false;
}
}
}
Find:
PHP Code:
public function unsuspend($user, $server) {
Replace Function With:
PHP Code:
public function unsuspend($user, $server) {
$this->server = $server;
if ($server == 1) {
return $this->whmphp->unsuspendreseller($user);
} else {
$action = "/xml-api/unsuspendacct?user=" . strtolower($user);
$command = $this->remote($action);
if($command->result->status == 1) {
return true;
}
else {
return false;
}
}
}
Find:
PHP Code:
public function terminate($user, $server) {
Replace Function With:
PHP Code:
public function terminate($user, $server) {
$this->server = $server;
if ($server == 1) {
return $this->whmphp->terminatereseller($user);
} else {
$action = "/xml-api/removeacct?user=" . strtolower($user);
$command = $this->remote($action, 0, true);
if($command == true) {
return true;
}
else {
return false;
}
}
}
Download Attachment
Place in: THTROOT/includes/
Your resellers must user the server ID 1. If you have to, switch the server id.
You will need 2 servers of the same details.
One with ID 1 for WHMPHP, one with another ID for whm.
Feel free to IM me for support:
[email protected]
[email protected]
jerryinchost (Yahoo)
ismywb (Skype)
edit: forgot to attach whmphp.php