Domain Plugins

The file responsible for the domain plugin is hostvise/plugins/dpanel.php – if you wish to install a new plugin, the new plugin should replace the existing one.
 


Download Namecheap Plugin (default)
To install overwrite plugin and modify “Settings->dPanel User” with the Namecheap username and “Settings->dPanel Hash/Pass” with the namecheap api hash (not password) – which can be found in the namecheap panel.
https://manage.www.namecheap.com/myaccount/modify-profile-api.asp

   


For Developers

The domain plugin is located in the hostvise tree structure at plugins/dpanel.php.
 

Structure of plugins/dpanel.php

require_once("globals.php");

// this class deals with automated domain creation (Namecheap)

// language name of domain panel - DEFFINITION NEEDED
define(LANG_DPANEL, "namecheap");

// not needed, but used for this particular definition
define(LANG_ENV, "https://api.sandbox.namecheap.com/");

class dPanel
{
	var $user = null;
	var $hash = null;

	public function __construct()
	{
		// constructor
		global $SETTING;
		$this->user = $SETTING[S_DPANELUSER];
		$this->hash = $SETTING[S_DPANELHASH]
	}

	private function execute($query)
	{
		// remove white space
		$query = str_replace(' ','',$query);	

		// executes a query
		$ch = curl_init();

		curl_setopt($ch, CURLOPT_URL, LANG_ENV . $query);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
		$contents = curl_exec($ch);
		curl_close($ch);

		// optinal mail contents for debugging
		//mail("demo@example.com","results",$contents . $query,null);
	}

	public function create($domainid)
	{
		// creates a domain
		global $SETTING;

		// gets domain information
		$dinfo = mysql_grab_id(DOWNED,$domainid);	

                // create new domain
	}

	public function renew($domainid)
	{
		$dinfo = mysql_grab_id(DOWNED,$domainid);	

                //$dinfo is an array of domain variables
                // renew domain here
	}

}