Customize actions after domain registrations and transfers

From NETIM
Jump to: navigation, search

Introduction

As part of the application, the module is encrypted by Ioncube too, thus it is not modifiable or customizable.

For this reason, the PostRegisterDomain and PostTransferDomain functions, defined in netim.inc.php, respectively called after the validation of the registration and transfer of a domain, allow the reseller to write his own code to finalize the processing according to his needs.

Caution, this possibility is only available from version 2.5


Exemple

The sample code belows enables the registrar lock and whois privacy feature by default if supported by the tld


	function netim_PostRegisterDomain($domainid) 
	{
		include(dirname(__FILE__)."/config.inc.php");
 
		//Get registrar params
		$params = getregistrarconfigoptions("netim");
 
		//Load domain info from WHMCS Database
		$domainInfoWHMCS=netim_getDomainInfo($domainid);
 
		//Login to the API
		$clientSOAP = new SoapClient($params["API"]);
		$username = strtoupper($params["Username"]);
		$password = $params["Password"];
 
		try
		{
			$IDSession = $clientSOAP->__soapCall("SessionOpen",array($username, $password,"EN",netim_return_engine())) ;
		}
		catch(SoapFault $fault)
		{
			logModuleCall(strstr(__FUNCTION__, '_', true),__FUNCTION__,$domainInfoWHMCS["domain"],"","","");
			return;	
		}
 
		# Get information about the extension
		$tld=strstr($domainInfoWHMCS["domain"], '.');
		$tld=substr($tld,1,strlen($tld));
		$api_params=array($IDSession,$tld);	
		$StructDomainTldInfo = $clientSOAP->__soapCall("domainTldInfo",$api_params);
 
		// Call registrar lock feature if exists
		if($StructDomainTldInfo->HasRegistrarLock==1)
			$clientSOAP->domainSetPreference($IDSession, $domainInfoWHMCS["domain"], "registrar_lock", "1");
 
		// Call masked whois feature if exists
		if($StructDomainTldInfo->HasWhoisPrivacy==1)
			$clientSOAP->domainSetPreference($IDSession, $domainInfoWHMCS["domain"], "whois_privacy", "1");
 
		// Logout from the API
		$clientSOAP->__soapCall("SessionClose",array($IDSession)) ;
	}
Personal tools
Namespaces

Variants
Actions
Your account
Domain names
Contact Us
Web Hosting
SSL Certificate
Email Hosting
Website Builder
Resellers
Affiliates
Miscellaneous