andre 9 月之前
當前提交
83708e1fdd
共有 62 個文件被更改,包括 8059 次插入0 次删除
  1. 31 0
      Net/EPP.php
  2. 137 0
      Net/EPP/Client.php
  3. 20 0
      Net/EPP/Exception.php
  4. 29 0
      Net/EPP/Frame.php
  5. 64 0
      Net/EPP/Frame/Command.php
  6. 22 0
      Net/EPP/Frame/Command/Check.php
  7. 12 0
      Net/EPP/Frame/Command/Check/Domain.php
  8. 12 0
      Net/EPP/Frame/Command/Check/Host.php
  9. 2 0
      Net/EPP/Frame/Command/Check/index.php
  10. 13 0
      Net/EPP/Frame/Command/Create.php
  11. 12 0
      Net/EPP/Frame/Command/Create/Contact.php
  12. 13 0
      Net/EPP/Frame/Command/Create/Domain.php
  13. 12 0
      Net/EPP/Frame/Command/Create/Host.php
  14. 2 0
      Net/EPP/Frame/Command/Create/index.php
  15. 13 0
      Net/EPP/Frame/Command/Delete.php
  16. 12 0
      Net/EPP/Frame/Command/Delete/Contact.php
  17. 12 0
      Net/EPP/Frame/Command/Delete/Domain.php
  18. 12 0
      Net/EPP/Frame/Command/Delete/Host.php
  19. 2 0
      Net/EPP/Frame/Command/Delete/index.php
  20. 30 0
      Net/EPP/Frame/Command/Info.php
  21. 12 0
      Net/EPP/Frame/Command/Info/Contact.php
  22. 12 0
      Net/EPP/Frame/Command/Info/Domain.php
  23. 12 0
      Net/EPP/Frame/Command/Info/Host.php
  24. 2 0
      Net/EPP/Frame/Command/Info/index.php
  25. 30 0
      Net/EPP/Frame/Command/Login.php
  26. 26 0
      Net/EPP/Frame/Command/Logout.php
  27. 17 0
      Net/EPP/Frame/Command/Poll.php
  28. 18 0
      Net/EPP/Frame/Command/Poll/Ack.php
  29. 14 0
      Net/EPP/Frame/Command/Poll/Req.php
  30. 2 0
      Net/EPP/Frame/Command/Poll/index.php
  31. 22 0
      Net/EPP/Frame/Command/Renew.php
  32. 12 0
      Net/EPP/Frame/Command/Renew/Domain.php
  33. 2 0
      Net/EPP/Frame/Command/Renew/index.php
  34. 33 0
      Net/EPP/Frame/Command/Transfer.php
  35. 12 0
      Net/EPP/Frame/Command/Transfer/Contact.php
  36. 20 0
      Net/EPP/Frame/Command/Transfer/Domain.php
  37. 2 0
      Net/EPP/Frame/Command/Transfer/index.php
  38. 13 0
      Net/EPP/Frame/Command/Update.php
  39. 12 0
      Net/EPP/Frame/Command/Update/Contact.php
  40. 12 0
      Net/EPP/Frame/Command/Update/Domain.php
  41. 12 0
      Net/EPP/Frame/Command/Update/Host.php
  42. 2 0
      Net/EPP/Frame/Command/Update/index.php
  43. 2 0
      Net/EPP/Frame/Command/index.php
  44. 24 0
      Net/EPP/Frame/Greeting.php
  45. 11 0
      Net/EPP/Frame/Hello.php
  46. 19 0
      Net/EPP/Frame/Response.php
  47. 2 0
      Net/EPP/Frame/index.php
  48. 43 0
      Net/EPP/ObjectSpec.php
  49. 149 0
      Net/EPP/Protocol.php
  50. 284 0
      Net/EPP/Simple.php
  51. 2 0
      Net/EPP/index.php
  52. 2 0
      Net/index.php
  53. 0 0
      cert/cert.pem.empty
  54. 2 0
      cert/index.php
  55. 938 0
      demostrator/demo.php
  56. 2 0
      demostrator/index.php
  57. 1927 0
      demostrator/swicthepp_demonstrator.php
  58. 1213 0
      idna_convert.class.php
  59. 2 0
      index.php
  60. 二進制
      logo.gif
  61. 1348 0
      switchepp.php
  62. 1328 0
      switchepp.php.bak

+ 31 - 0
Net/EPP.php

@@ -0,0 +1,31 @@
+<?php
+
+/*	EPP Client class for PHP, Copyright 2005 CentralNic Ltd
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+/**
+* @package Net_EPP
+* @version 0.0.4
+* @author Gavin Brown <gavin.brown@nospam.centralnic.com>
+* @revision $Id: Client.php,v 1.13 2010/10/21 11:55:07 gavin Exp $
+*/
+
+require_once dirname(__FILE__).'/EPP/Exception.php';
+require_once dirname(__FILE__).'/EPP/ObjectSpec.php';
+require_once dirname(__FILE__).'/EPP/Protocol.php';
+require_once dirname(__FILE__).'/EPP/Frame.php';
+require_once dirname(__FILE__).'/EPP/Client.php';
+require_once dirname(__FILE__).'/EPP/Simple.php';

+ 137 - 0
Net/EPP/Client.php

@@ -0,0 +1,137 @@
+<?php
+
+/* 	EPP Client class for PHP, Copyright 2005 CentralNic Ltd
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * A simple client class for the Extensible Provisioning Protocol (EPP)
+ * @package Net_EPP
+ * @version 0.0.4
+ * @author Gavin Brown <gavin.brown@nospam.centralnic.com>
+ * @revision $Id: Client.php,v 1.13 2010/10/21 11:55:07 gavin Exp $
+ */
+require_once('Protocol.php');
+
+$GLOBALS['Net_EPP_Client_Version'] = '0.0.4';
+
+/**
+ * A simple client class for the Extensible Provisioning Protocol (EPP)
+ * @package Net_EPP
+ */
+class Net_EPP_Client {
+
+    /**
+     * @var resource the socket resource, once connected
+     */
+    var $socket;
+
+    /**
+     * Establishes a connect to the server
+     * This method establishes the connection to the server. If the connection was
+     * established, then this method will call getFrame() and return the EPP <greeting>
+     * frame which is sent by the server upon connection. If connection fails, then
+     * an exception with a message explaining the error will be thrown and handled 
+     * in the calling code.
+     * @param string $host the hostname
+     * @param integer $port the TCP port
+     * @param integer $timeout the timeout in seconds
+     * @param boolean $ssl whether to connect using SSL
+     * @param resource $context a stream resource to use when setting up the socket connection
+     * @throws Exception on connection errors
+     * @return a string containing the server <greeting>
+     */
+    function connect($host, $port = 700, $timeout = 1, $ssl = true, $context = NULL) {
+        $target = sprintf('%s://%s:%d', ($ssl === true ? 'ssl' : 'tcp'), $host, $port);
+        if (is_resource($context)) {
+            $result = stream_socket_client($target, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context);
+        } else {
+            $result = stream_socket_client($target, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT);
+        }
+        if ($result === False) {
+            throw new Exception("Error connecting to $target: $errstr (code $errno)");
+        }
+
+        // Set our socket
+        $this->socket = $result;
+
+        // Set stream timeout
+        if (!stream_set_timeout($this->socket, $timeout)) {
+            throw new Exception("Failed to set timeout on socket: $errstr (code $errno)");
+        }
+        // Set blocking
+        if (!stream_set_blocking($this->socket, 0)) {
+            throw new Exception("Failed to set blocking on socket: $errstr (code $errno)");
+        }
+
+        return $this->getFrame();
+    }
+
+    /**
+     * Get an EPP frame from the server.
+     * This retrieves a frame from the server. Since the connection is blocking, this
+     * method will wait until one becomes available. If the connection has been broken,
+     * this method will return a string containing the XML from the server
+     * @throws Exception on frame errors
+     * @return a string containing the frame
+     */
+    function getFrame() {
+        return Net_EPP_Protocol::getFrame($this->socket);
+    }
+
+    /**
+     * Send an XML frame to the server.
+     * This method sends an EPP frame to the server.
+     * @param string the XML data to send
+     * @throws Exception when it doesn't complete the write to the socket
+     * @return boolean the result of the fwrite() operation
+     */
+    function sendFrame($xml) {
+        return Net_EPP_Protocol::sendFrame($this->socket, $xml);
+    }
+
+    /**
+     * a wrapper around sendFrame() and getFrame()
+     * @param string $xml the frame to send to the server
+     * @throws Exception when it doesn't complete the write to the socket
+     * @return string the frame returned by the server, or an error object
+     */
+    function request($xml) {
+        $res = $this->sendFrame($xml);
+        return $this->getFrame();
+    }
+
+    /**
+     * Close the connection.
+     * This method closes the connection to the server. Note that the
+     * EPP specification indicates that clients should send a <logout>
+     * command before ending the session.
+     * @return boolean the result of the fclose() operation
+     */
+    function disconnect() {
+        return @fclose($this->socket);
+    }
+
+    /**
+     * ping the connection to check that it's up
+     * @return boolean
+     */
+    function ping() {
+        return (!is_resource($this->socket) || feof($this->socket) ? false : true);
+    }
+
+}
+
+?>

+ 20 - 0
Net/EPP/Exception.php

@@ -0,0 +1,20 @@
+<?php
+
+/*	EPP Client class for PHP, Copyright 2013 CentralNic Ltd
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+class Net_EPP_Exception extends Exception {
+}

+ 29 - 0
Net/EPP/Frame.php

@@ -0,0 +1,29 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame extends DomDocument {
+
+		const EPP_URN		= 'urn:ietf:params:xml:ns:epp-1.0';
+		const SCHEMA_URI	= 'http://www.w3.org/2001/XMLSchema-instance';
+		const TEMPLATE		= '<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"></epp>';
+
+		function __construct($type) {
+			parent::__construct('1.0', 'UTF-8');
+
+			$this->loadXML(self::TEMPLATE);
+
+			$type = strtolower($type);
+			if (!in_array($type, array('hello', 'greeting', 'command', 'response'))) trigger_error("Invalid argument value '$type' for \$type", E_USER_ERROR);
+
+			$this->epp = $this->firstChild;
+			$this->body = $this->createElement($type);
+			$this->epp->appendChild($this->body);
+		}
+
+		function friendly() {
+			return str_replace('><', ">\n<", $this->saveXML());
+		}
+	}
+?>

+ 64 - 0
Net/EPP/Frame/Command.php

@@ -0,0 +1,64 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command extends Net_EPP_Frame {
+
+		function __construct($command, $type="") {
+			$this->type = $type;
+			$command = strtolower($command);
+			if (!in_array($command, array('check', 'info', 'create', 'update', 'delete', 'renew', 'transfer', 'poll', 'login', 'logout'))) trigger_error("Invalid argument value '$command' for \$command", E_USER_ERROR);
+			parent::__construct('command');
+
+			$this->command = $this->createElement($command);
+			$this->body->appendChild($this->command);
+
+			if (!empty($this->type)) {
+				$this->payload = $this->createElementNS(
+					Net_EPP_ObjectSpec::xmlns($this->type),
+					$this->type.':'.$command
+				);
+
+				$this->command->appendChild($this->payload);
+			}
+
+			$this->clTRID = $this->createElement('clTRID');
+			$this->clTRID->appendChild($this->createTextNode(''));
+			$this->body->appendChild($this->clTRID);
+		}
+
+		function addObjectProperty($name, $value=NULL) {
+			$element = $this->createObjectPropertyElement($name);
+			$this->payload->appendChild($element);
+
+			if ($value instanceof DomNode) {
+				$element->appendChild($value);
+
+			} elseif (isset($value)) {
+				$element->appendChild($this->createTextNode($value));
+
+			}
+			return $element;
+		}
+
+		function createObjectPropertyElement($name) {
+			return $this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($this->type),
+				$this->type.':'.$name
+			);
+		}
+
+		function createExtensionElement($ext, $command) {
+			$this->extension = $this->createElement('extension');
+			$this->body->appendChild($this->extension);
+
+			$this->extension->payload = $this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($ext),
+				$ext.':'.$command
+			);
+
+			$this->extension->appendChild($this->extension->payload);
+		}
+	}
+?>

+ 22 - 0
Net/EPP/Frame/Command/Check.php

@@ -0,0 +1,22 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame_Command_Check extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			parent::__construct('check', $type);
+		}
+
+		function addObject($object) {
+			$type = strtolower(str_replace(__CLASS__.'_', '', get_class($this)));
+			$this->payload->appendChild($this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($type),
+				$type.':'.Net_EPP_ObjectSpec::id($type),
+				$object
+			));
+		}
+
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Check/Domain.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Check_Domain extends Net_EPP_Frame_Command_Check {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Check/Host.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Check_Host extends Net_EPP_Frame_Command_Check {
+
+		function __construct() {
+			parent::__construct('host');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Check/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 13 - 0
Net/EPP/Frame/Command/Create.php

@@ -0,0 +1,13 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Create extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			$this->type = $type;
+			parent::__construct('create', $type);
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Create/Contact.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Create_Contact extends Net_EPP_Frame_Command_Create {
+
+		function __construct() {
+			parent::__construct('contact');
+		}
+	}
+?>

+ 13 - 0
Net/EPP/Frame/Command/Create/Domain.php

@@ -0,0 +1,13 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Create_Domain extends Net_EPP_Frame_Command_Create {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Create/Host.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Create_Host extends Net_EPP_Frame_Command_Create {
+
+		function __construct() {
+			parent::__construct('host');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Create/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 13 - 0
Net/EPP/Frame/Command/Delete.php

@@ -0,0 +1,13 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Delete extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			$this->type = $type;
+			parent::__construct('delete', $type);
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Delete/Contact.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Delete_Contact extends Net_EPP_Frame_Command_Delete {
+
+		function __construct() {
+			parent::__construct('contact');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Delete/Domain.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Delete_Domain extends Net_EPP_Frame_Command_Delete {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Delete/Host.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Delete_Host extends Net_EPP_Frame_Command_Delete {
+
+		function __construct() {
+			parent::__construct('host');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Delete/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 30 - 0
Net/EPP/Frame/Command/Info.php

@@ -0,0 +1,30 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame_Command_Info extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			parent::__construct('info', $type);
+		}
+
+		function setObject($object) {
+			$type = strtolower(str_replace(__CLASS__.'_', '', get_class($this)));
+			foreach ($this->payload->childNodes as $child) $this->payload->removeChild($child);
+			$this->payload->appendChild($this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($type),
+				$type.':'.Net_EPP_ObjectSpec::id($type),
+				$object
+			));
+		}
+
+		function setAuthInfo($authInfo) {
+			$el = $this->createObjectPropertyElement('authInfo');
+			$el->appendChild($this->createObjectPropertyElement('pw'));
+			$el->firstChild->appendChild($this->createTextNode($authInfo));
+			$this->payload->appendChild($el);
+		}
+
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Info/Contact.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Info_Contact extends Net_EPP_Frame_Command_Info {
+
+		function __construct() {
+			parent::__construct('contact');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Info/Domain.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Info_Domain extends Net_EPP_Frame_Command_Info {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Info/Host.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Info_Host extends Net_EPP_Frame_Command_Info {
+
+		function __construct() {
+			parent::__construct('host');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Info/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 30 - 0
Net/EPP/Frame/Command/Login.php

@@ -0,0 +1,30 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Login extends Net_EPP_Frame_Command {
+		function __construct() {
+			parent::__construct('login');
+
+			$this->clID = $this->createElement('clID');
+			$this->command->appendChild($this->clID);
+
+			$this->pw = $this->createElement('pw');
+			$this->command->appendChild($this->pw);
+
+			$this->options = $this->createElement('options');
+			$this->command->appendChild($this->options);
+
+			$this->eppVersion = $this->createElement('version');
+			$this->options->appendChild($this->eppVersion);
+
+			$this->eppLang = $this->createElement('lang');
+			$this->options->appendChild($this->eppLang);
+
+			$this->svcs = $this->createElement('svcs');
+			$this->command->appendChild($this->svcs);
+
+		}
+	}
+?>

+ 26 - 0
Net/EPP/Frame/Command/Logout.php

@@ -0,0 +1,26 @@
+<?php
+
+/*	EPP Client class for PHP, Copyright 2013 CentralNic Ltd
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+/**
+* @package Net_EPP
+*/
+class Net_EPP_Frame_Command_Logout extends Net_EPP_Frame_Command {
+	function __construct() {
+		parent::__construct('logout');
+	}
+}

+ 17 - 0
Net/EPP/Frame/Command/Poll.php

@@ -0,0 +1,17 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame_Command_Poll extends Net_EPP_Frame_Command {
+
+		function __construct() {
+			parent::__construct('poll', '');
+		}
+
+		function setOp($op) {
+			$this->command->setAttribute('op', $op);
+		}
+
+	}
+?>

+ 18 - 0
Net/EPP/Frame/Command/Poll/Ack.php

@@ -0,0 +1,18 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Poll_Ack extends Net_EPP_Frame_Command_Poll {
+
+		function __construct() {
+			parent::__construct();
+			$this->setOp('ack');
+		}
+
+		function setMsgID($id) {
+			$this->command->setAttribute('msgID', $id);
+		}
+
+	}
+?>

+ 14 - 0
Net/EPP/Frame/Command/Poll/Req.php

@@ -0,0 +1,14 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Poll_Req extends Net_EPP_Frame_Command_Poll {
+
+		function __construct() {
+			parent::__construct();
+			$this->setOp('req');
+		}
+
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Poll/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 22 - 0
Net/EPP/Frame/Command/Renew.php

@@ -0,0 +1,22 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame_Command_Renew extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			parent::__construct('renew', $type);
+		}
+
+		function addObject($object) {
+			$type = strtolower(str_replace(__CLASS__.'_', '', get_class($this)));
+			$this->payload->appendChild($this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($type),
+				$type.':'.Net_EPP_ObjectSpec::id($type),
+				$object
+			));
+		}
+
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Renew/Domain.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Renew_Domain extends Net_EPP_Frame_Command_Renew {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Renew/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 33 - 0
Net/EPP/Frame/Command/Transfer.php

@@ -0,0 +1,33 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	abstract class Net_EPP_Frame_Command_Transfer extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			parent::__construct('transfer', $type);
+		}
+
+		function setObject($object) {
+			$type = strtolower(str_replace(__CLASS__.'_', '', get_class($this)));
+			foreach ($this->payload->childNodes as $child) $this->payload->removeChild($child);
+			$this->payload->appendChild($this->createElementNS(
+				Net_EPP_ObjectSpec::xmlns($type),
+				$type.':'.Net_EPP_ObjectSpec::id($type),
+				$object
+			));
+		}
+
+		function setOp($op) {
+			$this->command->setAttribute('op', $op);
+		}
+
+		function setAuthInfo($authInfo) {
+			$el = $this->createObjectPropertyElement('authInfo');
+			$el->appendChild($this->createObjectPropertyElement('pw'));
+			$el->firstChild->appendChild($this->createTextNode($authInfo));
+			$this->payload->appendChild($el);
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Transfer/Contact.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Transfer_Contact extends Net_EPP_Frame_Command_Transfer {
+
+		function __construct() {
+			parent::__construct('contact');
+		}
+	}
+?>

+ 20 - 0
Net/EPP/Frame/Command/Transfer/Domain.php

@@ -0,0 +1,20 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Transfer_Domain extends Net_EPP_Frame_Command_Transfer {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+
+		function setPeriod($period, $units='y') {
+			$el = $this->createObjectPropertyElement('period');
+			$el->setAttribute('unit', $units);
+			$el->appendChild($this->createTextNode($period));
+			$this->payload->appendChild($el);
+		}
+
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Transfer/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 13 - 0
Net/EPP/Frame/Command/Update.php

@@ -0,0 +1,13 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Update extends Net_EPP_Frame_Command {
+
+		function __construct($type) {
+			$this->type = $type;
+			parent::__construct('update', $type);
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Update/Contact.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Update_Contact extends Net_EPP_Frame_Command_Update {
+
+		function __construct() {
+			parent::__construct('contact');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Update/Domain.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Update_Domain extends Net_EPP_Frame_Command_Update {
+
+		function __construct() {
+			parent::__construct('domain');
+		}
+	}
+?>

+ 12 - 0
Net/EPP/Frame/Command/Update/Host.php

@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Command_Update_Host extends Net_EPP_Frame_Command_Update {
+
+		function __construct() {
+			parent::__construct('host');
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/Command/Update/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../../index.php");

+ 2 - 0
Net/EPP/Frame/Command/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../../index.php");

+ 24 - 0
Net/EPP/Frame/Greeting.php

@@ -0,0 +1,24 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	final class Net_EPP_Frame_Greeting extends Net_EPP_Frame {
+		function __construct() {
+			parent::__construct('greeting');
+
+			$this->svID = $this->createElement('svID');
+			$this->body->appendChild($this->svID);
+
+			$this->svDate = $this->createElement('svDate');
+			$this->body->appendChild($this->svDate);
+
+			$this->svcMenu = $this->createElement('svcMenu');
+			$this->body->appendChild($this->svcMenu);
+
+			$this->dcp = $this->createElement('dcp');
+			$this->body->appendChild($this->dcp);
+
+		}
+	}
+?>

+ 11 - 0
Net/EPP/Frame/Hello.php

@@ -0,0 +1,11 @@
+<?php
+
+/**
+* @package Net_EPP
+*/
+final class Net_EPP_Frame_Hello extends Net_EPP_Frame {
+	function __construct() {
+		parent::__construct('hello');
+		$this->command = 'hello';
+	}
+}

+ 19 - 0
Net/EPP/Frame/Response.php

@@ -0,0 +1,19 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_Frame_Response extends Net_EPP_Frame {
+		function __construct() {
+			parent::__construct('response');
+		}
+
+		function code() {
+			return $this->getElementsByTagName('result')->item(0)->getAttribute('code');
+		}
+
+		function message() {
+			return $this->getElementsByTagName('msg')->item(0)->firstChild->textContent;
+		}
+	}
+?>

+ 2 - 0
Net/EPP/Frame/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../../index.php");

+ 43 - 0
Net/EPP/ObjectSpec.php

@@ -0,0 +1,43 @@
+<?php
+
+	/**
+	* @package Net_EPP
+	*/
+	class Net_EPP_ObjectSpec {
+
+		static $_spec = array(
+			'domain' => array(
+				'xmlns'		=> 'urn:ietf:params:xml:ns:domain-1.0',
+				'id'		=> 'name',
+				'schema'	=> 'urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd',
+			),
+			'host' => array(
+				'xmlns'		=> 'urn:ietf:params:xml:ns:host-1.0',
+				'id'		=> 'name',
+				'schema'	=> 'urn:ietf:params:xml:ns:host-1.0 host-1.0.xsd',
+			),
+			'contact' => array(
+				'xmlns'		=> 'urn:ietf:params:xml:ns:contact-1.0',
+				'id'		=> 'id',
+				'schema'	=> 'urn:ietf:params:xml:ns:contact-1.0 contact-1.0.xsd',
+			),
+			'rgp' => array(
+				'xmlns'		=> 'urn:ietf:params:xml:ns:rgp-1.0',
+				'id'		=> 'id',
+				'schema'	=> 'urn:ietf:params:xml:ns:rgp-1.0 rgp-1.0.xsd',
+			),
+		);
+
+		static function id($object) {
+			return self::$_spec[$object]['id'];
+		}
+
+		static function xmlns($object) {
+			return self::$_spec[$object]['xmlns'];
+		}
+
+		static function schema($object) {
+			return self::$_spec[$object]['schema'];
+		}
+	}
+?>

+ 149 - 0
Net/EPP/Protocol.php

@@ -0,0 +1,149 @@
+<?php
+
+/*	EPP Client class for PHP, Copyright 2005 CentralNic Ltd
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+/**
+* Low-level functions useful for both EPP clients and servers
+* @package Net_EPP
+* @version 0.0.4
+* @author Gavin Brown <gavin.brown@nospam.centralnic.com>
+* @revision $Id: Protocol.php,v 1.4 2011/06/28 09:48:02 gavin Exp $
+*/
+
+/**
+* Low-level functions useful for both EPP clients and servers
+* @package Net_EPP
+*/
+class Net_EPP_Protocol {
+
+	static function _fread_nb($socket,$length) {
+		$result = '';
+
+		// Loop reading and checking info to see if we hit timeout
+		$info = stream_get_meta_data($socket);
+		$time_start = microtime(true);
+
+		while (!$info['timed_out'] && !feof($socket)) {
+			// Try read remaining data from socket
+			$buffer = @fread($socket,$length - strlen($result));
+			// If the buffer actually contains something then add it to the result
+			if ($buffer !== false) {
+				$result .= $buffer;
+				// If we hit the length we looking for, break
+				if (strlen($result) == $length) {
+					break;
+				}
+			} else {
+				// Sleep 0.25s
+				usleep(250000);
+			}
+			// Update metadata
+			$info = stream_get_meta_data($socket);
+			$time_end = microtime(true);
+			if (($time_end - $time_start) > 10000000) {
+				throw new exception('Timeout while reading from EPP Server');
+			}
+		}
+
+		// Check for timeout
+		if ($info['timed_out']) {
+			throw new Exception('Timeout while reading data from socket');
+		}
+
+		return $result;
+	}
+
+
+	static function _fwrite_nb($socket,$buffer,$length) {
+		// Loop writing and checking info to see if we hit timeout
+		$info = stream_get_meta_data($socket);
+		$time_start = microtime(true);
+
+		$pos = 0;
+		while (!$info['timed_out'] && !feof($socket)) {
+			// Some servers don't like alot of data, so keep it small per chunk
+			$wlen = $length - $pos;
+			if ($wlen > 1024) { $wlen = 1024; }
+			// Try write remaining data from socket
+			$written = @fwrite($socket,substr($buffer,$pos),$wlen);
+			// If we read something, bump up the position
+			if ($written && $written !== false) {
+				$pos += $written;
+				// If we hit the length we looking for, break
+				if ($pos == $length) {
+					break;
+				}
+			} else {
+				// Sleep 0.25s
+				usleep(250000);
+			}
+			// Update metadata
+			$info = stream_get_meta_data($socket);
+			$time_end = microtime(true);
+			if (($time_end - $time_start) > 10000000) {
+				throw new exception('Timeout while writing to EPP Server');
+			}
+		}
+		// Check for timeout
+		if ($info['timed_out']) {
+			throw new Exception('Timeout while writing data to socket');
+		}
+
+		return $pos;
+	}
+
+	/**
+	* get an EPP frame from the remote peer
+	* @param resource $socket a socket connected to the remote peer
+	* @throws Exception on frame errors.
+	* @return string the frame
+	*/
+	static function getFrame($socket) {
+		// Read header
+		$hdr = Net_EPP_Protocol::_fread_nb($socket,4);
+
+		// Unpack first 4 bytes which is our length
+		$unpacked = unpack('N', $hdr);
+		$length = $unpacked[1];
+		if ($length < 5) {
+			throw new Exception(sprintf('Got a bad frame header length of %d bytes from peer', $length));
+
+		} else {
+			$length -= 4; // discard the length of the header itself
+			// Read frame
+			return Net_EPP_Protocol::_fread_nb($socket,$length);
+		}
+	}
+
+	/**
+	* send an EPP frame to the remote peer
+	* @param resource $socket a socket connected to the remote peer
+	* @param string $xml the XML to send
+	* @throws Exception when it doesn't complete the write to the socket
+	* @return the amount of bytes written to the frame
+	*/
+	static function sendFrame($socket, $xml) {
+		// Grab XML length & add on 4 bytes for the counter
+		$length = strlen($xml) + 4;
+		$res = Net_EPP_Protocol::_fwrite_nb($socket, pack('N',$length) . $xml,$length);
+		// Check our write matches
+		if ($length != $res) {
+			throw new Exception("Short write when sending XML. Length of the XML: " . $length . " Response length: " . $res);
+		}
+		return $res;
+	}
+}

+ 284 - 0
Net/EPP/Simple.php

@@ -0,0 +1,284 @@
+<?php
+
+/*	EPP Client class for PHP, Copyright 2013 CentralNic Ltd
+	This program is free software; you can redistribute it and/or modify
+	it under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+require_once dirname(__FILE__).'/Exception.php';
+require_once dirname(__FILE__).'/Client.php';
+require_once dirname(__FILE__).'/Frame.php';
+
+/**
+* @package Net_EPP_Simple
+* @author CentralNic <https://www.centralnic.com>
+*/
+class Net_EPP_Simple extends Net_EPP_Client {
+
+	private $connected;
+	private $logged_in;
+	private $user;
+
+	var $debug;
+
+	/**
+	* @var DOMDocument
+	*/
+	var $greeting;
+
+	/**
+	* @param string $host
+	* @param string $user
+	* @param string $pass
+	* @param boolean $debug
+	* @param integer $port
+	* @param integer timeout
+	* @param boolean $ssl
+	* @param resource $context
+	* @throws Net_EPP_Exception
+	*/
+	function __construct($host=NULL, $user=NULL, $pass=NULL, $debug=false, $port=700, $timeout=1, $ssl=true, $context=NULL) {
+		$this->connected	= false;
+		$this->logged_in	= false;
+		$this->debug		= $debug;
+		$this->user		= $user;
+
+		if ($host) $this->connect($host, $port, $timeout, $ssl, $context);
+		if ($user && $pass) $this->login($user, $pass);
+	}
+
+	/**
+	* @param string $user
+	* @param string $pass
+	* @throws Net_EPP_Exception
+	*/
+	function login($user, $pass) {
+		if (!$this->connected) throw new Net_EPP_Exception("Not connected");
+		$frame = new Net_EPP_Frame_Command_Login;
+		$frame->clID->appendChild($frame->createTextNode($user));
+		$frame->pw->appendChild($frame->createTextNode($pass));
+
+		$frame->eppVersion->appendChild($frame->createTextNode($this->greeting->getElementsByTagNameNS(Net_EPP_Frame::EPP_URN, 'version')->item(0)->textContent));
+		$frame->eppLang->appendChild($frame->createTextNode($this->greeting->getElementsByTagNameNS(Net_EPP_Frame::EPP_URN, 'lang')->item(0)->textContent));
+
+		$els = $this->greeting->getElementsByTagNameNS(Net_EPP_Frame::EPP_URN, 'objURI');
+		for ($i = 0 ; $i < $els->length ; $i++) $frame->svcs->appendChild($frame->importNode($els->item($i), true));
+
+		$els = $this->greeting->getElementsByTagNameNS(Net_EPP_Frame::EPP_URN, 'svcExtension');
+		if (1 == $els->length) $frame->svcs->appendChild($frame->importNode($els->item(0), true));
+
+		$this->request($frame);
+	}
+
+	function checkDomain($domain) {
+	}
+
+	function checkDomains($domains) {
+	}
+	
+	function checkHost($host) {
+	}
+	
+	function checkHosts($host) {
+	}
+	
+	function checkContact($contact) {
+	}
+	
+	function checkContacts($contacts) {
+	}
+	
+	function domainInfo($domain, $authInfo=NULL) {
+	}
+	
+	function hostInfo($host, $authInfo=NULL) {
+	}
+	
+	function contactInfo($contact, $authInfo=NULL) {
+	}
+	
+	function domainTransferQuery($domain) {
+	}
+	
+	function domainTransferCancel($domain) {
+	}
+	
+	function domainTransferRequest($domain, $authInfo, $period, $unit='y') {
+	}
+	
+	function domainTransferApprove($domain) {
+	}
+	
+	function domainTransferReject($domain) {
+	}
+	
+	function contactTransferQuery($contact) {
+	}
+	
+	function contactTransferCancel($contact) {
+	}
+	
+	function contactTransferRequest($contact, $authInfo) {
+	}
+	
+	function contactTransferApprove($contact) {
+	}
+	
+	function contactTransferReject($contact) {
+	}
+	
+	function createDomain($domain) {
+	}
+	
+	function createHost($host) {
+	}
+	
+	function createContact($contact) {
+	}
+	
+	function updateDomain($domain, $add, $rem, $chg) {
+	}
+	
+	function updateContact($contact, $add, $rem, $chg) {
+	}
+	
+	function updateHost($host, $add, $rem, $chg) {
+	}
+	
+	function deleteDomain($domain) {
+	}
+	
+	function deleteHost($host) {
+	}
+	
+	function deleteContact($contact) {
+	}
+	
+	function renewDomain($domain, $period, $unit='y') {
+	}
+	
+	function ping() {
+	}
+
+	private function _check($type, $objects) {
+		$class = 'Net_EPP_Frame_Command_Check_'.ucfirst($type);
+		$frame = new $class;
+
+		foreach ($objects as $object) $frame->addObject($object);
+		$frame->clTRID->appendChild($frame->createTextNode($this->clTRID()));
+
+		$result = $this->request($frame);
+	}
+
+	/*
+	* send a frame to the server and get the response
+	* @param DOMDocument|string $frame
+	* @return DOMDocument
+	* @throws Net_EPP_Exception
+	*/
+	function request($frame) {
+		$this->sendFrame($frame);
+		$response = $this->getFrame();
+		return $response;
+	}
+	
+	/*
+	* send a <logout> to the server
+	* @throws Net_EPP_Exception
+	*/
+	function logout() {
+		$this->debug("logging out");
+		$frame = new Net_EPP_Frame_Command_Logout;
+		$frame->clTRID->appendChild($frame->createTextNode($this->clTRID()));
+		$this->request($frame);
+	}
+
+	/*
+	* connect to the server
+	* @param string $host
+	* @param integer $port
+	* @param integer timeout
+	* @param boolean $ssl
+	* @param resource $context
+	* @throws Net_EPP_Exception
+	* @return DOMDocument the <greeting> frame recived from the server
+	*/
+	function connect($host, $port, $timeout, $ssl, $context) {
+		$this->debug("attempting to connect to %s:%d", $host, $port);
+		$dom = parent::connect($host, $port, $timeout, $ssl, $context);
+		$this->debug("connected OK");
+		$this->connected = true;
+		$this->greeting = new Net_EPP_Frame_Greeting;
+		$this->greeting->loadXML($dom->saveXML());
+		return $this->greeting;
+	}
+
+	/*
+	* get a frame from the server
+	* @return DOMDocument
+	* @throws Net_EPP_Exception
+	*/
+	function getFrame() {
+		$xml = parent::getFrame();
+		foreach (explode("\n", str_replace('><', ">\n<", trim($xml))) as $line) $this->debug("S: %s", $line);
+		return DOMDocument::loadXML($xml);
+	}
+
+	/*
+	* send a frame to the server
+	* @param DOMDocument|string $xml
+	* @return integer number of btyes sent
+	* @throws Net_EPP_Exception
+	*/
+	function sendFrame($xml) {
+		if ($xml instanceof DOMDocument) $xml = $xml->saveXML();
+		foreach (explode("\n", str_replace('><', ">\n<", trim($xml))) as $line) $this->debug("C: %s", $line);
+		return parent::sendFrame($xml);
+	}
+
+	/*
+	* write a debug messge to the error log - is silent unless
+	* debugging is enabled
+	* @param string $format
+	* @param one or more variables
+	* @return boolean
+	*/
+	protected function debug() {
+		if (!$this->debug) return true;
+		$args = func_get_args();
+		error_log(vsprintf(array_shift($args), $args));
+	}
+
+	/*
+	* destructor - cleanly disconnect from the server
+	* @throws Net_EPP_Exception
+	*/
+	function __destruct() {
+		if ($this->logged_in) $this->logout();
+		$this->debug("disconnecting from server");
+		$this->disconnect();
+	}
+
+	/*
+	* generate a client transaction ID
+	* @return string
+	*/
+	function clTRID() {
+		$clTRID = base_convert(
+			hash('sha256', ($this->user ? $this->user.'-' : '').uniqid()),
+			16,
+			36
+		);
+	}
+}

+ 2 - 0
Net/EPP/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../../index.php");

+ 2 - 0
Net/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../index.php");

+ 0 - 0
cert/cert.pem.empty


+ 2 - 0
cert/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../index.php");

+ 938 - 0
demostrator/demo.php

@@ -0,0 +1,938 @@
+<?php //004fb
+if(!extension_loaded('ionCube Loader')){$__oc=strtolower(substr(php_uname(),0,3));$__ln='ioncube_loader_'.$__oc.'_'.substr(phpversion(),0,3).(($__oc=='win')?'.dll':'.so');if(function_exists('dl')){@dl($__ln);}if(function_exists('_il_exec')){return _il_exec();}$__ln='/ioncube/'.$__ln;$__oid=$__id=realpath(ini_get('extension_dir'));$__here=dirname(__FILE__);if(strlen($__id)>1&&$__id[1]==':'){$__id=str_replace('\\','/',substr($__id,2));$__here=str_replace('\\','/',substr($__here,2));}$__rd=str_repeat('/..',substr_count($__id,'/')).$__here.'/';$__i=strlen($__rd);while($__i--){if($__rd[$__i]=='/'){$__lp=substr($__rd,0,$__i).$__ln;if(file_exists($__oid.$__lp)){$__ln=$__lp;break;}}}if(function_exists('dl')){@dl($__ln);}}else{die('The file '.__FILE__." is corrupted.\n");}if(function_exists('_il_exec')){return _il_exec();}echo("Site error: the ".(php_sapi_name()=='cli'?'ionCube':'<a href="http://www.ioncube.com">ionCube</a>')." PHP Loader needs to be installed. This is a widely used PHP extension for running ionCube protected PHP code, website security and malware blocking.\n\nPlease visit ".(php_sapi_name()=='cli'?'get-loader.ioncube.com':'<a href="http://get-loader.ioncube.com">get-loader.ioncube.com</a>')." for install assistance.\n\n");exit(199);
+?>
+HR+cPnH5XKt+ndnYXymHRfTRsn5T/lUuxvEvqkc2IQF+CWceE7Dyk+vVi4YB5qnh3fw0mCH+u6Rz
+wl5RiKWNBO93L/ZrjBwsnds3aM2/2ybVb7k4SJZj8lLPFJHFZl3SOWBHxEoPAh61CGJyWhtVWxlf
+ONN25ojG5fW0iEEP9T7hoosoK7N0inTyeTJK/IcRHokstKLpFkb84hWVAkC2afWr+rlnMTE2GvUN
+re3qkIHjufxYjPcaijsQ6Hy4gQKMn9TXIobcSIC9e9wulYkd28rJ47GW5algRFp3TUuANnEf2jlQ
+RJV+Q/z87lQL57FgkKvK+n7kI6u5ZusPQl2ojaCqvdCgwVAORqt6pfGGLLWoJ5mM7iy1JDNFcVN+
+8sGNuzzm8pGFMLG1JvSi5MIJsgZRnUKUVW/6D+oNNhE+9jptKnq8Y789yOtjbWvBw8zyhgfr7KVV
+YaBxlvlKgu7EUrAw4T1E2l/WrMghZKBMc+fe54NoOdc73BHGOE5FEIJfGRq0za+MxuOYKKAjB7te
+PXwyLGSU0NhJx6yA3Hps9EEgUoLe/kHdNVBxc+qj7I6g36OXOvUmuLAybgGtNE++SoDL6Voksi70
+0nRchxozdxzsG46QW6OWMx5fa/JTt4+3oAV56iDayDrVEVi/Cau7tJX7kKNKXjB5mrrsUViOvKnE
+/s4LRm36B+fBwlr++qgXhOAXrInZdwhQBWQoHzwxkUepN9/PTtxnrCtkJtO1Loi7666b3IS16bIA
+yuyf+R80qlkWawbjTyX8gRx+ji+SqDC8d4KIQb8WGGr35Dt/J7vq3tjAa+xgRruh47OBM3KAEsX/
+0WBu++YVdDdN8wZ7iFi790n+zMVP0ROolADSJ+bk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/index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../../index.php");

+ 1927 - 0
demostrator/swicthepp_demonstrator.php

@@ -0,0 +1,1927 @@
+<?php
+
+use Illuminate\Database\Capsule\Manager as Capsule;
+use WGSSWITCHEPP\IDNA\idna_convert as IDNA;
+
+include_once '../../../../init.php';
+if (!class_exists('Net_EPP_Protocol')) {
+    if (file_exists(dirname(__DIR__) . "/Net/EPP/Client.php"))
+        require_once dirname(__DIR__) . "/Net/EPP/Client.php";
+}
+require_once(dirname(__DIR__) . '/idna_convert.class.php');
+
+
+/* * ********************** Create table for store login detail **************************** */
+if (!Capsule::Schema()->hasTable('switchepp_login_details')) {
+    try {
+        Capsule::schema()->create('switchepp_login_details', function ($table) {
+        	$table->increments('id');
+        	$table->string('username');
+        	$table->string('password');
+        	$table->string('epp_url');
+        	$table->string('port');
+        	$table->string('passphrase');
+    	    }
+        );
+    } catch (\Exception $e) {
+        logActivity("Unable to create switchepp_login_details: {$e->getMessage()}");
+    }
+}
+if (Capsule::Schema()->hasTable('switchepp_login_details')) {
+    if (!Capsule::Schema()->hasColumn('switchepp_login_details', 'passphrase'))
+        $table->string('passphrase');
+}
+
+/* * *************************Create table for store user record****************************** */
+if (!Capsule::Schema()->hasTable('switchepp_contact_details')) {
+    try {
+        Capsule::schema()->create(
+                'switchepp_contact_details', function ($table) {
+            $table->increments('id');
+            $table->string('type');
+            $table->string('contact_id');
+        }
+        );
+    } catch (\Exception $e) {
+        logActivity("Unable to create switchepp_contact_details: {$e->getMessage()}");
+    }
+}
+
+/* * **********************************save poll msgid******************************************** */
+if (!Capsule::Schema()->hasTable('switchepp_store_msgid')) {
+    try {
+        Capsule::schema()->create(
+                'switchepp_store_msgid', function ($table) {
+            $table->increments('id');
+            $table->string('msgid');
+        }
+        );
+    } catch (\Exception $e) {
+        logActivity("Unable to create switchepp_store_msgid: {$e->getMessage()}");
+    }
+}
+/* * ****************************create table to store country name*********************************** */
+if (!Capsule::Schema()->hasTable('switchepp_manage_country')) {
+    try {
+        Capsule::schema()->create(
+                'switchepp_manage_country', function ($table) {
+            $table->increments('id');
+            $table->string('country');
+            $table->string('country_key');
+        }
+        );
+    } catch (\Exception $e) {
+        logActivity("Unable to create switchepp_manage_country: {$e->getMessage()}");
+    }
+}
+$contrs = "Afghanistan__AF,Aland Islands__AX,Albania__AL,Algeria__DZ,American Samoa__AS,Andorra__AD,Angola__AO,Anguilla__AI,Antarctica__AQ,Antigua And Barbuda__AG,Argentina__AR,Armenia__AM,Aruba__AW,Australia__AU,Austria__AT,Azerbaijan__AZ,Bahamas__BS,Bahrain__BH,Bangladesh__BD,Barbados__BB,Belarus__BY,Belgium__BE,Belize__BZ,Benin__BJ,Bermuda__BM,Bhutan__BT,Bolivia__BO,Bosnia And Herzegovina__BA,Botswana__BW,Bouvet Island__BV,Brazil__BR,British Indian Ocean Territory__IO,Brunei Darussalam__BN,Bulgaria__BG,Burkina Faso__BF,Burundi__BI,Cambodia__KH,Cameroon__CM,Canada__CA,Cape Verde__CV,Cayman Islands__KY,Central African Republic__CF,Chad__TD,Chile__CL,China__CN,Christmas Island__CX,Cocos (Keeling) Islands__CC,Colombia__CO,Comoros__KM,Congo__CG,Congo__CD,Cook Islands__CK,Costa Rica__CR,Croatia__HR,Cuba__CU,Curacao__CW,Cyprus__CY,Czech Republic__CZ,Denmark__DK,Djibouti__DJ,Dominica__DM,Dominican Republic__DO,Ecuador__EC,Egypt__EG,El Salvador__SV,Equatorial Guinea__GQ,Eritrea__ER,Estonia__EE,Ethiopia__ET,Falkland Islands (Malvinas)__FK,Faroe Islands__FO,Fiji__FJ,Finland__FI,France__FR,French Guiana__GF,French Polynesia__PF,French Southern Territories__TF,Gabon__GA,Gambia__GM,Georgia__GE,Germany__DE,Ghana__GH,Gibraltar__GI,Greece__GR,Greenland__GL,Grenada__GD,Guadeloupe__GP,Guam__GU,Guatemala__GT,Guernsey__GG,Guinea__GN,Guinea-Bissau__GW,Guyana__GY,Haiti__HT,Heard Island & Mcdonald Islands__HM,Holy See (Vatican City State)__VA,Honduras__HN,Hong Kong__HK,Hungary__HU,Iceland__IS,India__IN,Indonesia__ID,Iran__IR,Iraq__IQ,Ireland__IE,Isle Of Man__IM,Israel__IL,Italy__IT,Jamaica__JM,Japan__JP,Jersey__JE,Jordan__JO,Kazakhstan__KZ,Kenya__KE,Kiribati__KI,Korea__KR,Kuwait__KW,Kyrgyzstan__KG,Latvia__LV,Lebanon__LB,Lesotho__LS,Liberia__LR,Libyan Arab Jamahiriya__LY,Liechtenstein__LI,Lithuania__LT,Luxembourg__LU,Macao__MO,Macedonia__MK,Madagascar__MG,Malawi__MW,Malaysia__MY,Maldives__MV,Mali__ML,Malta__MT,Marshall Islands__MH,Martinique__MQ,Mauritania__MR,Mauritius__MU,Mayotte__YT,Mexico__MX,Micronesia__FM,Moldova__MD,Monaco__MC,Mongolia__MN,Montenegro__ME,Montserrat__MS,Morocco__MA,Mozambique__MZ,Myanmar__MM,Namibia__NA,Nauru__NR,Nepal__NP,Netherlands__NL,Netherlands Antilles__AN,New Caledonia__NC,New Zealand__NZ,Nicaragua__NI,Niger__NE,Nigeria__NG,Niue__NU,Norfolk Island__NF,Northern Mariana Islands__MP,Norway__NO,Oman__OM,Pakistan__PK,Palau__PW,Palestinian Territory__PS,Panama__PA,Papua New Guinea__PG,Paraguay__PY,Peru__PE,Philippines__PH,Pitcairn__PN,Poland__PL,Portugal__PT,Puerto Rico__PR,Qatar__QA,Reunion__RE,Romania__RO,Russian Federation__RU,Rwanda__RW,Saint Barthelemy__BL,Saint Helena__SH,Saint Kitts And Nevis__KN,Saint Lucia__LC,Saint Martin__MF,Saint Pierre And Miquelon__PM,Saint Vincent And Grenadines__VC,Samoa__WS,San Marino__SM,Sao Tome And Principe__ST,Saudi Arabia__SA,Senegal__SN,Serbia__RS,Seychelles__SC,Sierra Leone__SL,Singapore__SG,Slovakia__SK,Slovenia__SI,Solomon Islands__SB,Somalia__SO,South Africa__ZA,South Georgia And Sandwich Isl.__GS,Spain__ES,Sri Lanka__LK,Sudan__SD,Suriname__SR,Svalbard And Jan Mayen__SJ,Swaziland__SZ,Sweden__SE,Switzerland__CH,Syrian Arab Republic__SY,Taiwan__TW,Tajikistan__TJ,Tanzania__TZ,Thailand__TH,Timor-Leste__TL,Togo__TG,Tokelau__TK,Tonga__TO,Trinidad And Tobago__TT,Tunisia__TN,Turkey__TR,Turkmenistan__TM,Turks And Caicos Islands__TC,Tuvalu__TV,Uganda__UG,Ukraine__UA,United Arab Emirates__AE,United Kingdom__GB,United States__US,United States Outlying Islands__UM,Uruguay__UY,Uzbekistan__UZ,Vanuatu__VU,Venezuela__VE,Viet Nam__VN,Virgin Islands__VG,Virgin Islands.__VI,Wallis And Futuna__WF,Western Sahara__EH,Yemen__YE,Zambia__ZM,Zimbabwe__ZW";
+
+$contrs01 = explode(',', $contrs);
+
+foreach ($contrs01 as $contrs02) {
+    $contrs03 = explode('__', $contrs02);
+    try {
+        Capsule::table('switchepp_manage_country')->insert(['country' => trim($contrs03[0]), 'country_key' => $contrs03[1]]);
+    } catch (Exception $ex) {
+        logActivity("Unable to insert data switchepp_manage_country: {$ex->getMessage()}");
+    }
+}
+
+/* * **************************Save login detail*************************************** */
+
+if (isset($_POST['save']) && $_POST['save'] == 'Save To Make Connection') {
+    $data = Capsule::table('switchepp_login_details')->first();
+    $data = (array) $data;
+    $rows = Capsule::table('switchepp_login_details')->count();
+    $dataArr = array(
+        'username' => (empty($_POST['login_id'])) ? '' : $_POST['login_id'],
+        'password' => (empty($_POST['password'])) ? '' : $_POST['password'],
+        'epp_url' => (empty($_POST['epp_url'])) ? '' : $_POST['epp_url'],
+        'port' => (empty($_POST['port'])) ? '' : $_POST['port'],
+        'passphrase' => (empty($_POST['passphrase'])) ? '' : $_POST['passphrase'],
+    );
+    if ($rows > 0) {
+        try {
+            Capsule::table('switchepp_login_details')->where('id', $data['id'])->update($dataArr);
+        } catch (Exception $ex) {
+            logActivity("Unable to update data switchepp_login_details: {$ex->getMessage()}");
+        }
+    } else {
+        try {
+            Capsule::table('switchepp_login_details')->insert($dataArr);
+        } catch (Exception $ex) {
+            logActivity("Unable to insert data switchepp_login_details: {$ex->getMessage()}");
+        }
+    }
+}
+$rows = Capsule::table('switchepp_login_details')->count();
+$logindata = Capsule::table('switchepp_login_details')->first();
+$logindata = $data = (array) $logindata;
+$params = array('eppurl' => $logindata['epp_url'], 'eppport' => $logindata['port'], 'registrar_id' => $logindata['username'], 'registrar_password' => $logindata['password'], 'passphrase' => $logindata['passphrase']);
+$error = $msg = '';
+
+if (!empty($_POST['eppCommand'])) {
+    /*     * ******************************* Hello command ************************************* */
+    if ($_POST['eppCommand'] == 'hello') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <hello/>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response = simplexml_load_string($request_xml);
+        
+        
+    /*     * ******************************* Login Command ************************************* */
+    } else if ($_POST['eppCommand'] == 'login') {  #login command
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        } else {
+
+            $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <login>
+                            <clID>' . $_POST['username'] . '</clID>
+                            <pw>' . $_POST['old_pw'] . '</pw>
+                            <newPW>' . $_POST['new_pw'] . '</newPW>
+                            <options>
+                                <version>1.0</version>
+                                <lang>en</lang>
+                            </options>
+                            <svcs>
+                                <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
+                            </svcs>
+                        </login>
+                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                    </command>
+                </epp>';
+
+            $request_xml = $client->request($request);
+            $response_xml = htmlentities($request_xml);
+            $response_chnge = simplexml_load_string($request_xml);
+            $success = $response_chnge->response->result->attributes()->code[0];
+            if ($success == '1000') {
+                foreach ($response_chnge->response->result as $resp) {
+                    $msg = $resp->msg; //for whmcs 
+                }
+            } else {
+                foreach ($response_chnge->response->result as $resp) {
+                    $msg = $resp->msg; //for whmcs 
+                }
+            }
+        }
+    /*     * ******************************* Logout command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'logout') {  #Logout command
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <epp:command xmlns:epp="urn:ietf:params:xml:ns:epp-1.0">
+                                <epp:logout />
+                                <epp:clTRID>' . $data['username'] . '</epp:clTRID>
+                            </epp:command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Poll command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'poll') {  #Poll command
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                        <command>
+                            <poll op="req"/>
+                            <clTRID>POLL-' . rand(10000, 99999) . '</clTRID>
+                        </command>
+                    </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $poll_xml_code = simplexml_load_string($request_xml);
+        $msgid = $poll_xml_code->response->msgQ->attributes()->id[0];
+        $row = Capsule::table('switchepp_store_msgid')->count();
+        $id = Capsule::table('switchepp_store_msgid')->first();
+        $id = (array) $id;
+        if ($row > 0) {
+            try {
+                Capsule::table('switchepp_store_msgid')->where('id', $id['id'])->update(['msgid' => $msgid]);
+            } catch (Exception $ex) {
+                logActivity("Unable to update data switchepp_store_msgid: {$ex->getMessage()}");
+            }
+        } else {
+            try {
+                Capsule::table('switchepp_store_msgid')->insert(['msgid' => $msgid]);
+            } catch (Exception $ex) {
+                logActivity("Unable to insert data switchepp_store_msgid: {$ex->getMessage()}");
+            }
+        }
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Transfer Domain1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'transfer_domain1') {  # Transfer command
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['trnsfr_domain'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <transfer op="request">
+                                    <domain:transfer xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . $domainname . '</domain:name>
+                                    <domain:authInfo>
+                                        <domain:pw>' . $_POST['trnsfr_pw'] . '</domain:pw>
+                                    </domain:authInfo>
+                                    </domain:transfer>
+                                </transfer>
+                            <clTRID>TRANS-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Aknowledge Message command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'acknoledge_msg') {  #Poll Acknowledge message
+        $id = Capsule::table('switchepp_store_msgid')->first();
+        $id = (array) $id;
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <poll op="ack" msgID="' . $id['msgid'] . '"/>
+                                <clTRID>POLLCF-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Check Contact1 Command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'check_contact1') {  #check contact 1
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <check>
+                                    <contact:check xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $_POST['cont1'] . '</contact:id>
+                                        <contact:id>' . $_POST['cont2'] . '</contact:id>
+                                    </contact:check>
+                                </check>
+                            <clTRID>ABC-12345</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create Contact1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_con1') {  #create contact 1
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $_POST['contact_id1'] . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $_POST['cfullname'] . '</contact:name>
+                                            <contact:org>' . $_POST['ccompanyname'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $_POST['caddress1'] . '</contact:street>
+                                                <contact:street>' . $_POST['caddress2'] . '</contact:street>
+                                                <contact:city>' . $_POST['ccity'] . '</contact:city>
+                                                <contact:pc>' . $_POST['cpostcode'] . '</contact:pc>
+                                                <contact:cc>' . $_POST['ccountry'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $_POST['cphone'] . '</contact:voice>
+                                        <contact:email>' . $_POST['cemail'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>admin-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_contact = simplexml_load_string($request_xml);
+        $success = $response_contact->response->result->attributes()->code[0];
+        $admin_id = $response_contact->response->resData->children('contact', true)->creData->id;
+        if ($success == '1000') {
+            $rows = Capsule::table('switchepp_contact_details')->where('type', 'admin')->count();
+            if ($rows > 0) {
+                try {
+                    Capsule::table('switchepp_contact_details')->where('type', 'admin')->update(['contact_id' => $admin_id]);
+                } catch (Exception $ex) {
+                    logActivity("Could't update into table switchepp_contact_details: {$ex->getMessage()}");
+                }
+            } else {
+                try {
+                    Capsule::table('switchepp_contact_details')->insert(['contact_id' => $admin_id]);
+                } catch (Exception $ex) {
+                    logActivity("Could't insert into table switchepp_contact_details: {$ex->getMessage()}");
+                }
+            }
+        }
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create NS1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_ns1') {  #create hostname 1
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                               <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <create>
+                                            <host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                 <host:name>' . $_POST['host_name'] . '</host:name>
+                                                 <host:addr ip="v4">' . $_POST['ip'] . '</host:addr>
+                                            </host:create>
+                                        </create>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                               </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+//if($success == '1000'){
+//$query = mysql_query("SELECT * FROM `switchepp_store_host`");
+//}
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Domain Info 1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'domain_info') {      #domain info 1
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $_POST['domaininfo'] . '</domain:name>
+                                        </domain:info>
+                                    </info>
+                                <clTRID>DOMAININFO-' . rand(100, 999) . '</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Info Tech Contact command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'info_tech_contact') {  #Tech contact info
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+        $result = (array) $data;
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
+						<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> 
+							 <command> 
+								 <info> 
+									 <contact:info 
+										 xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> 
+										 <contact:id>' . $_POST['cont_info'] . '</contact:id> 
+									 </contact:info> 
+								 </info> 
+							 <clTRID>ABC-12345</clTRID> 
+							 </command> 
+						</epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Update Domain1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'update_domain_1') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+
+	# Generate XML for nameservers
+        if ($nameserver1 = $_POST["ns1"]) {
+            $add_hosts = ' <domain:hostObj>' . $nameserver1 . '</domain:hostObj> ';
+        }
+        if ($nameserver2 = $_POST["ns2"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver2 . '</domain:hostObj> ';
+        }
+        if ($nameserver3 = $_POST["ns3"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver3 . '</domain:hostObj> ';
+        }
+        if ($nameserver4 = $_POST["ns4"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver4 . '</domain:hostObj> ';
+        }
+        if ($nameserver5 = $_POST["ns5"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver5 . '</domain:hostObj> ';
+        }
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+        $data = (array) $data;
+        $IDN = new IDNA();
+        $input = $_POST['up_domain_name'];
+        $domainname = $IDN->encode($input);
+        $add_input = $_POST['up_add_ns'];
+        $add_ns = $IDN->encode($add_input);
+        $rem_input = $_POST['up_rem_ns'];
+        $rem_ns = $IDN->encode($rem_input);
+        $dnssec = '';
+        if (isset($_POST['up_d_dnssec']) && $_POST['up_d_dnssec'] == '1') {
+            $dnssec = '<extension>
+                                        <secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                            <secDNS:add> 
+                                                <secDNS:dsData> 
+                                                    <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                    <secDNS:alg>3</secDNS:alg> 
+                                                    <secDNS:digestType>1</secDNS:digestType> 
+                                                        <secDNS:digest>' . strtoupper(bin2hex(uniqid())) . '</secDNS:digest>
+                                                </secDNS:dsData>
+                                            </secDNS:add>
+                                        </secDNS:update> 
+                                    </extension>';
+        }
+
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:add>
+                                                <domain:ns>
+                                                <domain:hostObj>' . $add_ns . '</domain:hostObj>
+                                                </domain:ns>
+                                                <domain:contact type="tech">' . $_POST['up_contact_id'] . '</domain:contact>
+                                            </domain:add>
+                                            <domain:rem>
+                                                <domain:ns>
+                                                    <domain:hostObj>' . $rem_ns . '</domain:hostObj>
+                                                </domain:ns>
+                                            </domain:rem>
+                                            <domain:chg>
+                                            <domain:registrant>' . $_POST['up_contact_id'] . '</domain:registrant>
+                                            </domain:chg>
+                                        </domain:update>
+                                    </update>
+                                    ' . $dnssec . '
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+        
+    /*     * ******************************* Update Domain1 contact command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'update_domain_1_contact') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $IDN = new IDNA();
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $input = $_POST['c_up_domain_name'];
+        error_log("INPUT: \"" . $input . "\" POST: \"" . $_POST['c_up_domain_name'] . "\"");
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:chg>
+	                                        <domain:registrant>' . $_POST['c_up_contact_id'] . '</domain:registrant>
+                                            </domain:chg>
+                                        </domain:update>
+                                    </update>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create Contact 2 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_con2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $_POST['contact_id2'] . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $_POST['cfullname2'] . '</contact:name>
+                                            <contact:org>' . $_POST['ccompanyname2'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $_POST['caddress12'] . '</contact:street>
+                                                <contact:street>' . $_POST['caddress22'] . '</contact:street>
+                                                <contact:city>' . $_POST['ccity2'] . '</contact:city>
+                                                <contact:pc>' . $_POST['cpostcode2'] . '</contact:pc>
+                                                <contact:cc>' . $_POST['ccountry2'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $_POST['cphone2'] . '</contact:voice>
+                                        <contact:email>' . $_POST['cemail2'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>admin-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_contact = simplexml_load_string($request_xml);
+        $success = $response_contact->response->result->attributes()->code[0];
+        $tech_id = $response_contact->response->resData->children('contact', true)->creData->id;
+        if ($success == '1000') {
+            $rows = Capsule::table('switchepp_contact_details')->where('type', 'tech')->count();
+
+            if ($rows > 0) {
+                try {
+                    Capsule::table('switchepp_contact_details')->where('type', 'tech')->update(['contact_id' => $tech_id]);
+                } catch (Exception $ex) {
+                    logActivity("Could't update into table switchepp_contact_details: {$ex->getMessage()}");
+                }
+            } else {
+                try {
+                    Capsule::table('switchepp_contact_details')->insert(['contact_id' => $tech_id]);
+                } catch (Exception $ex) {
+                    logActivity("Could't insert into table switchepp_contact_details: {$ex->getMessage()}");
+                }
+            }
+        }
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Domain 1 Delete command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'domain_delete1') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['domaininfo'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <delete>
+                                        <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                        </domain:delete>
+                                    </delete>
+                                <clTRID>ABC-12345</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create Domain1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_domain_1') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+        $data = (array) $data;
+
+        $data1 = Capsule::table('switchepp_contact_details')->where('type', 'tech')->first();
+        $data1 = (array) $data1;
+
+	//******************* NameServer *************
+        if ($_POST['ns1']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns1'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns2']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns2'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns3']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns3'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns4']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns4'] . '</domain:hostObj>';
+        }
+        if ($ns) {
+            $nsnameserver = ' <domain:ns>
+                                    ' . $ns . '
+                             </domain:ns>';
+        }
+        $dnssec = '';
+        if (isset($_POST['cr_d1_dnssec']) && $_POST['cr_d1_dnssec'] == '1') {
+            $dnssec = '<extension>
+                                        <secDNS:create xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                             <secDNS:dsData> 
+                                                        <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                        <secDNS:alg>3</secDNS:alg> 
+                                                        <secDNS:digestType>1</secDNS:digestType> 
+                                                        <secDNS:digest>' . strtoupper(bin2hex(uniqid())) . '</secDNS:digest>
+                                              </secDNS:dsData>
+                                        </secDNS:create>
+                                   </extension>';
+        }
+        $IDN = new IDNA();
+        $input = $_POST['domain_name'];
+        $domainname = $IDN->encode($input);
+
+	//domian create command
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            ' . $nsnameserver . '
+                                             <domain:registrant>' . $_POST['reg_con_id'] . '</domain:registrant>
+                                             <domain:authInfo>
+                                             <domain:pw>switchpwd' . uniqid() . '</domain:pw>
+                                             </domain:authInfo>
+                                        </domain:create>
+                                    </create>
+                                   ' . $dnssec . '
+                                <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Contact Delete 1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'contact_delete_1') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+        $data = (array) $data;
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <delete>
+                                        <contact:delete xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $_POST['del_contact_id'] . '</contact:id>
+                                        </contact:delete>
+                                    </delete>
+                                <clTRID>ABC-12345</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Delete NS1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'delete_ns_1') {
+
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['nameserver'];
+        $nameserver = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <delete>
+                                    <host:delete xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                        <host:name>' . $nameserver . '</host:name>
+                                    </host:delete>
+                                </delete>
+                            <clTRID>ABC-12345</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Check Domain 2 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'check_domain_2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['domain_name2'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <check>
+                                        <domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                        </domain:check>
+                                    </check>
+                                <clTRID>ABC-12345</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create Domain 2 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_domain_2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+        $data = (array) $data;
+        $data1 = Capsule::table('switchepp_contact_details')->where('type', 'tech')->first();
+        $data1 = (array) $data1;
+
+	//*******************NameServer*************#
+        if ($_POST['ns1']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns1'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns2']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns2'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns3']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns3'] . '</domain:hostObj>';
+        }
+        if ($_POST['ns4']) {
+            $ns .= '<domain:hostObj>' . $_POST['ns4'] . '</domain:hostObj>';
+        }
+        if ($ns) {
+            $nsnameserver = ' <domain:ns>
+                                    ' . $ns . '
+                             </domain:ns>';
+        }
+        $IDN = new IDNA();
+        $input = $_POST['domain_name'];
+        $domainname = $IDN->encode($input);
+
+	//domian create command
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            ' . $nsnameserver . '
+                                             <domain:registrant>' . $_POST['tech_con_id'] . '</domain:registrant>
+                                             <domain:authInfo>
+                                             <domain:pw>switchpwd' . uniqid() . '</domain:pw>
+                                             </domain:authInfo>
+                                        </domain:create>
+                                    </create>
+                                <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Create NS2 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'create_ns2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                               <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <create>
+                                            <host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                 <host:name>' . $_POST['host_name'] . '</host:name>
+                                                 <host:addr ip="v4">' . $_POST['ip'] . '</host:addr>
+                                            </host:create>
+                                        </create>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                               </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Update Domain 1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'update_domain1w_2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['domain'];
+        $domainname = $IDN->encode($input);
+        $input1 = $_POST['upd_nameserver'];
+        $nameserver = $IDN->encode($input1);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:add>
+                                                <domain:ns>
+                                                <domain:hostObj>' . $nameserver . '</domain:hostObj>
+                                                </domain:ns>
+                                            </domain:add>
+                                            <domain:rem/>
+                                            <domain:chg/>
+                             </domain:update>
+                             </update>
+                             <clTRID>Test3</clTRID>
+                             </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Update Contact 2 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'update_con_2') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+//<contact:id>' . $data['contact_id'] . '</contact:id>
+        $data = Capsule::table('switchepp_contact_details')->where('type', 'tech')->first();
+        $data = (array) $data;
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <update>
+                                    <contact:update xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $_POST['contact_id'] . '</contact:id>
+                                        <contact:chg>
+                                            <contact:postalInfo type="loc">
+                                                <contact:org>' . $_POST['cname'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $_POST['add1'] . '</contact:street>
+                                                    <contact:street>' . $_POST['add2'] . '</contact:street>
+                                                    <contact:city>' . $_POST['up_city'] . '</contact:city>
+                                                    <contact:sp>' . $_POST['up_city'] . '</contact:sp>
+                                                    <contact:pc>' . $_POST['up_city'] . '</contact:pc>
+                                                    <contact:cc>' . $_POST['up_country'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $_POST['up_phone'] . '</contact:voice>
+                                            <contact:fax/>
+                                            <contact:email>' . $_POST['email'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>con-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:chg>
+                                    </contact:update>
+                                </update>
+                            <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Delete Domain 1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'del_domain1') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['domaininfo'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <delete>
+                                        <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                        </domain:delete>
+                                    </delete>
+                                <clTRID>ABC-12345</clTRID>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Restore Domain 1 command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'restore_domain_1') {
+	error_log("RESTORE DOMAIN 1");
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        error_log("PARAMS: " . print_r($params,true));
+        $xml1 = switchepp_loggedinepp($client, $params);
+
+        $IDN = new IDNA();
+        $input = $_POST['domain_name1'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:chg/>
+                                        </domain:update>
+                                    </update>
+                                    <extension>
+                                        <rgp:update xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:rgp-1.0 rgp-1.0.xsd">
+                                    	    <rgp:restore op="request"/>
+                                        </rgp:update>
+                                    </extension>
+                                </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    /*     * ******************************* Update Domain Auth command ************************************* */
+    } elseif ($_POST['eppCommand'] == 'update_domain_auth') {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        if (is_array($client)) {
+            $error = $client['msg'];
+        }
+        $xml1 = switchepp_loggedinepp($client, $params);
+        $IDN = new IDNA();
+        $input = $_POST['domain_update'];
+        $domainname = $IDN->encode($input);
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:chg>
+                                                <domain:authInfo>
+                                                    <domain:pw>' . $_POST['auth'] . '</domain:pw>
+                                                </domain:authInfo>
+                                            </domain:chg>
+                             </domain:update>
+                             </update>
+                             <clTRID>Test3</clTRID>
+                             </command>
+                            </epp>';
+        $request_xml = $client->request($request);
+        $response_xml = htmlentities($request_xml);
+        $response_chnge = simplexml_load_string($request_xml);
+        $success = $response_chnge->response->result->attributes()->code[0];
+        if ($success == '1000') {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        } else {
+            foreach ($response_chnge->response->result as $resp) {
+                $msg = $resp->msg; //for whmcs 
+            }
+        }
+    }
+}
+
+
+
+
+
+
+function switchepp_clientloginepp($params) {
+    try {
+        $certFile = __DIR__ . '/../cert/cert.pem';
+        $client = new Net_EPP_Client();
+        $use_ssl = true;
+        if (file_exists($certFile)) {
+            $context = stream_context_create();
+            stream_context_set_option($context, 'ssl', 'verify_peer', false);
+            stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
+            stream_context_set_option($context, 'ssl', 'local_cert', $certFile);
+            stream_context_set_option($context, 'ssl', 'passphrase', $params['passphrase']);
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        } else {
+            $context = false;
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        }
+    } catch (Exception $e) {
+        $port = $params['eppport'];
+        $client = array("error" => 'true', 'msg' => "Connection Error: " . $e->getMessage());
+    }
+    return $client;
+
+    return $client;
+}
+
+function switchepp_loggedinepp($client, $params) {
+    if (is_array($client)) {
+        $error = $client['msg'];
+        return $error;
+    }
+    if ($params['eppurl'] != '' && $params['eppport'] != '' && $params['registrar_password'] != '' && $params['registrar_id'] != '') {
+        $request = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <login>
+                            <clID>' . $params['registrar_id'] . '</clID>
+                            <pw>' . $params['registrar_password'] . '</pw>
+                            <options>
+                                <version>1.0</version>
+                                <lang>en</lang>
+                            </options>
+                            <svcs>
+                                <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
+                                <svcExtension>
+                                    <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
+                                    <extURI>urn:ietf:params:xml:ns:changePoll-1.0</extURI>
+                                    <extURI>https://www.nic.ch/epp/balance-1.0</extURI>
+                                </svcExtension>
+                            </svcs>
+                        </login>
+                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                    </command>
+                </epp>';
+        //error_log("switchepp_loggedinepp: " . $client . " | " . $params);
+        $response = $client->request($request);
+        return $response;
+    }
+}
+
+function switchepp_domain_info($domain) {
+    $IDN = new IDNA();
+    $input = $domain;
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <info>
+                            <domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                <domain:name>' . $domainname . '</domain:name>
+                            </domain:info>
+                        </info>
+                    <clTRID>clientref-' . rand(100, 999) . '</clTRID>
+                    </command>
+                </epp>';
+    return $xml;
+}
+?><html>
+    <head>
+        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
+        <script>
+            $(document).ready(function () {
+                $('#selectcommand').change(function () {
+                    var command = this.value;
+                    
+                    if (command == 'create_con1') {
+                	//alert(command);
+                        $('#createContact1').css('display', 'block');
+                        $('#contactInfo').css('display', 'none');
+                    } else {
+                        $('#createContact1').css('display', 'none');
+                    }
+                    
+                    if (command == 'create_con2') {
+                	//alert(command);
+                        $('#createContact2').css('display', 'block');
+                        $('#contactInfo').css('display', 'none');
+                    } else {
+                        $('#createContact2').css('display', 'none');
+                    }
+
+                    if (command == 'update_con_2') {
+                	alert(command);
+                        $("#updateContact").css("display", "block");
+                    } else {
+                        $("#updateContact").css("display", "none");
+                    }
+                    if (command == 'info_tech_contact') {
+                        $("#info_tech_contact").css("display", "block");
+                    } else {
+                        $("#info_tech_contact").css("display", "none");
+                    }
+                    if (command == 'transfer_domain1') {
+                        $('#transferDomain').css('display', 'block');
+                    } else {
+                        $('#transferDomain').css('display', 'none');
+                    }
+                    if (command == 'create_ns1' || command == 'create_ns2') {
+                        $("#create_name_server1").css("display", "block");
+                    } else {
+                        $("#create_name_server1").css("display", "none");
+                    }
+                    if (command == 'check_contact1') {
+                        $("#check_contact1").css("display", "block");
+                    } else {
+                        $("#check_contact1").css("display", "none");
+                    }
+                    if (command == 'update_domain1w_2') {
+                        $("#update_domain1_2").css("display", "block");
+                    } else {
+                        $("#update_domain1_2").css("display", "none");
+                    }
+                    if (command == 'update_domain_auth') {
+                        $("#update_domain_auth").css("display", "block");
+                    } else {
+                        $("#update_domain_auth").css("display", "none");
+                    }
+                    if (command == 'delete_ns_1') {
+                        $("#delete_ns_1").css("display", "block");
+                    } else {
+                        $("#delete_ns_1").css("display", "none");
+                    }
+                    if (command == 'contact_delete_1') {
+                        $("#contact_delete_1").css("display", "block");
+                    } else {
+                        $("#contact_delete_1").css("display", "none");
+                    }
+                    if (command == 'check_domain_2') {
+                        $("#check_domain_2").css("display", "block");
+                    } else {
+                        $("#check_domain_2").css("display", "none");
+                    }
+                    if (command == 'create_domain_1' || command == 'create_domain_2') {
+                        $("#create_domain").css("display", "block");
+                    } else {
+                        $("#create_domain").css("display", "none");
+                    }
+                    if (command == 'restore_domain_1') {
+                        $("#restore_domain_1").css("display", "block");
+                    } else {
+                        $("#restore_domain_1").css("display", "none");
+                    }
+                    if (command == 'update_domain_1') {
+                        $("#update_domain_1").css("display", "block");
+                    } else {
+                        $("#update_domain_1").css("display", "none");
+                    }
+                    if (command == 'update_domain_1_contact') {
+                        $("#update_domain_1_contact").css("display", "block");
+                    } else {
+                        $("#update_domain_1_contact").css("display", "none");
+                    }
+                    if (command == 'login') {
+                        $("#changepw").css('display', 'block');
+                    } else {
+                        $("#changepw").css('display', 'none');
+                    }
+                    if (command == 'logout') {
+                        $("#update_domain_auth").css("display", "none");
+                    }
+                    if (command == 'contact_info') {
+                        $('#contactInfo').css('display', 'block');
+                        $('#createContact').css('display', 'none');
+                    } else {
+                        $('#contactInfo').css('display', 'none');
+                    }
+
+                    //                    if (command == 'contact_delete1') {
+                    //                        $('#contactInfo').css('display', 'block');
+                    //                        //$('#createContact').css('display', 'none');
+                    //                    } else {
+                    //                        $('#contactInfo').css('display', 'none');
+                    //                    }
+                    if (command == 'domain_create') {
+                        $('#optionsforcontacts').css('display', 'block');
+
+                    } else {
+                        $('#optionsforcontacts').css('display', 'none');
+                    }
+
+                    if (command == 'domain_info' || command == 'domain_check' || command == 'domain_delete1' || command == 'del_domain1') {
+                        $('#domaininfo').css('display', 'block');
+                    } else {
+                        $('#domaininfo').css('display', 'none');
+                    }
+
+
+                    $('.det').click(function () {
+                        // alert(this.id);
+                        var selected = this.id;
+                        if (selected == 'existing') {
+                            $('#selectedoption').val('existing');
+                        } else {
+                            $('#selectedoption').val('newdetails');
+                            $('#createContactfordomain').css('display', 'block');
+                        }
+                    });
+
+                });
+            });
+        </script>
+    </head>
+    <body>
+        <?php
+        $rows = Capsule::table('switchepp_login_details')->count();
+        $data = Capsule::table('switchepp_login_details')->first();
+        $data = (array) $data;
+        ?>
+        <div style="border:1px solid red;float:left;width: 50%;background: #dff0d8;margin-left: 25%;  padding: 10px;border: 1px solid gray;border-radius: 7px;">
+
+            <form action="" method="POST">
+                <h3 style="text-align: center;margin-top: 5px;">Try our EPP Demonstrator:</h3>
+
+                <table style="margin: 12px 88px;">
+                    <tr>
+                        <td>
+                            <table>
+                                <tr>
+                                    <td>Socket Url :</td><td><input type="text" required="required" name="epp_url" value="<?php echo $data['epp_url']; ?>"></td>
+                                </tr>
+                                <tr>
+                                    <td>login Id :</td><td><input type="text" required="required" name="login_id" value="<?php echo $data['username']; ?>"></td>
+                                </tr>
+                            </table>
+                        </td>
+                        <td>
+                            <table>
+                                <tr>
+                                    <td>Port :</td><td><input type="text" required="required" name="port" value="<?php echo $data['port']; ?>"></td>
+                                </tr>
+                                <tr>
+                                    <td>Password :</td><td><input type="text" required="required" name="password" value="<?php echo $data['password']; ?>"></td>
+                                </tr>
+                            </table>
+                        </td>
+                    </tr>
+                    <input type="hidden" name="save" value="Save To Make Connection">
+<!--                        <tr>
+                        <td colspan="3"><input type="submit" name="save" value="Save To Make Connection"></td>
+                    </tr>-->
+                </table>
+                <?php //} if ($rows > 0) {                        ?>
+                <p align="center">Select Command to execute</p>
+                <p align="center"><select name="eppCommand" id="selectcommand">
+                        <option value="">Select an EPP command ...</option>
+                        <!--<optgroup label="EPP Core Commands">-->
+                        <option value="hello">Hello Command</option>
+                        <option value="login">1: Login and change password</option>
+                        <option value="poll">2: Poll and confirm messages</option>
+                        <option value="transfer_domain1">3: Transfer domain 1</option>
+                        <option value="acknoledge_msg">4: Acknowledge messages </option>
+                        <!--</optgroup>-->
+                        <!--<optgroup label="EPP Contact Commands">-->
+                        <option value="check_contact1">5: Check contact 1</option>
+                        <option value="create_con1">6: Create contact 1</option>
+                        <option value="create_ns1">7: Create name server 1</option>
+                        <option value="domain_info">8: Info domain 1</option>
+                        <option value="info_tech_contact">9: Info Tech Contact</option>
+                        <!--</optgroup>-->
+                        <!--<optgroup label="EPP Domain Commands">-->
+                        <option value="update_domain_1">10: Update domain 1</option>
+                        <option value="create_con2">11: Create contact 2</option>
+                        <option value="domain_delete1">12: Delete domain 1 (for a holder transfer)</option>
+                        <option value="restore_domain_1">13: Restore domain 1</option>
+                        <option value="update_domain_1_contact">14: Update domain 1 Contact</option>
+                        <option value="contact_delete_1">15: Delete contact 1</option>
+                        <option value="delete_ns_1">16: Delete name server 1</option>
+                        <option value="check_domain_2">17: Check domain</option>
+                        <option value="create_domain_2">18: Create domain 2</option>
+                        <option value="create_ns2">19: Create name server 2</option>
+                        <option value="update_domain1w_2">20: Update domain 1 with ns 2</option>
+                        <option value="update_con_2">21: Update contact 2</option>
+                        <option value="update_domain_auth">22: Update domain 2 with authinfo</option>
+                        <option value="create_domain_1">Create domain 1</option>
+                        <option value="del_domain1">Delete domain 1</option>
+                        <option value="logout">Logout</option>
+                        <!--</optgroup>-->
+                    </select>
+                </p>
+                <p align="center" style="color: #ff0000;"><?php echo $error; ?></p>
+                <?php //}                        ?>
+                <p style="display: none;" id="hostip" align="center">Enter  <input type="text" name="ipaddress" id="field" placeholder="ns1.example-12345.com"></p>
+                <p style="display: none;" id="optionsforcontacts">
+                    Enter Domain Name : <input type="text" name="domain" placeholder="xyz123.qa"> <br> <br> 
+                                <input type="radio" name="usedetails" class="det" id="existing">Use Existing Contacts<br>
+                                        <input type="radio" class="det" name="usedetails" id="newdetails">Make New
+                                            <input type="hidden" id="selectedoption" name="selectedoption" value="">
+                                                </p>
+                                                </table>
+                                                <table style="display: none" id="createContactfordomain">
+                                                    <tbody>
+                                                        <tr><td>Name </td><td><input type="text" name="c_fullname" placeholder="your fullname"></td></tr>
+                                                        <tr><td>Company name </td><td><input type="text" name="c_companyname" placeholder="your company name"></td></tr>
+                                                        <tr><td>Address1 </td><td><input type="text" name="c_address1" placeholder="your address"></td></tr>
+                                                        <tr><td>Address2 </td><td><input type="text" name="c_address2" placeholder="alternate address"></td></tr>
+                                                        <tr><td>City </td><td><input type="text" name="c_city" placeholder="your city"></td></tr>
+                                                        <tr><td>Postcode </td><td><input type="text" name="c_postcode" placeholder="zip code"></td></tr>
+                                                        <tr><td>Country </td><td><select name="country" id="country" tabindex="13"><?php
+                                                                    foreach (Capsule::table('switchepp_manage_country')->get() as $rowdata) {
+                                                                        $rowdata = (array) $rowdata;
+                                                                        ?>
+                                                                        <option value="<?php echo $rowdata['country_key']; ?>"><?php echo $rowdata['country']; ?></option>
+                                                                    <?php } ?></select></td></tr>
+                                                        <tr><td>Phone Number</td><td><input type="text" name="c_phone" placeholder="+1.123456789"></td></tr>
+                                                        <tr><td>Email</td><td><input type="email" name="c_email" placeholder="abc@abc123.com"></td></tr>
+                                                    </tbody>
+                                                </table>
+                                                <table style="display: none;" id="createContact">
+                                                    <tbody>
+                                                        <tr><td>Contact id</td><td><input name="contact_id2" type="text" value="" placeholder="TEST-123456"></td></tr>
+                                                        <tr><td>Name </td><td><input type="text" name="fullname" placeholder="your fullname"></td></tr>
+                                                        <tr><td>Company name </td><td><input type="text" name="companyname" placeholder="your company name"></td></tr>
+                                                        <tr><td>Address1 </td><td><input type="text" name="address1" placeholder="your address"></td></tr>
+                                                        <tr><td>Address2 </td><td><input type="text" name="address2" placeholder="alternate address"></td></tr>
+                                                        <tr><td>City </td><td><input type="text" name="city" placeholder="your city"></td></tr>
+                                                        <tr><td>Postcode </td><td><input type="text" name="postcode" placeholder="zip code"></td></tr>
+                                                        <tr><td>Country </td><td><select name="country" id="country" tabindex="13">
+                                                    		<option value="CH">Switzerland</option>
+                                                    		<option value="DE">Germany</option>
+                                                    		<option value="LI">Liechtenstein</option>
+                                                    		<option value="IT">Italy</option>
+                                                    		<option value="FR">France</option>
+                                                        </select></td></tr>
+                                                        <tr><td>Phone Number</td><td><input type="text" name="phone" placeholder="0123567890"></td></tr>
+                                                        <tr><td>Email</td><td><input type="email" name="email" placeholder="abc@abc123.com"></td></tr>
+                                                    </tbody>
+                                                </table>
+                                                <table style="display: none;" id="check_contact1">
+                                                    <tr>
+                                                        <td>Contact id 1:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="cont1"</td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Contact id 2:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="cont2"</td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display:none;" id="info_tech_contact">
+                                                    <tr>
+                                                        <td>Contact id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="cont_info" value="" placeholder="TEST-12345"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display:none;" id="contact_delete_1">
+                                                    <tr>
+                                                        <td>Contact Id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="del_contact_id" placeholder="TEST-12345"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="createContact1">
+                                                    <tbody>
+                                                        <tr><td>Contact id</td><td><input name="contact_id1" type="text" value="" placeholder="TEST-123456"></td></tr>
+                                                        <tr><td>Name </td><td><input type="text" name="cfullname" placeholder="your fullname"></td></tr>
+                                                        <tr><td>Company name </td><td><input type="text" name="ccompanyname" placeholder="your company name"></td></tr>
+                                                        <tr><td>Address1 </td><td><input type="text" name="caddress1" placeholder="your address"></td></tr>
+                                                        <tr><td>Address2 </td><td><input type="text" name="caddress2" placeholder="alternate address"></td></tr>
+                                                        <tr><td>City </td><td><input type="text" name="ccity" placeholder="your city"></td></tr>
+                                                        <tr><td>Postcode </td><td><input type="text" name="cpostcode" placeholder="zip code"></td></tr>
+                                                        <tr><td>Country </td><td><select name="ccountry" id="country" tabindex="13">
+                                                    		<option value="CH">Switzerland</option>
+                                                    		<option value="DE">Germany</option>
+                                                    		<option value="LI">Liechtenstein</option>
+                                                    		<option value="IT">Italy</option>
+                                                    		<option value="FR">France</option>
+
+                                                            </select></td></tr>
+                                                        <tr><td>Phone Number</td><td><input type="text" name="cphone" placeholder="0123567890"></td></tr>
+                                                        <tr><td>Email</td><td><input type="email" name="cemail" placeholder="abc@abc123.com"></td></tr>
+                                                    </tbody>
+                                                </table>
+                                                <table style="display: none;" id="createContact2">
+                                                    <tbody>
+                                                        <tr><td>Contact id</td><td><input name="contact_id2" type="text" value="" placeholder="TEST-123456"></td></tr>
+                                                        <tr><td>Name </td><td><input type="text" name="cfullname2" placeholder="your fullname"></td></tr>
+                                                        <tr><td>Company name </td><td><input type="text" name="ccompanyname2" placeholder="your company name"></td></tr>
+                                                        <tr><td>Address1 </td><td><input type="text" name="caddress12" placeholder="your address"></td></tr>
+                                                        <tr><td>Address2 </td><td><input type="text" name="caddress22" placeholder="alternate address"></td></tr>
+                                                        <tr><td>City </td><td><input type="text" name="ccity2" placeholder="your city"></td></tr>
+                                                        <tr><td>Postcode </td><td><input type="text" name="cpostcode2" placeholder="zip code"></td></tr>
+                                                        <tr><td>Country </td><td><select name="ccountry2" id="ccountry2" tabindex="13">
+                                                    		<option value="CH">Switzerland</option>
+                                                    		<option value="DE">Germany</option>
+                                                    		<option value="LI">Liechtenstein</option>
+                                                    		<option value="IT">Italy</option>
+                                                    		<option value="FR">France</option>
+                                                            </select></td></tr>
+                                                        <tr><td>Phone Number</td><td><input type="text" name="cphone2" placeholder="0123567890"></td></tr>
+                                                        <tr><td>Email</td><td><input type="email" name="cemail2" placeholder="abc@abc123.com"></td></tr>
+                                                    </tbody>
+                                                </table>
+                                                <?php
+                                                $client = switchepp_clientloginepp($params);      #Epp Connection
+                                                if (is_array($client)) {
+                                                    $error = $client['msg'];
+                                                } {
+                                                    $xml1 = switchepp_loggedinepp($client, $params);
+
+                                                    $result = Capsule::table('switchepp_contact_details')->where('type', 'admin')->first();
+                                                    $result = (array) $result;
+                                                    if ($result['contact_id'] != '') {
+                                                        $request_xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
+						<epp xmlns="urn:ietf:params:xml:ns:epp-1.0"> 
+							 <command> 
+								 <info> 
+									 <contact:info 
+										 xmlns:contact="urn:ietf:params:xml:ns:contact-1.0"> 
+										 <contact:id>' . $result['contact_id'] . '</contact:id> 
+									 </contact:info> 
+								 </info> 
+							 <clTRID>ABC-12345</clTRID> 
+							 </command> 
+						</epp>';
+                                                        $get_response_xml = $client->request($request_xml);
+                                                        $get_xml_data = simplexml_load_string($get_response_xml);
+                                                        $get_data = $get_xml_data->response->resData->children("contact", true)->infData;
+                                                    }
+                                                }
+                                                ?>
+                                                <table style="display: none;" id="updateContact">
+                                                    <tbody>
+                                                        <!--<tr><td>Contact Type </td><td><select name="typeOfcontact"><option value="">Choose</option><option value="registrant">Registrant</option><option value="tech">Tech</option><option value="billing">Billing</option><option value="admin">Admin</option></select></td></tr>-->
+                                                        <tr><td>Contact id</td><td><input name="contact_id" type="text" value="" placeholder="TEST-123456"></td></tr>
+                                                        <tr><td>Name </td><td><input type="text" name="fname" placeholder="your fullname" value="<?php echo $get_data->postalInfo->name; ?>"></td></tr>
+                                                        <tr><td>Company name </td><td><input type="text" name="cname" placeholder="your company name" value="<?php echo $get_data->postalInfo->org; ?>"></td></tr>
+                                                        <tr><td>Address1 </td><td><input type="text" name="add1" placeholder="your address" value="<?php echo $get_data->postalInfo->addr->street[0]; ?>"></td></tr>
+                                                        <tr><td>Address2 </td><td><input type="text" name="add2" placeholder="alternate address" value="<?php echo $get_data->postalInfo->addr->street[1]; ?>"></td></tr>
+                                                        <tr><td>City </td><td><input type="text" name="up_city" placeholder="your city" value="<?php echo $get_data->postalInfo->addr->city; ?>"></td></tr>
+                                                        <tr><td>Postcode </td><td><input type="text" name="pcode" placeholder="zip code" value="<?php echo $get_data->postalInfo->addr->pc; ?>"></td></tr>
+                                                        <tr><td>Country </td><td><select name="up_country" id="country" tabindex="13"><?php
+                                                                    foreach (Capsule::table('switchepp_manage_country')->get() as $rowdata) {
+                                                                        $rowdata = (array) $rowdata;
+                                                                        ?>
+                                                                        <option value="<?php echo $rowdata['country_key']; ?>" <?php if ($rowdata['country_key'] == $get_data->postalInfo->addr->cc) { ?> selected="selected" <?php } ?>><?php echo $rowdata['country']; ?></option>
+                                                                    <?php } ?></select></td></tr>
+                                                        <tr><td>Phone Number</td><td><input type="text" name="up_phone" placeholder="+1.123456789" value="<?php echo $get_data->voice; ?>"></td></tr>
+                                                        <tr><td>Email</td><td><input type="up_email" name="email" placeholder="abc@abc123.com" value="<?php echo $get_data->email; ?>"></td></tr>
+                                                    </tbody>
+                                                </table>
+                                                <table style="display: none;" id="contactInfo">
+                                                    <tbody>
+                                                        <tr>
+                                                        </tr>
+                                                    </tbody>
+                                                </table>
+                                                <table style="display: none;" id="transferDomain">
+                                                    <tr>
+                                                        <td>Transfer Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="trnsfr_domain" value="" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Password:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="trnsfr_pw" value=""></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="update_domain_auth">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="domain_update" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Domain Password:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="auth"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="update_domain1_2">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="domain" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="upd_nameserver"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display:none" id="create_name_server1">
+                                                    <tr>
+                                                        <td>Name Server:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="host_name" value="" placeholder="ns1.yourdomain.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Ip Address:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="ip" value="" placeholder="xx.xx.xx.xx"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="create_domain">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="domain_name" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Reg Contact id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="reg_con_id" placeholder="TEST-12345"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Tech Contact id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="tech_con_id" placeholder="TEST-12345"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server 1:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="ns1.yourdomain.com" name="ns1"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server 2:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="ns2.yourdomain.com" name="ns2"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server 3:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="ns3"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server 4:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="ns4"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Name Server 5:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="ns5"></td>
+                                                    </tr>
+
+                                                    <tr>
+                                                        <td>DNSSEC:</td>
+                                                        <td></td>
+                                                        <td><input type="checkbox" value="1" name="cr_d1_dnssec"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="update_domain_1">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="up_domain_name" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Registrant Id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="up_contact_id" placeholder="TEST-12345-1"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Add Name Server:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="ns2.yourdomain.com" name="up_add_ns"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Remove Name Server:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="ns1.yourdomain.com" name="up_rem_ns"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>DNSSEC:</td>
+                                                        <td></td>
+                                                        <td><input type="checkbox" value="1" name="up_d_dnssec"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="update_domain_1_contact">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="c_up_domain_name" placeholder="example.ch"></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Registrant Id:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="c_up_contact_id" placeholder="TEST-12345-1"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="check_domain_2">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="domain_name2" placeholder="example.ch"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="restore_domain_1">
+                                                    <tr>
+                                                        <td>Domain Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" value="" name="domain_name1" placeholder="example.ch"></td>
+                                                    </tr>
+                                                </table>
+                                                <table id="delete_ns_1" style="display:none;">
+                                                    <tr>
+                                                        <td>Name Server</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="nameserver" value="" placeholder="ns1.yourdomain.ch"></td>
+                                                    </tr>
+                                                </table>
+                                                <table style="display: none;" id="changepw">
+                                                    <tr>
+                                                        <td>Username Name:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="username" value=""></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>Old Password:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="old_pw" value=""></td>
+                                                    </tr>
+                                                    <tr>
+                                                        <td>New Password:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="new_pw" value=""></td>
+                                                    </tr>
+                                                </table>
+                                                <table id="domaininfo" style="display: none;">
+                                                    <tr>
+                                                        <td>Enter domain:</td>
+                                                        <td></td>
+                                                        <td><input type="text" name="domaininfo" placeholder="example.ch"></td>
+                                                    </tr>
+                                                </table>
+
+                                                <?php
+// if ($rows > 0) {
+                                                ?>
+                                                <p align="center"><input type="submit" name="execute" value="Execute"></p>
+                                                <p align="center"><?php echo $msg; ?></p>
+                                                <?php // }
+                                                ?>
+                                                </form>
+                                                Epp Request : <textarea rows="15" cols="85" style="line-height: 20px;padding: 5px;word-break: break-word;display:<?php
+                                                if (!empty($request)) {
+                                                    echo 'display:block';
+                                                } else {
+                                                    echo'display:none';
+                                                }
+                                                ?>"><?php
+                                                                            if (!empty($request)) {
+                                                                                echo $request;
+                                                                            }
+                                                                            ?></textarea>
+                                                <p>************************************************************************************</p>
+                                                Epp Response : <textarea rows="20" cols="85" style="line-height: 20px;padding: 5px;word-break: break-word;display:<?php
+                                                                         if (!empty($response_xml)) {
+                                                                             echo 'display:block';
+                                                                         } else {
+                                                                             echo'display:none';
+                                                                         }
+                                                                         ?>"><?php
+                                                                             if (!empty($response_xml)) {
+                                                                                 echo $response_xml;
+                                                                             }
+                                                                             ?></textarea>
+                                                </div>
+                                                </body>
+                                                </html>

+ 1213 - 0
idna_convert.class.php

@@ -0,0 +1,1213 @@
+<?php
+
+namespace WGSSWITCHEPP\IDNA;
+
+// {{{ license
+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */
+//
+// +----------------------------------------------------------------------+
+// | This library is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU Lesser General Public License as       |
+// | published by the Free Software Foundation; either version 2.1 of the |
+// | License, or (at your option) any later version.                      |
+// |                                                                      |
+// | This library is distributed in the hope that it will be useful, but  |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of           |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
+// | Lesser General Public License for more details.                      |
+// |                                                                      |
+// | You should have received a copy of the GNU Lesser General Public     |
+// | License along with this library; if not, write to the Free Software  |
+// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 |
+// | USA.                                                                 |
+// +----------------------------------------------------------------------+
+//
+// }}}
+/**
+ * Encode/decode Internationalized Domain Names.
+ *
+ * The class allows to convert internationalized domain names
+ * (see RFC 3490 for details) as they can be used with various registries worldwide
+ * to be translated between their original (localized) form and their encoded form
+ * as it will be used in the DNS (Domain Name System).
+ *
+ * The class provides two public methods, encode() and decode(), which do exactly
+ * what you would expect them to do. You are allowed to use complete domain names,
+ * simple strings and complete email addresses as well. That means, that you might
+ * use any of the following notations:
+ *
+ * - www.nörgler.com
+ * - xn--nrgler-wxa
+ * - xn--brse-5qa.xn--knrz-1ra.info
+ *
+ * Unicode input might be given as either UTF-8 string, UCS-4 string or UCS-4
+ * array. Unicode output is available in the same formats.
+ * You can select your preferred format via {@link set_paramter()}.
+ *
+ * ACE input and output is always expected to be ASCII.
+ *
+ * @author  Matthias Sommerfeld <mso@phlylabs.de>
+ * @copyright 2004-2007 phlyLabs Berlin, http://phlylabs.de
+ * @version 0.5.1
+ *
+ */
+class idna_convert {
+
+    /**
+     * Holds all relevant mapping tables, loaded from a seperate file on construct
+     * See RFC3454 for details
+     *
+     * @var array
+     * @access private
+     */
+    var $NP = array();
+    // Internal settings, do not mess with them
+    var $_punycode_prefix = 'xn--';
+    var $_invalid_ucs = 0x80000000;
+    var $_max_ucs = 0x10FFFF;
+    var $_base = 36;
+    var $_tmin = 1;
+    var $_tmax = 26;
+    var $_skew = 38;
+    var $_damp = 700;
+    var $_initial_bias = 72;
+    var $_initial_n = 0x80;
+    var $_sbase = 0xAC00;
+    var $_lbase = 0x1100;
+    var $_vbase = 0x1161;
+    var $_tbase = 0x11A7;
+    var $_lcount = 19;
+    var $_vcount = 21;
+    var $_tcount = 28;
+    var $_ncount = 588;   // _vcount * _tcount
+    var $_scount = 11172; // _lcount * _tcount * _vcount
+    var $_error = false;
+    // See {@link set_paramter()} for details of how to change the following
+    // settings from within your script / application
+    var $_api_encoding = 'utf8'; // Default input charset is UTF-8
+    var $_allow_overlong = false;  // Overlong UTF-8 encodings are forbidden
+    var $_strict_mode = false;  // Behave strict or not
+
+    // The constructor
+
+    function idna_convert($options = false) {
+        $this->slast = $this->_sbase + $this->_lcount * $this->_vcount * $this->_tcount;
+        if (function_exists('file_get_contents')) {
+            $this->NP = unserialize(file_get_contents(dirname(__FILE__) . '/npdata.ser'));
+        } else {
+            $this->NP = unserialize(join('', file(dirname(__FILE__) . '/npdata.ser')));
+        }
+        // If parameters are given, pass these to the respective method
+        if (is_array($options)) {
+            return $this->set_parameter($options);
+        }
+        return true;
+    }
+
+    /**
+     * Sets a new option value. Available options and values:
+     * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+     *         'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+     * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+     *             to allow this, set this parameter to true, else to false;
+     *             default is false.]
+     * [strict - true: strict mode, good for registration purposes - Causes errors
+     *           on failures; false: loose mode, ideal for "wildlife" applications
+     *           by silently ignoring errors and returning the original input instead
+     *
+     * @param    mixed     Parameter to set (string: single parameter; array of Parameter => Value pairs)
+     * @param    string    Value to use (if parameter 1 is a string)
+     * @return   boolean   true on success, false otherwise
+     * @access   public
+     */
+    function set_parameter($option, $value = false) {
+        if (!is_array($option)) {
+            $option = array($option => $value);
+        }
+        foreach ($option as $k => $v) {
+            switch ($k) {
+                case 'encoding':
+                    switch ($v) {
+                        case 'utf8':
+                        case 'ucs4_string':
+                        case 'ucs4_array':
+                            $this->_api_encoding = $v;
+                            break;
+                        default:
+                            $this->_error('Set Parameter: Unknown parameter ' . $v . ' for option ' . $k);
+                            return false;
+                    }
+                    break;
+                case 'overlong':
+                    $this->_allow_overlong = ($v) ? true : false;
+                    break;
+                case 'strict':
+                    $this->_strict_mode = ($v) ? true : false;
+                    break;
+                default:
+                    $this->_error('Set Parameter: Unknown option ' . $k);
+                    return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * Decode a given ACE domain name
+     * @param    string   Domain name (ACE string)
+     * [@param    string   Desired output encoding, see {@link set_parameter}]
+     * @return   string   Decoded Domain name (UTF-8 or UCS-4)
+     * @access   public
+     */
+    function decode($input, $one_time_encoding = false) {
+        // Optionally set
+        if ($one_time_encoding) {
+            switch ($one_time_encoding) {
+                case 'utf8':
+                case 'ucs4_string':
+                case 'ucs4_array':
+                    break;
+                default:
+                    $this->_error('Unknown encoding ' . $one_time_encoding);
+                    return false;
+            }
+        }
+        // Make sure to drop any newline characters around
+        $input = trim($input);
+        // Negotiate input and try to determine, whether it is a plain string,
+        // an email address or something like a complete URL
+        if (strpos($input, '@')) { // Maybe it is an email address
+            // No no in strict mode
+            if ($this->_strict_mode) {
+                $this->_error('Only simple domain name parts can be handled in strict mode');
+                return false;
+            }
+            list ($email_pref, $input) = explode('@', $input, 2);
+            $arr = explode('.', $input);
+            foreach ($arr as $k => $v) {
+                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
+                    $conv = $this->_decode($v);
+                    if ($conv)
+                        $arr[$k] = $conv;
+                }
+            }
+            $input = join('.', $arr);
+            $arr = explode('.', $email_pref);
+            foreach ($arr as $k => $v) {
+                if (preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $v)) {
+                    $conv = $this->_decode($v);
+                    if ($conv)
+                        $arr[$k] = $conv;
+                }
+            }
+            $email_pref = join('.', $arr);
+            $return = $email_pref . '@' . $input;
+        } elseif (preg_match('![:\./]!', $input)) { // Or a complete domain name (with or without paths / parameters)
+            // No no in strict mode
+            if ($this->_strict_mode) {
+                $this->_error('Only simple domain name parts can be handled in strict mode');
+                return false;
+            }
+            $parsed = parse_url($input);
+            if (isset($parsed['host'])) {
+                $arr = explode('.', $parsed['host']);
+                foreach ($arr as $k => $v) {
+                    $conv = $this->_decode($v);
+                    if ($conv)
+                        $arr[$k] = $conv;
+                }
+                $parsed['host'] = join('.', $arr);
+                $return = (empty($parsed['scheme']) ? '' : $parsed['scheme'] . (strtolower($parsed['scheme']) == 'mailto' ? ':' : '://'))
+                        . (empty($parsed['user']) ? '' : $parsed['user'] . (empty($parsed['pass']) ? '' : ':' . $parsed['pass']) . '@')
+                        . $parsed['host']
+                        . (empty($parsed['port']) ? '' : ':' . $parsed['port'])
+                        . (empty($parsed['path']) ? '' : $parsed['path'])
+                        . (empty($parsed['query']) ? '' : '?' . $parsed['query'])
+                        . (empty($parsed['fragment']) ? '' : '#' . $parsed['fragment']);
+            } else { // parse_url seems to have failed, try without it
+                $arr = explode('.', $input);
+                foreach ($arr as $k => $v) {
+                    $conv = $this->_decode($v);
+                    $arr[$k] = ($conv) ? $conv : $v;
+                }
+                $return = join('.', $arr);
+            }
+        } else { // Otherwise we consider it being a pure domain name string
+            $return = $this->_decode($input);
+            if (!$return)
+                $return = $input;
+        }
+        // The output is UTF-8 by default, other output formats need conversion here
+        // If one time encoding is given, use this, else the objects property
+        switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
+            case 'utf8':
+                return $return;
+                break;
+            case 'ucs4_string':
+                return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
+                break;
+            case 'ucs4_array':
+                return $this->_utf8_to_ucs4($return);
+                break;
+            default:
+                $this->_error('Unsupported output format');
+                return false;
+        }
+    }
+
+    /**
+     * Encode a given UTF-8 domain name
+     * @param    string   Domain name (UTF-8 or UCS-4)
+     * [@param    string   Desired input encoding, see {@link set_parameter}]
+     * @return   string   Encoded Domain name (ACE string)
+     * @access   public
+     */
+    function encode($decoded, $one_time_encoding = false) {
+        // Forcing conversion of input to UCS4 array
+        // If one time encoding is given, use this, else the objects property
+        switch ($one_time_encoding ? $one_time_encoding : $this->_api_encoding) {
+            case 'utf8':
+                $decoded = $this->_utf8_to_ucs4($decoded);
+                break;
+            case 'ucs4_string':
+                $decoded = $this->_ucs4_string_to_ucs4($decoded);
+            case 'ucs4_array':
+                break;
+            default:
+                $this->_error('Unsupported input format: ' . ($one_time_encoding ? $one_time_encoding : $this->_api_encoding));
+                return false;
+        }
+        // No input, no output, what else did you expect?
+        if (empty($decoded))
+            return '';
+        // Anchors for iteration
+        $last_begin = 0;
+        // Output string
+        $output = '';
+        foreach ($decoded as $k => $v) {
+            // Make sure to use just the plain dot
+            switch ($v) {
+                case 0x3002:
+                case 0xFF0E:
+                case 0xFF61:
+                    $decoded[$k] = 0x2E;
+                // Right, no break here, the above are converted to dots anyway
+                // Stumbling across an anchoring character
+                case 0x2E:
+                case 0x2F:
+                case 0x3A:
+                case 0x3F:
+                case 0x40:
+                    // Neither email addresses nor URLs allowed in strict mode
+                    if ($this->_strict_mode) {
+                        $this->_error('Neither email addresses nor URLs are allowed in strict mode.');
+                        return false;
+                    } else {
+                        // Skip first char
+                        if ($k) {
+                            $encoded = '';
+                            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($k) - $last_begin)));
+                            if ($encoded) {
+                                $output .= $encoded;
+                            } else {
+                                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($k) - $last_begin)));
+                            }
+                            $output .= chr($decoded[$k]);
+                        }
+                        $last_begin = $k + 1;
+                    }
+            }
+        }
+        // Catch the rest of the string
+        if ($last_begin) {
+            $inp_len = sizeof($decoded);
+            $encoded = '';
+            $encoded = $this->_encode(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
+            if ($encoded) {
+                $output .= $encoded;
+            } else {
+                $output .= $this->_ucs4_to_utf8(array_slice($decoded, $last_begin, (($inp_len) - $last_begin)));
+            }
+            return $output;
+        } else {
+            if ($output = $this->_encode($decoded)) {
+                return $output;
+            } else {
+                return $this->_ucs4_to_utf8($decoded);
+            }
+        }
+    }
+
+    /**
+     * Use this method to get the last error ocurred
+     * @param    void
+     * @return   string   The last error, that occured
+     * @access   public
+     */
+    function get_last_error() {
+        return $this->_error;
+    }
+
+    /**
+     * The actual decoding algorithm
+     * @access   private
+     */
+    function _decode($encoded) {
+        // We do need to find the Punycode prefix
+        if (!preg_match('!^' . preg_quote($this->_punycode_prefix, '!') . '!', $encoded)) {
+            $this->_error('This is not a punycode string');
+            return false;
+        }
+        $encode_test = preg_replace('!^' . preg_quote($this->_punycode_prefix, '!') . '!', '', $encoded);
+        // If nothing left after removing the prefix, it is hopeless
+        if (!$encode_test) {
+            $this->_error('The given encoded string was empty');
+            return false;
+        }
+        // Find last occurence of the delimiter
+        $delim_pos = strrpos($encoded, '-');
+        if ($delim_pos > strlen($this->_punycode_prefix)) {
+            for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) {
+                $decoded[] = ord($encoded{$k});
+            }
+        } else {
+            $decoded = array();
+        }
+        $deco_len = count($decoded);
+        $enco_len = strlen($encoded);
+        // Wandering through the strings; init
+        $is_first = true;
+        $bias = $this->_initial_bias;
+        $idx = 0;
+        $char = $this->_initial_n;
+        for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
+            for ($old_idx = $idx, $w = 1, $k = $this->_base; 1; $k += $this->_base) {
+                $digit = $this->_decode_digit($encoded{$enco_idx++});
+                $idx += $digit * $w;
+                $t = ($k <= $bias) ? $this->_tmin :
+                        (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
+                if ($digit < $t)
+                    break;
+                $w = (int) ($w * ($this->_base - $t));
+            }
+            $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
+            $is_first = false;
+            $char += (int) ($idx / ($deco_len + 1));
+            $idx %= ($deco_len + 1);
+            if ($deco_len > 0) {
+                // Make room for the decoded char
+                for ($i = $deco_len; $i > $idx; $i--) {
+                    $decoded[$i] = $decoded[($i - 1)];
+                }
+            }
+            $decoded[$idx++] = $char;
+        }
+        return $this->_ucs4_to_utf8($decoded);
+    }
+
+    /**
+     * The actual encoding algorithm
+     * @access   private
+     */
+    function _encode($decoded) {
+        // We cannot encode a domain name containing the Punycode prefix
+        $extract = strlen($this->_punycode_prefix);
+        $check_pref = $this->_utf8_to_ucs4($this->_punycode_prefix);
+        $check_deco = array_slice($decoded, 0, $extract);
+        if ($check_pref == $check_deco) {
+            $this->_error('This is already a punycode string');
+            return false;
+        }
+        // We will not try to encode strings consisting of basic code points only
+        $encodable = false;
+        foreach ($decoded as $k => $v) {
+            if ($v > 0x7a) {
+                $encodable = true;
+                break;
+            }
+        }
+        if (!$encodable) {
+            $this->_error('The given string does not contain encodable chars');
+            return false;
+        }
+        // Do NAMEPREP
+        $decoded = $this->_nameprep($decoded);
+        if (!$decoded || !is_array($decoded))
+            return false; // NAMEPREP failed
+        $deco_len = count($decoded);
+        if (!$deco_len)
+            return false; // Empty array
+        $codecount = 0; // How many chars have been consumed
+        $encoded = '';
+        // Copy all basic code points to output
+        for ($i = 0; $i < $deco_len; ++$i) {
+            $test = $decoded[$i];
+            // Will match [-0-9a-zA-Z]
+            if ((0x2F < $test && $test < 0x40) || (0x40 < $test && $test < 0x5B) || (0x60 < $test && $test <= 0x7B) || (0x2D == $test)) {
+                $encoded .= chr($decoded[$i]);
+                $codecount++;
+            }
+        }
+        if ($codecount == $deco_len)
+            return $encoded; // All codepoints were basic ones
+
+
+            
+// Start with the prefix; copy it to output
+        $encoded = $this->_punycode_prefix . $encoded;
+        // If we have basic code points in output, add an hyphen to the end
+        if ($codecount)
+            $encoded .= '-';
+        // Now find and encode all non-basic code points
+        $is_first = true;
+        $cur_code = $this->_initial_n;
+        $bias = $this->_initial_bias;
+        $delta = 0;
+        while ($codecount < $deco_len) {
+            // Find the smallest code point >= the current code point and
+            // remember the last ouccrence of it in the input
+            for ($i = 0, $next_code = $this->_max_ucs; $i < $deco_len; $i++) {
+                if ($decoded[$i] >= $cur_code && $decoded[$i] <= $next_code) {
+                    $next_code = $decoded[$i];
+                }
+            }
+            $delta += ($next_code - $cur_code) * ($codecount + 1);
+            $cur_code = $next_code;
+            // Scan input again and encode all characters whose code point is $cur_code
+            for ($i = 0; $i < $deco_len; $i++) {
+                if ($decoded[$i] < $cur_code) {
+                    $delta++;
+                } elseif ($decoded[$i] == $cur_code) {
+                    for ($q = $delta, $k = $this->_base; 1; $k += $this->_base) {
+                        $t = ($k <= $bias) ? $this->_tmin :
+                                (($k >= $bias + $this->_tmax) ? $this->_tmax : $k - $bias);
+                        if ($q < $t)
+                            break;
+                        $encoded .= $this->_encode_digit(intval($t + (($q - $t) % ($this->_base - $t)))); //v0.4.5 Changed from ceil() to intval()
+                        $q = (int) (($q - $t) / ($this->_base - $t));
+                    }
+                    $encoded .= $this->_encode_digit($q);
+                    $bias = $this->_adapt($delta, $codecount + 1, $is_first);
+                    $codecount++;
+                    $delta = 0;
+                    $is_first = false;
+                }
+            }
+            $delta++;
+            $cur_code++;
+        }
+        return $encoded;
+    }
+
+    /**
+     * Adapt the bias according to the current code point and position
+     * @access   private
+     */
+    function _adapt($delta, $npoints, $is_first) {
+        $delta = intval($is_first ? ($delta / $this->_damp) : ($delta / 2));
+        $delta += intval($delta / $npoints);
+        for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) {
+            $delta = intval($delta / ($this->_base - $this->_tmin));
+        }
+        return intval($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
+    }
+
+    /**
+     * Encoding a certain digit
+     * @access   private
+     */
+    function _encode_digit($d) {
+        return chr($d + 22 + 75 * ($d < 26));
+    }
+
+    /**
+     * Decode a certain digit
+     * @access   private
+     */
+    function _decode_digit($cp) {
+        $cp = ord($cp);
+        return ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $this->_base));
+    }
+
+    /**
+     * Internal error handling method
+     * @access   private
+     */
+    function _error($error = '') {
+        $this->_error = $error;
+    }
+
+    /**
+     * Do Nameprep according to RFC3491 and RFC3454
+     * @param    array    Unicode Characters
+     * @return   string   Unicode Characters, Nameprep'd
+     * @access   private
+     */
+    function _nameprep($input) {
+        $output = array();
+        $error = false;
+        //
+        // Mapping
+        // Walking through the input array, performing the required steps on each of
+        // the input chars and putting the result into the output array
+        // While mapping required chars we apply the cannonical ordering
+        foreach ($input as $v) {
+            // Map to nothing == skip that code point
+            if (in_array($v, $this->NP['map_nothing']))
+                continue;
+            // Try to find prohibited input
+            if (in_array($v, $this->NP['prohibit']) || in_array($v, $this->NP['general_prohibited'])) {
+                $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
+                return false;
+            }
+            foreach ($this->NP['prohibit_ranges'] as $range) {
+                if ($range[0] <= $v && $v <= $range[1]) {
+                    $this->_error('NAMEPREP: Prohibited input U+' . sprintf('%08X', $v));
+                    return false;
+                }
+            }
+            //
+            // Hangul syllable decomposition
+            if (0xAC00 <= $v && $v <= 0xD7AF) {
+                foreach ($this->_hangul_decompose($v) as $out) {
+                    $output[] = (int) $out;
+                }
+                // There's a decomposition mapping for that code point
+            } elseif (isset($this->NP['replacemaps'][$v])) {
+                foreach ($this->_apply_cannonical_ordering($this->NP['replacemaps'][$v]) as $out) {
+                    $output[] = (int) $out;
+                }
+            } else {
+                $output[] = (int) $v;
+            }
+        }
+        // Before applying any Combining, try to rearrange any Hangul syllables
+        $output = $this->_hangul_compose($output);
+        //
+        // Combine code points
+        //
+        $last_class = 0;
+        $last_starter = 0;
+        $out_len = count($output);
+        for ($i = 0; $i < $out_len; ++$i) {
+            $class = $this->_get_combining_class($output[$i]);
+            if ((!$last_class || $last_class > $class) && $class) {
+                // Try to match
+                $seq_len = $i - $last_starter;
+                $out = $this->_combine(array_slice($output, $last_starter, $seq_len));
+                // On match: Replace the last starter with the composed character and remove
+                // the now redundant non-starter(s)
+                if ($out) {
+                    $output[$last_starter] = $out;
+                    if (count($out) != $seq_len) {
+                        for ($j = $i + 1; $j < $out_len; ++$j) {
+                            $output[$j - 1] = $output[$j];
+                        }
+                        unset($output[$out_len]);
+                    }
+                    // Rewind the for loop by one, since there can be more possible compositions
+                    $i--;
+                    $out_len--;
+                    $last_class = ($i == $last_starter) ? 0 : $this->_get_combining_class($output[$i - 1]);
+                    continue;
+                }
+            }
+            // The current class is 0
+            if (!$class)
+                $last_starter = $i;
+            $last_class = $class;
+        }
+        return $output;
+    }
+
+    /**
+     * Decomposes a Hangul syllable
+     * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+     * @param    integer  32bit UCS4 code point
+     * @return   array    Either Hangul Syllable decomposed or original 32bit value as one value array
+     * @access   private
+     */
+    function _hangul_decompose($char) {
+        $sindex = (int) $char - $this->_sbase;
+        if ($sindex < 0 || $sindex >= $this->_scount) {
+            return array($char);
+        }
+        $result = array();
+        $result[] = (int) $this->_lbase + $sindex / $this->_ncount;
+        $result[] = (int) $this->_vbase + ($sindex % $this->_ncount) / $this->_tcount;
+        $T = intval($this->_tbase + $sindex % $this->_tcount);
+        if ($T != $this->_tbase)
+            $result[] = $T;
+        return $result;
+    }
+
+    /**
+     * Ccomposes a Hangul syllable
+     * (see http://www.unicode.org/unicode/reports/tr15/#Hangul
+     * @param    array    Decomposed UCS4 sequence
+     * @return   array    UCS4 sequence with syllables composed
+     * @access   private
+     */
+    function _hangul_compose($input) {
+        $inp_len = count($input);
+        if (!$inp_len)
+            return array();
+        $result = array();
+        $last = (int) $input[0];
+        $result[] = $last; // copy first char from input to output
+        for ($i = 1; $i < $inp_len; ++$i) {
+            $char = (int) $input[$i];
+            $sindex = $last - $this->_sbase;
+            $lindex = $last - $this->_lbase;
+            $vindex = $char - $this->_vbase;
+            $tindex = $char - $this->_tbase;
+            // Find out, whether two current characters are LV and T
+            if (0 <= $sindex && $sindex < $this->_scount && ($sindex % $this->_tcount == 0) && 0 <= $tindex && $tindex <= $this->_tcount) {
+                // create syllable of form LVT
+                $last += $tindex;
+                $result[(count($result) - 1)] = $last; // reset last
+                continue; // discard char
+            }
+            // Find out, whether two current characters form L and V
+            if (0 <= $lindex && $lindex < $this->_lcount && 0 <= $vindex && $vindex < $this->_vcount) {
+                // create syllable of form LV
+                $last = (int) $this->_sbase + ($lindex * $this->_vcount + $vindex) * $this->_tcount;
+                $result[(count($result) - 1)] = $last; // reset last
+                continue; // discard char
+            }
+            // if neither case was true, just add the character
+            $last = $char;
+            $result[] = $char;
+        }
+        return $result;
+    }
+
+    /**
+     * Returns the combining class of a certain wide char
+     * @param    integer    Wide char to check (32bit integer)
+     * @return   integer    Combining class if found, else 0
+     * @access   private
+     */
+    function _get_combining_class($char) {
+        return isset($this->NP['norm_combcls'][$char]) ? $this->NP['norm_combcls'][$char] : 0;
+    }
+
+    /**
+     * Apllies the cannonical ordering of a decomposed UCS4 sequence
+     * @param    array      Decomposed UCS4 sequence
+     * @return   array      Ordered USC4 sequence
+     * @access   private
+     */
+    function _apply_cannonical_ordering($input) {
+        $swap = true;
+        $size = count($input);
+        while ($swap) {
+            $swap = false;
+            $last = $this->_get_combining_class(intval($input[0]));
+            for ($i = 0; $i < $size - 1; ++$i) {
+                $next = $this->_get_combining_class(intval($input[$i + 1]));
+                if ($next != 0 && $last > $next) {
+                    // Move item leftward until it fits
+                    for ($j = $i + 1; $j > 0; --$j) {
+                        if ($this->_get_combining_class(intval($input[$j - 1])) <= $next)
+                            break;
+                        $t = intval($input[$j]);
+                        $input[$j] = intval($input[$j - 1]);
+                        $input[$j - 1] = $t;
+                        $swap = true;
+                    }
+                    // Reentering the loop looking at the old character again
+                    $next = $last;
+                }
+                $last = $next;
+            }
+        }
+        return $input;
+    }
+
+    /**
+     * Do composition of a sequence of starter and non-starter
+     * @param    array      UCS4 Decomposed sequence
+     * @return   array      Ordered USC4 sequence
+     * @access   private
+     */
+    function _combine($input) {
+        $inp_len = count($input);
+        foreach ($this->NP['replacemaps'] as $np_src => $np_target) {
+            if ($np_target[0] != $input[0])
+                continue;
+            if (count($np_target) != $inp_len)
+                continue;
+            $hit = false;
+            foreach ($input as $k2 => $v2) {
+                if ($v2 == $np_target[$k2]) {
+                    $hit = true;
+                } else {
+                    $hit = false;
+                    break;
+                }
+            }
+            if ($hit)
+                return $np_src;
+        }
+        return false;
+    }
+
+    /**
+     * This converts an UTF-8 encoded string to its UCS-4 representation
+     * By talking about UCS-4 "strings" we mean arrays of 32bit integers representing
+     * each of the "chars". This is due to PHP not being able to handle strings with
+     * bit depth different from 8. This apllies to the reverse method _ucs4_to_utf8(), too.
+     * The following UTF-8 encodings are supported:
+     * bytes bits  representation
+     * 1        7  0xxxxxxx
+     * 2       11  110xxxxx 10xxxxxx
+     * 3       16  1110xxxx 10xxxxxx 10xxxxxx
+     * 4       21  11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+     * 5       26  111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+     * 6       31  1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+     * Each x represents a bit that can be used to store character data.
+     * The five and six byte sequences are part of Annex D of ISO/IEC 10646-1:2000
+     * @access   private
+     */
+    function _utf8_to_ucs4($input) {
+        $output = array();
+        $out_len = 0;
+        $inp_len = strlen($input);
+        $mode = 'next';
+        $test = 'none';
+        for ($k = 0; $k < $inp_len; ++$k) {
+            $v = ord($input{$k}); // Extract byte from input string
+            if ($v < 128) { // We found an ASCII char - put into stirng as is
+                $output[$out_len] = $v;
+                ++$out_len;
+                if ('add' == $mode) {
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
+                    return false;
+                }
+                continue;
+            }
+            if ('next' == $mode) { // Try to find the next start byte; determine the width of the Unicode char
+                $start_byte = $v;
+                $mode = 'add';
+                $test = 'range';
+                if ($v >> 5 == 6) { // &110xxxxx 10xxxxx
+                    $next_byte = 0; // Tells, how many times subsequent bitmasks must rotate 6bits to the left
+                    $v = ($v - 192) << 6;
+                } elseif ($v >> 4 == 14) { // &1110xxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 1;
+                    $v = ($v - 224) << 12;
+                } elseif ($v >> 3 == 30) { // &11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 2;
+                    $v = ($v - 240) << 18;
+                } elseif ($v >> 2 == 62) { // &111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 3;
+                    $v = ($v - 248) << 24;
+                } elseif ($v >> 1 == 126) { // &1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
+                    $next_byte = 4;
+                    $v = ($v - 252) << 30;
+                } else {
+                    $this->_error('This might be UTF-8, but I don\'t understand it at byte ' . $k);
+                    return false;
+                }
+                if ('add' == $mode) {
+                    $output[$out_len] = (int) $v;
+                    ++$out_len;
+                    continue;
+                }
+            }
+            if ('add' == $mode) {
+                if (!$this->_allow_overlong && $test == 'range') {
+                    $test = 'none';
+                    if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) {
+                        $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k);
+                        return false;
+                    }
+                }
+                if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx
+                    $v = ($v - 128) << ($next_byte * 6);
+                    $output[($out_len - 1)] += $v;
+                    --$next_byte;
+                } else {
+                    $this->_error('Conversion from UTF-8 to UCS-4 failed: malformed input at byte ' . $k);
+                    return false;
+                }
+                if ($next_byte < 0) {
+                    $mode = 'next';
+                }
+            }
+        } // for
+        return $output;
+    }
+
+    /**
+     * Convert UCS-4 string into UTF-8 string
+     * See _utf8_to_ucs4() for details
+     * @access   private
+     */
+    function _ucs4_to_utf8($input) {
+        $output = '';
+        $k = 0;
+        foreach ($input as $v) {
+            ++$k;
+            // $v = ord($v);
+            if ($v < 128) { // 7bit are transferred literally
+                $output .= chr($v);
+            } elseif ($v < (1 << 11)) { // 2 bytes
+                $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 16)) { // 3 bytes
+                $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 21)) { // 4 bytes
+                $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63))
+                        . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 26)) { // 5 bytes
+                $output .= chr(248 + ($v >> 24)) . chr(128 + (($v >> 18) & 63))
+                        . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63))
+                        . chr(128 + ($v & 63));
+            } elseif ($v < (1 << 31)) { // 6 bytes
+                $output .= chr(252 + ($v >> 30)) . chr(128 + (($v >> 24) & 63))
+                        . chr(128 + (($v >> 18) & 63)) . chr(128 + (($v >> 12) & 63))
+                        . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63));
+            } else {
+                $this->_error('Conversion from UCS-4 to UTF-8 failed: malformed input at byte ' . $k);
+                return false;
+            }
+        }
+        return $output;
+    }
+
+    /**
+     * Convert UCS-4 array into UCS-4 string
+     *
+     * @access   private
+     */
+    function _ucs4_to_ucs4_string($input) {
+        $output = '';
+        // Take array values and split output to 4 bytes per value
+        // The bit mask is 255, which reads &11111111
+        foreach ($input as $v) {
+            $output .= chr(($v >> 24) & 255) . chr(($v >> 16) & 255) . chr(($v >> 8) & 255) . chr($v & 255);
+        }
+        return $output;
+    }
+
+    /**
+     * Convert UCS-4 strin into UCS-4 garray
+     *
+     * @access   private
+     */
+    function _ucs4_string_to_ucs4($input) {
+        $output = array();
+        $inp_len = strlen($input);
+        // Input length must be dividable by 4
+        if ($inp_len % 4) {
+            $this->_error('Input UCS4 string is broken');
+            return false;
+        }
+        // Empty input - return empty output
+        if (!$inp_len)
+            return $output;
+        for ($i = 0, $out_len = -1; $i < $inp_len; ++$i) {
+            // Increment output position every 4 input bytes
+            if (!($i % 4)) {
+                $out_len++;
+                $output[$out_len] = 0;
+            }
+            $output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
+        }
+        return $output;
+    }
+
+}
+
+/**
+ * Adapter class for aligning the API of idna_convert with that of Net_IDNA
+ * @author  Matthias Sommerfeld <mso@phlylabs.de>
+ */
+class Net_IDNA_php4 extends idna_convert {
+
+    /**
+     * Sets a new option value. Available options and values:
+     * [encoding - Use either UTF-8, UCS4 as array or UCS4 as string as input ('utf8' for UTF-8,
+     *         'ucs4_string' and 'ucs4_array' respectively for UCS4); The output is always UTF-8]
+     * [overlong - Unicode does not allow unnecessarily long encodings of chars,
+     *             to allow this, set this parameter to true, else to false;
+     *             default is false.]
+     * [strict - true: strict mode, good for registration purposes - Causes errors
+     *           on failures; false: loose mode, ideal for "wildlife" applications
+     *           by silently ignoring errors and returning the original input instead
+     *
+     * @param    mixed     Parameter to set (string: single parameter; array of Parameter => Value pairs)
+     * @param    string    Value to use (if parameter 1 is a string)
+     * @return   boolean   true on success, false otherwise
+     * @access   public
+     */
+    function setParams($option, $param = false) {
+        return $this->IC->set_parameters($option, $param);
+    }
+
+}
+
+class owncloud_Encoding {
+
+    const ICONV_TRANSLIT = "TRANSLIT";
+    const ICONV_IGNORE = "IGNORE";
+    const WITHOUT_ICONV = "";
+
+    protected static $win1252ToUtf8 = array(
+        128 => "\xe2\x82\xac",
+        130 => "\xe2\x80\x9a",
+        131 => "\xc6\x92",
+        132 => "\xe2\x80\x9e",
+        133 => "\xe2\x80\xa6",
+        134 => "\xe2\x80\xa0",
+        135 => "\xe2\x80\xa1",
+        136 => "\xcb\x86",
+        137 => "\xe2\x80\xb0",
+        138 => "\xc5\xa0",
+        139 => "\xe2\x80\xb9",
+        140 => "\xc5\x92",
+        142 => "\xc5\xbd",
+        145 => "\xe2\x80\x98",
+        146 => "\xe2\x80\x99",
+        147 => "\xe2\x80\x9c",
+        148 => "\xe2\x80\x9d",
+        149 => "\xe2\x80\xa2",
+        150 => "\xe2\x80\x93",
+        151 => "\xe2\x80\x94",
+        152 => "\xcb\x9c",
+        153 => "\xe2\x84\xa2",
+        154 => "\xc5\xa1",
+        155 => "\xe2\x80\xba",
+        156 => "\xc5\x93",
+        158 => "\xc5\xbe",
+        159 => "\xc5\xb8"
+    );
+    protected static $brokenUtf8ToUtf8 = array(
+        "\xc2\x80" => "\xe2\x82\xac",
+        "\xc2\x82" => "\xe2\x80\x9a",
+        "\xc2\x83" => "\xc6\x92",
+        "\xc2\x84" => "\xe2\x80\x9e",
+        "\xc2\x85" => "\xe2\x80\xa6",
+        "\xc2\x86" => "\xe2\x80\xa0",
+        "\xc2\x87" => "\xe2\x80\xa1",
+        "\xc2\x88" => "\xcb\x86",
+        "\xc2\x89" => "\xe2\x80\xb0",
+        "\xc2\x8a" => "\xc5\xa0",
+        "\xc2\x8b" => "\xe2\x80\xb9",
+        "\xc2\x8c" => "\xc5\x92",
+        "\xc2\x8e" => "\xc5\xbd",
+        "\xc2\x91" => "\xe2\x80\x98",
+        "\xc2\x92" => "\xe2\x80\x99",
+        "\xc2\x93" => "\xe2\x80\x9c",
+        "\xc2\x94" => "\xe2\x80\x9d",
+        "\xc2\x95" => "\xe2\x80\xa2",
+        "\xc2\x96" => "\xe2\x80\x93",
+        "\xc2\x97" => "\xe2\x80\x94",
+        "\xc2\x98" => "\xcb\x9c",
+        "\xc2\x99" => "\xe2\x84\xa2",
+        "\xc2\x9a" => "\xc5\xa1",
+        "\xc2\x9b" => "\xe2\x80\xba",
+        "\xc2\x9c" => "\xc5\x93",
+        "\xc2\x9e" => "\xc5\xbe",
+        "\xc2\x9f" => "\xc5\xb8"
+    );
+    protected static $utf8ToWin1252 = array(
+        "\xe2\x82\xac" => "\x80",
+        "\xe2\x80\x9a" => "\x82",
+        "\xc6\x92" => "\x83",
+        "\xe2\x80\x9e" => "\x84",
+        "\xe2\x80\xa6" => "\x85",
+        "\xe2\x80\xa0" => "\x86",
+        "\xe2\x80\xa1" => "\x87",
+        "\xcb\x86" => "\x88",
+        "\xe2\x80\xb0" => "\x89",
+        "\xc5\xa0" => "\x8a",
+        "\xe2\x80\xb9" => "\x8b",
+        "\xc5\x92" => "\x8c",
+        "\xc5\xbd" => "\x8e",
+        "\xe2\x80\x98" => "\x91",
+        "\xe2\x80\x99" => "\x92",
+        "\xe2\x80\x9c" => "\x93",
+        "\xe2\x80\x9d" => "\x94",
+        "\xe2\x80\xa2" => "\x95",
+        "\xe2\x80\x93" => "\x96",
+        "\xe2\x80\x94" => "\x97",
+        "\xcb\x9c" => "\x98",
+        "\xe2\x84\xa2" => "\x99",
+        "\xc5\xa1" => "\x9a",
+        "\xe2\x80\xba" => "\x9b",
+        "\xc5\x93" => "\x9c",
+        "\xc5\xbe" => "\x9e",
+        "\xc5\xb8" => "\x9f"
+    );
+
+    static function toUTF8($text) {
+
+        if (is_array($text)) {
+            foreach ($text as $k => $v) {
+                $text[$k] = self::toUTF8($v);
+            }
+            return $text;
+        } elseif (is_string($text)) {
+
+            if (function_exists('mb_strlen') && ((int) ini_get('mbstring.func_overload')) & 2) {
+                $max = mb_strlen($text, '8bit');
+            } else {
+                $max = strlen($text);
+            }
+
+            $buf = "";
+            for ($i = 0; $i < $max; $i++) {
+                $c1 = $text{$i};
+                if ($c1 >= "\xc0") { //Should be converted to UTF8, if it's not UTF8 already
+                    $c2 = $i + 1 >= $max ? "\x00" : $text{$i + 1};
+                    $c3 = $i + 2 >= $max ? "\x00" : $text{$i + 2};
+                    $c4 = $i + 3 >= $max ? "\x00" : $text{$i + 3};
+                    if ($c1 >= "\xc0" & $c1 <= "\xdf") { //looks like 2 bytes UTF8
+                        if ($c2 >= "\x80" && $c2 <= "\xbf") { //yeah, almost sure it's UTF8 already
+                            $buf .= $c1 . $c2;
+                            $i++;
+                        } else { //not valid UTF8.  Convert it.
+                            $cc1 = (chr(ord($c1) / 64) | "\xc0");
+                            $cc2 = ($c1 & "\x3f") | "\x80";
+                            $buf .= $cc1 . $cc2;
+                        }
+                    } elseif ($c1 >= "\xe0" & $c1 <= "\xef") { //looks like 3 bytes UTF8
+                        if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf") { //yeah, almost sure it's UTF8 already
+                            $buf .= $c1 . $c2 . $c3;
+                            $i = $i + 2;
+                        } else { //not valid UTF8.  Convert it.
+                            $cc1 = (chr(ord($c1) / 64) | "\xc0");
+                            $cc2 = ($c1 & "\x3f") | "\x80";
+                            $buf .= $cc1 . $cc2;
+                        }
+                    } elseif ($c1 >= "\xf0" & $c1 <= "\xf7") { //looks like 4 bytes UTF8
+                        if ($c2 >= "\x80" && $c2 <= "\xbf" && $c3 >= "\x80" && $c3 <= "\xbf" && $c4 >= "\x80" && $c4 <= "\xbf") { //yeah, almost sure it's UTF8 already
+                            $buf .= $c1 . $c2 . $c3 . $c4;
+                            $i = $i + 3;
+                        } else { //not valid UTF8.  Convert it.
+                            $cc1 = (chr(ord($c1) / 64) | "\xc0");
+                            $cc2 = ($c1 & "\x3f") | "\x80";
+                            $buf .= $cc1 . $cc2;
+                        }
+                    } else { //doesn't look like UTF8, but should be converted
+                        $cc1 = (chr(ord($c1) / 64) | "\xc0");
+                        $cc2 = (($c1 & "\x3f") | "\x80");
+                        $buf .= $cc1 . $cc2;
+                    }
+                } elseif (($c1 & "\xc0") == "\x80") { // needs conversion
+                    if (isset(self::$win1252ToUtf8[ord($c1)])) { //found in Windows-1252 special cases
+                        $buf .= self::$win1252ToUtf8[ord($c1)];
+                    } else {
+                        $cc1 = (chr(ord($c1) / 64) | "\xc0");
+                        $cc2 = (($c1 & "\x3f") | "\x80");
+                        $buf .= $cc1 . $cc2;
+                    }
+                } else { // it doesn't need conversion
+                    $buf .= $c1;
+                }
+            }
+            return $buf;
+        } else {
+            return $text;
+        }
+    }
+
+    static function toWin1252($text, $option = self::WITHOUT_ICONV) {
+        if (is_array($text)) {
+            foreach ($text as $k => $v) {
+                $text[$k] = self::toWin1252($v, $option);
+            }
+            return $text;
+        } elseif (is_string($text)) {
+            return static::utf8_decode($text, $option);
+        } else {
+            return $text;
+        }
+    }
+
+    static function toISO8859($text) {
+        return self::toWin1252($text);
+    }
+
+    static function toLatin1($text) {
+        return self::toWin1252($text);
+    }
+
+    static function fixUTF8($text, $option = self::WITHOUT_ICONV) {
+        if (is_array($text)) {
+            foreach ($text as $k => $v) {
+                $text[$k] = self::fixUTF8($v, $option);
+            }
+            return $text;
+        }
+
+        $last = "";
+        while ($last <> $text) {
+            $last = $text;
+            $text = self::toUTF8(static::utf8_decode($text, $option));
+        }
+        $text = self::toUTF8(static::utf8_decode($text, $option));
+        return $text;
+    }
+
+    static function UTF8FixWin1252Chars($text) {
+        // If you received an UTF-8 string that was converted from Windows-1252 as it was ISO8859-1
+        // (ignoring Windows-1252 chars from 80 to 9F) use this function to fix it.
+        // See: http://en.wikipedia.org/wiki/Windows-1252
+
+        return str_replace(array_keys(self::$brokenUtf8ToUtf8), array_values(self::$brokenUtf8ToUtf8), $text);
+    }
+
+    static function removeBOM($str = "") {
+        if (substr($str, 0, 3) == pack("CCC", 0xef, 0xbb, 0xbf)) {
+            $str = substr($str, 3);
+        }
+        return $str;
+    }
+
+    public static function normalizeEncoding($encodingLabel) {
+        $encoding = strtoupper($encodingLabel);
+        $encoding = preg_replace('/[^a-zA-Z0-9\s]/', '', $encoding);
+        $equivalences = array(
+            'ISO88591' => 'ISO-8859-1',
+            'ISO8859' => 'ISO-8859-1',
+            'ISO' => 'ISO-8859-1',
+            'LATIN1' => 'ISO-8859-1',
+            'LATIN' => 'ISO-8859-1',
+            'UTF8' => 'UTF-8',
+            'UTF' => 'UTF-8',
+            'WIN1252' => 'ISO-8859-1',
+            'WINDOWS1252' => 'ISO-8859-1'
+        );
+
+        if (empty($equivalences[$encoding])) {
+            return 'UTF-8';
+        }
+
+        return $equivalences[$encoding];
+    }
+
+    public static function encode($encodingLabel, $text) {
+        $encodingLabel = self::normalizeEncoding($encodingLabel);
+        if ($encodingLabel == 'UTF-8')
+            return Encoding::toUTF8($text);
+        if ($encodingLabel == 'ISO-8859-1')
+            return Encoding::toLatin1($text);
+    }
+
+    protected static function utf8_decode($text, $option) {
+        if ($option == self::WITHOUT_ICONV || !function_exists('iconv')) {
+            $o = utf8_decode(
+                    str_replace(array_keys(self::$utf8ToWin1252), array_values(self::$utf8ToWin1252), self::toUTF8($text))
+            );
+        } else {
+            $o = iconv("UTF-8", "Windows-1252" . ($option == self::ICONV_TRANSLIT ? '//TRANSLIT' : ($option == self::ICONV_IGNORE ? '//IGNORE' : '')), $text);
+        }
+        return $o;
+    }
+
+}
+
+?>

+ 2 - 0
index.php

@@ -0,0 +1,2 @@
+<?php
+header("Location: ../../../index.php");

二進制
logo.gif


+ 1348 - 0
switchepp.php

@@ -0,0 +1,1348 @@
+<?php
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *  SWITCH EPP REGISTRAR WHMCS Module By whmcsglobalservices.com
+ *  Copyright whmcsglobalservices, All Rights Reserved
+ *  
+ *  Release: 21 January, 2015
+ *  Version: 3.0.6
+ *  WHMCS Version: v6,v7
+ *  Update Date: 04 Sep, 2019
+ * 
+ *  By WHMCSGLOBALSERVICES    https://whmcsglobalservices.com
+ *  Contact                   info@whmcsglobalservices.com
+ *  
+ *  This module is made under license issued by whmcsglobalservices.com
+ *  and used under all terms and conditions of license.    Ownership of 
+ *  module can not be changed.     Title and copy of    module  is  not
+ *  available to any other person.
+ *  
+ *  @owner <whmcsglobalservices.com>
+ *  @author <WHMCSGLOBALSERVICES>
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+use Illuminate\Database\Capsule\Manager as Capsule;
+use WGSSWITCHEPP\IDNA\idna_convert as idna_convert;
+
+if (!defined("WHMCS"))
+    die("This file cannot be accessed directly");
+
+
+if (!class_exists('Net_EPP_Protocol')) {
+    if (file_exists(__DIR__ . "/Net/EPP/Client.php"))
+        require_once __DIR__ . "/Net/EPP/Client.php";
+}
+
+require_once(__DIR__ . '/idna_convert.class.php');
+
+#*********************Registrar config options***************************#
+
+function switchepp_getConfigArray() {
+    $configarray = array(
+        "FriendlyName" => array(
+            "Type" => "System",
+            "Value" => "Switch Epp"
+        ),
+        "registrar_id" => array(
+            "FriendlyName" => "Registrar Id",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "registrar_password" => array(
+            "FriendlyName" => "Password",
+            "Type" => "password",
+            "Size" => "50",
+        ),
+        "eppurl" => array(
+            "FriendlyName" => "EPP URL",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "eppport" => array(
+            "FriendlyName" => "Port Number",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "licensenum" => array(
+            "FriendlyName" => "License  Key",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "dnssec" => array(
+            "FriendlyName" => "DNSSEC",
+            "Type" => "yesno",
+        ),
+        "algorithm" => array(
+            "FriendlyName" => "Algorithm",
+            'Type' => 'dropdown',
+            'Options' => "5,7,8,10,13,14,15,16",
+            'Default' => '5',
+        ),
+        "digest_type" => array(
+            "FriendlyName" => "Digest Type",
+            'Type' => 'dropdown',
+            'Options' => "1,2,3,4",
+            'Default' => '1',
+        ),
+        "passphrase" => array(
+            "FriendlyName" => "Pass Phrase",
+            "Type" => "password",
+            "Size" => "30",
+            "Description" => "It's optional"
+        ),
+        "svcExtension" => array(
+            "FriendlyName" => "Enable svcExtension",
+            "Type" => "yesno",
+            "Description" => "Tick if svcExtension supported."
+        ),
+        "switchepp_version" => array(
+            "FriendlyName" => "Version",
+            "Description" => "3.0.6",
+        ),
+        "switchepp_update" => array(
+            "FriendlyName" => "Updated Date",
+            "Description" => "04 Sep, 2019",
+        )
+    );
+    return $configarray;
+}
+
+#*******************Get Nameserver***********************#
+
+function switchepp_GetNameservers($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $ns = $info_domain->response->resData->children("domain", true)->infData->ns->hostObj;
+
+        $i = 1;
+        $values = array();
+        foreach ($ns as $nn) {
+            $values["ns{$i}"] = $nn;
+            $i++;
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+
+    return $values;
+}
+
+#*********************Save mameserver**************************#
+
+function switchepp_SaveNameservers($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $ns = $info_domain->response->resData->children("domain", true)->infData->ns->hostObj;
+        $rem_hosts = '';
+        foreach ($ns as $nn) {
+            $rem_hosts .= ' <domain:hostObj>' . $nn . '</domain:hostObj> ';
+        }
+        # Generate XML for nameservers
+        if ($nameserver1 = $params["ns1"]) {
+            $add_hosts = ' <domain:hostObj>' . $nameserver1 . '</domain:hostObj> ';
+        }
+        if ($nameserver2 = $params["ns2"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver2 . '</domain:hostObj> ';
+        }
+        if ($nameserver3 = $params["ns3"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver3 . '</domain:hostObj> ';
+        }
+        if ($nameserver4 = $params["ns4"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver4 . '</domain:hostObj> ';
+        }
+        if ($nameserver5 = $params["ns5"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver5 . '</domain:hostObj> ';
+        }
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                            <secDNS:add> 
+                                                <secDNS:dsData> 
+                                                    <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                    <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                    <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                    <secDNS:digest>' . $digest . '</secDNS:digest>
+                                                </secDNS:dsData>
+                                            </secDNS:add>
+                                        </secDNS:update> 
+                                    </extension>';
+        }
+        $xmlUpdate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:add>
+                                                <domain:ns>
+                                                ' . $add_hosts . '
+                                                </domain:ns>
+                                            </domain:add>    
+                                            <domain:rem>
+                                                <domain:ns>
+                                                ' . $rem_hosts . '
+                                                </domain:ns>
+                                            </domain:rem>
+                                        </domain:update>
+                                    </update>
+                                    ' . $dnssec . '
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $update_domain = switchepp_write_xml($client, $xmlUpdate, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*************************Domain Register****************************#
+
+function switchepp_RegisterDomain($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xmlcheck = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <check>
+                                    <domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . switcheppGetDomainName($params['domainid']) . '</domain:name>
+                                    </domain:check>
+                                </check>
+                            <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                            </command>
+                        </epp>';
+
+        $domain_check = switchepp_write_xml($client, $xmlcheck, __FUNCTION__ . '( check domain)');
+        if (0 == (int) $domain_check->response->resData->children("domain", true)->chkData->cd[0]->name->attributes()->avail)
+            throw new exception($domain_check->response->resData->children("domain", true)->chkData->cd[0]->name . ' ' . $domain_check->response->resData->children("domain", true)->chkData->cd[0]->reason);
+
+        $regContactId = strtoupper(switchepp_generateContactID(8) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($regContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlclient = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>REG' . $regContactId . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $params['fullname'] . '</contact:name>
+                                            <contact:org>' . $params['companyname'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $params['address1'] . '</contact:street>
+                                                <contact:street>' . $params['address2'] . '</contact:street>
+                                                <contact:city>' . $params['city'] . '</contact:city>
+                                                <contact:pc>' . $params['postcode'] . '</contact:pc>
+                                                <contact:cc>' . $params['country'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $params['phonenumberformatted'] . '</contact:voice>
+                                        <contact:email>' . $params['email'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>Regcon-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $create_reg_contact = switchepp_write_xml($client, $xmlclient, __FUNCTION__ . '( create reg contact)');
+            $reg_contact_id = $create_reg_contact->response->resData->children('contact', true)->creData->id;
+        } else {
+            $reg_contact_id = $regContactId;
+        }
+        #*************tech create*****************#     
+        $techContactId = strtoupper(switchepp_generateContactID(6) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($techContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlTech = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>TE' . $techContactId . '</contact:id>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $params['adminfirstname'] . ' ' . $params['adminlastname'] . '</contact:name>
+                                                <contact:org>' . $params['admincompanyname'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $params['adminaddress1'] . '</contact:street>
+                                                    <contact:street>' . $params['adminaddress2'] . '</contact:street>
+                                                    <contact:city>' . $params['admincity'] . '</contact:city>
+                                                    <contact:pc>' . $params['adminpostcode'] . '</contact:pc>
+                                                    <contact:cc>' . $params['admincountry'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $params['adminfullphonenumber'] . '</contact:voice>
+                                            <contact:email>' . $params['adminemail'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>Tec-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:create>
+                                    </create>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $create_tech_contact = switchepp_write_xml($client, $xmlTech, __FUNCTION__ . '( create tech contact)');
+            $tech_contact_id = $create_tech_contact->response->resData->children('contact', true)->creData->id;
+        } else {
+            $tech_contact_id = $techContactId;
+        }
+        #*******************NameServer*************#                
+        if ($params['ns1']) {
+            $ns .= '<domain:hostObj>' . $params['ns1'] . '</domain:hostObj>';
+        }
+        if ($params['ns2']) {
+            $ns .= '<domain:hostObj>' . $params['ns2'] . '</domain:hostObj>';
+        }
+        if ($params['ns3']) {
+            $ns .= '<domain:hostObj>' . $params['ns3'] . '</domain:hostObj>';
+        }
+        if ($params['ns4']) {
+            $ns .= '<domain:hostObj>' . $params['ns4'] . '</domain:hostObj>';
+        }
+        if ($ns) {
+            $nsnameserver = ' <domain:ns>
+                                    ' . $ns . '
+                             </domain:ns>';
+        }
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:create xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                             <secDNS:dsData> 
+                                                        <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                        <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                        <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                        <secDNS:digest>' . $digest . '</secDNS:digest>
+                                              </secDNS:dsData>
+                                        </secDNS:create>
+                                   </extension>';
+        }
+        $domainPw = switchepp_generateRandomString(15);
+        #domian create command
+        $xmldomain = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            ' . $nsnameserver . '
+                                             <domain:registrant>' . $reg_contact_id . '</domain:registrant>
+                                             <domain:contact type="tech">' . $tech_contact_id . '</domain:contact>
+                                             <domain:authInfo>
+                                             <domain:pw>' . $domainPw . '</domain:pw>
+                                             </domain:authInfo>
+                                        </domain:create>
+                                    </create>
+                                   ' . $dnssec . '
+                                <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                </command>
+                            </epp>';
+        $domain_create = switchepp_write_xml($client, $xmldomain, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**********************************Get Contact Detail*******************************#
+
+function switchepp_RenewDomain($params) {
+    $userIdentifier = $params['APIUsername'];
+    $apiKey = $params['APIKey'];
+    $testMode = $params['TestMode'];
+    $accountMode = $params['AccountMode'];
+    $emailPreference = $params['EmailPreference'];
+
+    // registration parameters
+    $sld = $params['sld'];
+    $tld = $params['tld'];
+    $registrationPeriod = $params['regperiod'];
+
+    // domain addon purchase status
+    $enableDnsManagement = (bool) $params['dnsmanagement'];
+    $enableEmailForwarding = (bool) $params['emailforwarding'];
+    $enableIdProtection = (bool) $params['idprotection'];
+
+
+}
+
+function switchepp_GetContactDetails($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $registrant_id = $info_domain->response->resData->children("domain", true)->infData->registrant;   #registrant id
+        $Tech_id = $info_domain->response->resData->children("domain", true)->infData->contact;    #Tech id
+        $xml2 = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $registrant_id . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+        $info_contact = switchepp_write_xml($client, $xml2, __FUNCTION__ . '(registrant contact info)');
+        $contactdataArr = $info_contact->response->resData->children("contact", true)->infData;
+        $results["Registrant"]["Contact Name"] = $contactdataArr->postalInfo->name;
+        $results["Registrant"]["Organisation"] = $contactdataArr->postalInfo->org;
+        $results["Registrant"]["Address line 1"] = $contactdataArr->postalInfo->addr->street[0];
+        $results["Registrant"]["Address line 2"] = $contactdataArr->postalInfo->addr->street[1];
+        $results["Registrant"]["TownCity"] = $contactdataArr->postalInfo->addr->city;
+        $results["Registrant"]["Zip code"] = $contactdataArr->postalInfo->addr->pc;
+        $results["Registrant"]["Country Code"] = $contactdataArr->postalInfo->addr->cc;
+        $results["Registrant"]["Phone"] = $contactdataArr->voice;
+        $results["Registrant"]["Email"] = $contactdataArr->email;
+        if (!empty($Tech_id)) {
+            #get tech detail
+            $xml3 = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $Tech_id . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $tect_info_contact = switchepp_write_xml($client, $xml3, __FUNCTION__ . '(tech contact info)');
+            #*************************Show tech information in field****************************#
+            $techdataArr = $tect_info_contact->response->resData->children("contact", true)->infData;
+            $results["Technical"]["Contact Name"] = $techdataArr->postalInfo->name;
+            $results["Technical"]["Organisation"] = $techdataArr->postalInfo->org;
+            $results["Technical"]["Address line 1"] = $techdataArr->postalInfo->addr->street[0];
+            $results["Technical"]["Address line 2"] = $techdataArr->postalInfo->addr->street[1];
+            $results["Technical"]["TownCity"] = $techdataArr->postalInfo->addr->city;
+            $results["Technical"]["Zip code"] = $techdataArr->postalInfo->addr->pc;
+            $results["Technical"]["Country Code"] = $techdataArr->postalInfo->addr->cc;
+            $results["Technical"]["Phone"] = $techdataArr->voice;
+            $results["Technical"]["Email"] = $techdataArr->email;
+        }
+    } catch (Exception $ex) {
+        $results['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $results;
+}
+
+#******************Save Contact/Tech Detail*********************#
+
+function switchepp_SaveContactDetails($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $registrant_id = $info_domain->response->resData->children("domain", true)->infData->registrant;   #registrant id
+        $Tech_id = $info_domain->response->resData->children("domain", true)->infData->contact;    #Tech id        
+
+        $contactArr = ['Registrant' => $registrant_id, 'Technical' => $Tech_id];
+        $updateContactArr = $getContactArr = [];
+
+        foreach ($contactArr as $type => $contactId) {
+            if (!empty($contactArr[$type])) {
+                $contact = [];
+                $contact = $params['contactdetails'][$type];
+                $updateName = ($contact['Full Name']) ? $contact['Full Name'] : $contact['Contact Name'];
+                $updateOrg = ($contact['Organisation Name']) ? $contact['Organisation Name'] : $contact['Organisation'];
+                $updateAdd1 = ($contact['Address 1']) ? $contact['Address 1'] : $contact['Address line 1'];
+                $updateAdd2 = ($contact['Address 2']) ? $contact['Address 2'] : $contact['Address line 2'];
+                $updateCity = ($contact['City']) ? $contact['City'] : $contact['TownCity'];
+                $updateZip = ($contact['Postcode']) ? $contact['Postcode'] : $contact['Zip code'];
+                $updateCc = ($contact['Country']) ? $contact['Country'] : $contact['Country Code'];
+                $updateEmail = $contact['Email'];
+                $updatePhn = ($contact['Phone Number']) ? $contact['Phone Number'] : $contact['Phone'];
+                $updateContactArr['Contact Name'] = htmlspecialchars(trim($updateName));
+                $updateContactArr['Organisation'] = htmlspecialchars(trim($updateOrg));
+                $updateContactArr['Address line 1'] = htmlspecialchars(trim($updateAdd1));
+                $updateContactArr['Address line 2'] = htmlspecialchars(trim($updateAdd2));
+                $updateContactArr['TownCity'] = htmlspecialchars(trim($updateCity));
+                $updateContactArr['Zip code'] = htmlspecialchars(trim($updateZip));
+                $updateContactArr['Country Code'] = htmlspecialchars(trim($updateCc));
+                $updateContactArr['Phone'] = htmlspecialchars(trim($updatePhn));
+                $updateContactArr['Email'] = htmlspecialchars(trim($updateEmail));
+
+                $contactInfo = switchepp_contact_info($client, $contactId, 'Get ' . $type);
+                $contact_detail = simplexml_load_string($contactInfo);
+                $contactdataArr = $contact_detail->response->resData->children("contact", true)->infData;
+                foreach ($contactdataArr->postalInfo as $contactFromSwitch) {
+                    $getName = htmlspecialchars($contactFromSwitch->name);
+                    $getOrg = htmlspecialchars($contactFromSwitch->org);
+                    $getAdd1 = htmlspecialchars($contactFromSwitch->addr->street[0]);
+                    $getAdd2 = htmlspecialchars($contactFromSwitch->addr->street[1]);
+                    $getCity = htmlspecialchars($contactFromSwitch->addr->city);
+                    $getZip = htmlspecialchars($contactFromSwitch->addr->pc);
+                    $getCc = htmlspecialchars($contactFromSwitch->addr->cc);
+                    $getContactArr['Contact Name'] = trim($getName);
+                    $getContactArr['Organisation'] = trim($getOrg);
+                    $getContactArr['Address line 1'] = trim($getAdd1);
+                    $getContactArr['Address line 2'] = trim($getAdd2);
+                    $getContactArr['TownCity'] = trim($getCity);
+                    $getContactArr['Zip code'] = trim($getZip);
+                    $getContactArr['Country Code'] = trim($getCc);
+                }
+                $getEmail = htmlspecialchars($contactdataArr->email);
+                $getPhn = htmlspecialchars($contactdataArr->voice);
+                $getContactArr['Phone'] = trim($getPhn);
+                $getContactArr['Email'] = trim($getEmail);
+                if ($getContactArr == $updateContactArr)
+                    continue;
+
+                $updateXml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <update>
+                                    <contact:update xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $contactId . '</contact:id>
+                                        <contact:chg>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $updateContactArr['Contact Name'] . '</contact:name>
+                                                <contact:org>' . $updateContactArr['Organisation'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $updateContactArr['Address line 1'] . '</contact:street>
+                                                    <contact:street>' . $updateContactArr['Address line 2'] . '</contact:street>
+                                                    <contact:city>' . $updateContactArr['TownCity'] . '</contact:city>
+                                                    <contact:sp>' . $updateContactArr['TownCity'] . '</contact:sp>
+                                                    <contact:pc>' . $updateContactArr['Zip code'] . '</contact:pc>
+                                                    <contact:cc>' . $updateContactArr['Country Code'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $updateContactArr['Phone'] . '</contact:voice>
+                                            <contact:fax/>
+                                            <contact:email>' . $updateContactArr['Email'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>con-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:chg>
+                                    </contact:update>
+                                </update>
+                            <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+                switchepp_write_xml($client, $updateXml, 'Save ' . $type);
+            }
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#************************Domain Delete*************************#
+
+function switchepp_RequestDelete($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+
+        $deletxml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <delete>
+                                    <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . $domainname . '</domain:name>
+                                    </domain:delete>
+                                    </delete>
+                            <clTRID>delete-domain-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $delete_domain = switchepp_write_xml($client, $deletxml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#******************************Domain transfer********************************#
+
+function switchepp_TransferDomain($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+        #domain transfer
+        $xmlTransfer = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <transfer op="request">
+                            <domain:transfer xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                <domain:name>' . $domainname . '</domain:name>
+                                    <domain:authInfo>
+                                            <domain:pw>' . htmlentities($params['transfersecret']) . '</domain:pw>
+                                    </domain:authInfo>
+                            </domain:transfer>
+                        </transfer>
+                    <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                    </command>
+                </epp>';
+        $Transfer_domain = switchepp_write_xml($client, $xmlTransfer, __FUNCTION__);
+        $regContactId = strtoupper(switchepp_generateContactID(8) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($regContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlclient = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>RE' . $regContactId . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $params['fullname'] . '</contact:name>
+                                            <contact:org>' . $params['companyname'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $params['address1'] . '</contact:street>
+                                                <contact:street>' . $params['address2'] . '</contact:street>
+                                                <contact:city>' . $params['city'] . '</contact:city>
+                                                <contact:pc>' . $params['postcode'] . '</contact:pc>
+                                                <contact:cc>' . $params['country'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $params['phonenumberformatted'] . '</contact:voice>
+                                        <contact:email>' . $params['email'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $create_reg_contact = switchepp_write_xml($client, $xmlclient, __FUNCTION__ . ' (create reg contact)');
+            $reg_contact_id = $create_reg_contact->response->resData->children('contact', true)->creData->id;
+        } else
+            $reg_contact_id = $regContactId;
+        #*************tech create*****************#            
+        $techContactId = strtoupper(switchepp_generateContactID(6) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($techContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlTech = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>TE' . $techContactId . '</contact:id>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $params['adminfirstname'] . ' ' . $params['adminlastname'] . '</contact:name>
+                                                <contact:org>' . $params['admincompanyname'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $params['adminaddress1'] . '</contact:street>
+                                                    <contact:street>' . $params['adminaddress2'] . '</contact:street>
+                                                    <contact:city>' . $params['admincity'] . '</contact:city>
+                                                    <contact:pc>' . $params['adminpostcode'] . '</contact:pc>
+                                                    <contact:cc>' . $params['admincountry'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $params['adminfullphonenumber'] . '</contact:voice>
+                                            <contact:email>' . $params['adminemail'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>Tec-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:create>
+                                    </create>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $create_tech_contact = switchepp_write_xml($client, $xmlTech, __FUNCTION__ . ' (create tech contact)');
+            $tech_contact_id = $create_tech_contact->response->resData->children('contact', true)->creData->id;
+        } else
+            $tech_contact_id = $techContactId;
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                            <secDNS:add> 
+                                                <secDNS:dsData> 
+                                                    <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                    <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                    <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                        <secDNS:digest>' . $digest . '</secDNS:digest>
+                                                </secDNS:dsData>
+                                            </secDNS:add>
+                                        </secDNS:update> 
+                                    </extension>';
+        }
+        $xmlUpdate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                                <domain:add>
+                                                    <domain:contact type="tech">' . $tech_contact_id . '</domain:contact>
+                                                </domain:add>
+                                                <domain:chg>
+                                                   <domain:registrant>' . $reg_contact_id . '</domain:registrant>
+                                                </domain:chg>
+                                        </domain:update>
+                                    </update>
+                                    ' . $dnssec . '
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $update_domain = switchepp_write_xml($client, $xmlUpdate, __FUNCTION__ . ' (Domain update)');
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Get Epp Code******************************#
+
+function switchepp_GetEPPCode($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $domainPw = switchepp_generateRandomString(15);
+        $xml = switchepp_update_domain_auth($params, $domainPw);
+        $domainUpdate = switchepp_write_xml($client, $xml, __FUNCTION__);
+        $values['eppcode'] = $domainPw;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Custom button function******************************#
+
+function switchepp_AdminCustomButtonArray() {
+    $buttonarray = array(
+        "Restore Domain" => "Restore",
+    );
+    return $buttonarray;
+}
+
+#***************************Restore Domain******************************#
+
+function switchepp_Restore($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #Domain Restore XML
+        $xml = switchepp_domain_restore($params);
+        $domainRestore = switchepp_write_xml($client, $xml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Admin Fields******************************#
+
+function switchepp_AdminDomainsTabFields($params) {
+    try {
+
+        $settingArr = getSwitchEPP_setting($params['domainid']);  #get registrar config settings
+
+        $params = array_merge($params, $settingArr);
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = $info_domain->response->resData->children("domain", true)->infData->exDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->exDate)) : '';
+        $status = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        $upDate = $info_domain->response->resData->children("domain", true)->infData->upDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->upDate)) : '';
+        $transferDate = $info_domain->response->resData->children("domain", true)->infData->trDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->trDate)) : '';
+        $createDate = $info_domain->response->resData->children("domain", true)->infData->crDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->crDate)) : '';
+        $html = '';
+        $html .= '<table width="100%" style="margin-bottom:0;" class="datatable">';
+        $html .= '<tbody>';
+        $html .= '<tr align="left">';
+        $html .= '<th style="text-align: left;">Item</th>';
+        $html .= '<th style="text-align: left;">Content</th>';
+
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Status</td>';
+        $html .= '<td>' . $status . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Creation Date</td>';
+        $html .= '<td>' . $createDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Expiration Date</td>';
+        $html .= '<td>' . $expDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Last Update</td>';
+        $html .= '<td>' . $upDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Last Transfer</td>';
+        $html .= '<td>' . $transferDate . '</td>';
+        $html .= '</tr>';
+        $html .= '</tbody>';
+        $html .= '</table>';
+
+        $values['Domain Detail'] = $html;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*******************Module Syncronize********************#
+
+function switchepp_Sync($params) {
+
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = substr($info_domain->response->resData->children("domain", true)->infData->exDate, 0, 10);
+        $statusres = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        $timestamp = strtotime($info_domain->response->resData->children("domain", true)->infData->exDate);
+        if ($timestamp === false) {
+            return array(
+                'error' => 'Renewal date empty for domain: ' . $params['domain']
+            );
+        }
+        Capsule::table('tbldomains')->where('id', $params['domainid'])->update(['expirydate' => $expDate]);
+        $domain = Capsule::table('tbldomains')
+                ->where('id', '=', $params['domainid'])
+                ->where('donotrenew', '=', '1')
+                ->where('registrar', '=', 'switchepp')
+                ->whereRaw('`expirydate` >= CURRENT_DATE() AND `expirydate` < ADDDATE(CURRENT_DATE(), INTERVAL 1 DAY)')
+                ->first();
+
+        if (isset($domain->expirydate)) {
+            $IDN = new idna_convert();
+            $input = switcheppGetDomainName($params['domainid']);
+            $domainname = $IDN->encode($input);
+
+            $deletxml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <delete>
+                                    <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . $domainname . '</domain:name>
+                                    </domain:delete>
+                                    </delete>
+                            <clTRID>delete-domain-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $delete_domain = switchepp_write_xml($client, $deletxml, __FUNCTION__ . ' (delete domain)');
+        }
+        if ($timestamp < time()) {
+            $values['expirydate'] = $expDate;
+            $values['expired'] = true;
+        } else {
+            $values['expirydate'] = $expDate;
+            $values['active'] = true;
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+
+    return $values;
+}
+
+#*******************Transfer Syncronize********************#
+
+function switchepp_TransferSync($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = substr($info_domain->response->resData->children("domain", true)->infData->exDate, 0, 10);
+        $statusres = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        if (!$statusres) {
+            Capsule::table('tbldomains')->where('id', $params['domainid'])->update(["status" => "Cancelled"]);
+            $values['error'] = "TransferSync/domain-info: Domain not found";
+        }
+        Capsule::table('tbldomains')->where('id', $params['domainid'])->update(['expirydate' => $expDate]);
+        if ($statusres == "ok" || $statusres == "serverTransferProhibited") {
+            $values['completed'] = true;
+        } else {
+            $values['error'] = "Sync/domain-info: Unknown status code '$statusres' ";
+        }
+        $values['expirydate'] = $expDate;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***********************Register Nameserver**************************#  
+
+function switchepp_RegisterNameserver($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $xml_Hostcreate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                               <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <create>
+                                            <host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                 <host:name>' . $params['nameserver'] . '</host:name>
+                                                 <host:addr ip="v4">' . $params['ipaddress'] . '</host:addr>
+                                            </host:create>
+                                        </create>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                               </epp>';
+        $host_create = switchepp_write_xml($client, $xml_Hostcreate, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**************************Update Nameserver************************#
+
+function switchepp_ModifyNameserver($params) {
+    try {
+        //$check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $update_req = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <update>
+                                            <host:update xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                <host:name>' . $params['nameserver'] . '</host:name>
+                                                <host:add>
+                                                    <host:addr ip="v4">' . $params['currentipaddress'] . '</host:addr>
+                                                </host:add>
+                                                <host:rem>
+                                                    <host:addr ip="v6">' . $params['newipaddress'] . '</host:addr>
+                                                </host:rem>
+                                            </host:update>
+                                        </update>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                                </epp>';
+        $update = switchepp_write_xml($client, $update_req, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**********************Delete Nameserver****************************#
+
+function switchepp_DeleteNameserver($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $delete_xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                           <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                             <command>
+                                <delete>
+                                    <host:delete
+                                        xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                        <host:name>' . $params['nameserver'] . '</host:name>
+                                    </host:delete>
+                                </delete>
+                             <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                             </command>
+                           </epp>';
+        $delete = switchepp_write_xml($client, $delete_xml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*********************Create Epp Connection**************************#
+
+function switchepp_clientloginepp($params) {
+    try {
+        $certFile = __DIR__ . '/cert/cert.pem';
+        $client = new Net_EPP_Client();
+        $use_ssl = true;
+        if (file_exists($certFile)) {
+            $context = stream_context_create();
+            stream_context_set_option($context, 'ssl', 'verify_peer', false);
+            stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
+            stream_context_set_option($context, 'ssl', 'local_cert', $certFile);
+            stream_context_set_option($context, 'ssl', 'passphrase', $params['passphrase']);
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        } else {
+            $context = false;
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        }
+    } catch (Exception $e) {
+        $port = $params['eppport'];
+        throw new exception("Connection Error: " . $e->getMessage());
+    }
+    return $client;
+}
+
+#*********************Epp client login**************************#
+
+function switchepp_loggedinepp($client, $params) {
+#    error_log("switchepp_loggedinepp " . $client . " | " . $params);
+    
+    if ($params['svcExtension'] == "on") {
+        $dnssec = '<svcExtension>
+                        <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
+                        <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
+                        <extURI>urn:ietf:params:xml:ns:changePoll-1.0</extURI>
+                        <extURI>https://www.nic.ch/epp/balance-1.0</extURI>
+                    </svcExtension>';
+    } else {
+	$dnssec = '<svcExtension>
+                        <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
+                        <extURI>urn:ietf:params:xml:ns:changePoll-1.0</extURI>
+                        <extURI>https://www.nic.ch/epp/balance-1.0</extURI>
+                    </svcExtension>';
+    }
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <login>
+                            <clID>' . $params['registrar_id'] . '</clID>
+                            <pw>' . $params['registrar_password'] . '</pw>
+                            <options>
+                                <version>1.0</version>
+                                <lang>en</lang>
+                            </options>
+                            <svcs>
+                                <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
+                                ' . $dnssec . '
+                            </svcs>
+                        </login>
+                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                    </command>
+                </epp>';
+
+    error_log("EPP LOGIN: " . $xml);
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', 'login', $xml, $response);
+    $result = new SimpleXMLElement($response);
+
+    if ($result->response->result->attributes()->code >= 2000) {
+        throw new exception($result->response->result->msg . '. ' . $result->response->result->extValue->reason);
+    }
+    return $result;
+}
+
+function switchepp_logoutepp($client, $params) {
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <epp:command xmlns:epp="urn:ietf:params:xml:ns:epp-1.0">
+                                <epp:logout />
+                                <epp:clTRID>' . $params['registrar_id'] . '</epp:clTRID>
+                            </epp:command>
+                        </epp>';
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', 'logout', $xml, $response);
+}
+
+#******************** Get Contact info*****************#
+
+function switchepp_contact_info($client, $contactId, $contactType) {
+    #get contact detail
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $contactId . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', $contactType, $xml, $response);
+    return $response;
+}
+
+#***********************Get domain info*************************#
+
+function switchepp_domain_info($params) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <info>
+                            <domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                <domain:name hosts="all">' . $domainname . '</domain:name>
+                            </domain:info>
+                        </info>
+                    <clTRID>clientref-' . rand(100, 999) . '</clTRID>
+                    </command>
+                </epp>';
+    return $xml;
+}
+
+function switchepp_domain_restore($params) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                    <update>
+                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                            <domain:name>' . $domainname . '</domain:name>
+                            <domain:chg />
+                        </domain:update>
+                    </update>
+                    <extension>
+                        <rgp:update xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0">
+                            <rgp:restore op="request" />
+                        </rgp:update>
+                    </extension>
+                 </command>
+                </epp>';
+    return $xml;
+}
+
+function switchepp_update_domain_auth($params, $domainPw) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:chg>
+                                                <domain:authInfo>
+                                                    <domain:pw>' . $domainPw . '</domain:pw>
+                                                </domain:authInfo>
+                                            </domain:chg>
+                             </domain:update>
+                             </update>
+                             <clTRID>domainupdate-' . rand(1000, 9999) . '</clTRID>
+                             </command>
+                            </epp>';
+    return $xml;
+}
+
+function switchepp_checkContact($id) {
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <check>
+                                    <contact:check xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $id . '</contact:id>
+                                    </contact:check>
+                                </check>
+                            <clTRID>ABC-12345</clTRID>
+                            </command>
+                        </epp>';
+    return $xml;
+}
+
+function switchepp_generateRandomString($length = 15) {
+    $characters = 'abcdefghijklmnopqrstuvwxyz123456789!@$*%#ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switchepp_generateDigestRandomString($length = 15) {
+    $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switchepp_generateContactID($length = 15) {
+    $characters = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switcheppGetDomainName($id) {
+    $data = Capsule::table('tbldomains')->where('id', $id)->first();
+    return $data->domain;
+}
+
+function switchepp_write_xml($client, $xml, $action, $extra = NULL) {
+    $response = $client->request($xml);
+    if (empty($extra)) {
+        logModuleCall('SWITCH EPP', $action, $xml, $response);
+        $result = new SimpleXMLElement($response);
+
+        if ($result->response->result->attributes()->code >= 2000) {
+            throw new exception($result->response->result->msg . '. ' . $result->response->result->extValue->reason);
+        }
+        return $result;
+    }
+}
+
+function getSwitchEPP_setting($id) {
+    #select table domain data
+    $domain_select_data = Capsule::table('tbldomains')->where('id', $id)->first();
+
+    #select registrar data
+    foreach (Capsule::table('tblregistrars')->where('registrar', $domain_select_data->registrar)->get() as $registrar_data) {
+        $data[$registrar_data->setting] = decrypt($registrar_data->value);
+    }
+    return $data;
+}
+
+function switchepp_license_status($params) {
+    if ($license_check['status'] != 'Active') {
+        throw new exception('license is ' . $license_check['status']);
+    }
+    return $license_check;
+}
+
+#License function
+
+
+?>

+ 1328 - 0
switchepp.php.bak

@@ -0,0 +1,1328 @@
+<?php
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *  SWITCH EPP REGISTRAR WHMCS Module By whmcsglobalservices.com
+ *  Copyright whmcsglobalservices, All Rights Reserved
+ *  
+ *  Release: 21 January, 2015
+ *  Version: 3.0.6
+ *  WHMCS Version: v6,v7
+ *  Update Date: 04 Sep, 2019
+ * 
+ *  By WHMCSGLOBALSERVICES    https://whmcsglobalservices.com
+ *  Contact                   info@whmcsglobalservices.com
+ *  
+ *  This module is made under license issued by whmcsglobalservices.com
+ *  and used under all terms and conditions of license.    Ownership of 
+ *  module can not be changed.     Title and copy of    module  is  not
+ *  available to any other person.
+ *  
+ *  @owner <whmcsglobalservices.com>
+ *  @author <WHMCSGLOBALSERVICES>
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+use Illuminate\Database\Capsule\Manager as Capsule;
+use WGSSWITCHEPP\IDNA\idna_convert as idna_convert;
+
+if (!defined("WHMCS"))
+    die("This file cannot be accessed directly");
+
+
+if (!class_exists('Net_EPP_Protocol')) {
+    if (file_exists(__DIR__ . "/Net/EPP/Client.php"))
+        require_once __DIR__ . "/Net/EPP/Client.php";
+}
+
+require_once(__DIR__ . '/idna_convert.class.php');
+
+#*********************Registrar config options***************************#
+
+function switchepp_getConfigArray() {
+    $configarray = array(
+        "FriendlyName" => array(
+            "Type" => "System",
+            "Value" => "Switch Epp"
+        ),
+        "registrar_id" => array(
+            "FriendlyName" => "Registrar Id",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "registrar_password" => array(
+            "FriendlyName" => "Password",
+            "Type" => "password",
+            "Size" => "50",
+        ),
+        "eppurl" => array(
+            "FriendlyName" => "EPP URL",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "eppport" => array(
+            "FriendlyName" => "Port Number",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "licensenum" => array(
+            "FriendlyName" => "License  Key",
+            "Type" => "text",
+            "Size" => "50",
+        ),
+        "dnssec" => array(
+            "FriendlyName" => "DNSSEC",
+            "Type" => "yesno",
+        ),
+        "algorithm" => array(
+            "FriendlyName" => "Algorithm",
+            'Type' => 'dropdown',
+            'Options' => "5,7,8,10,13,14,15,16",
+            'Default' => '5',
+        ),
+        "digest_type" => array(
+            "FriendlyName" => "Digest Type",
+            'Type' => 'dropdown',
+            'Options' => "1,2,3,4",
+            'Default' => '1',
+        ),
+        "passphrase" => array(
+            "FriendlyName" => "Pass Phrase",
+            "Type" => "password",
+            "Size" => "30",
+            "Description" => "It's optional"
+        ),
+        "svcExtension" => array(
+            "FriendlyName" => "Enable svcExtension",
+            "Type" => "yesno",
+            "Description" => "Tick if svcExtension supported."
+        ),
+        "switchepp_version" => array(
+            "FriendlyName" => "Version",
+            "Description" => "3.0.6",
+        ),
+        "switchepp_update" => array(
+            "FriendlyName" => "Updated Date",
+            "Description" => "04 Sep, 2019",
+        )
+    );
+    return $configarray;
+}
+
+#*******************Get Nameserver***********************#
+
+function switchepp_GetNameservers($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $ns = $info_domain->response->resData->children("domain", true)->infData->ns->hostObj;
+
+        $i = 1;
+        $values = array();
+        foreach ($ns as $nn) {
+            $values["ns{$i}"] = $nn;
+            $i++;
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+
+    return $values;
+}
+
+#*********************Save mameserver**************************#
+
+function switchepp_SaveNameservers($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $ns = $info_domain->response->resData->children("domain", true)->infData->ns->hostObj;
+        $rem_hosts = '';
+        foreach ($ns as $nn) {
+            $rem_hosts .= ' <domain:hostObj>' . $nn . '</domain:hostObj> ';
+        }
+        # Generate XML for nameservers
+        if ($nameserver1 = $params["ns1"]) {
+            $add_hosts = ' <domain:hostObj>' . $nameserver1 . '</domain:hostObj> ';
+        }
+        if ($nameserver2 = $params["ns2"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver2 . '</domain:hostObj> ';
+        }
+        if ($nameserver3 = $params["ns3"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver3 . '</domain:hostObj> ';
+        }
+        if ($nameserver4 = $params["ns4"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver4 . '</domain:hostObj> ';
+        }
+        if ($nameserver5 = $params["ns5"]) {
+            $add_hosts .= ' <domain:hostObj>' . $nameserver5 . '</domain:hostObj> ';
+        }
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                            <secDNS:add> 
+                                                <secDNS:dsData> 
+                                                    <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                    <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                    <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                    <secDNS:digest>' . $digest . '</secDNS:digest>
+                                                </secDNS:dsData>
+                                            </secDNS:add>
+                                        </secDNS:update> 
+                                    </extension>';
+        }
+        $xmlUpdate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:add>
+                                                <domain:ns>
+                                                ' . $add_hosts . '
+                                                </domain:ns>
+                                            </domain:add>    
+                                            <domain:rem>
+                                                <domain:ns>
+                                                ' . $rem_hosts . '
+                                                </domain:ns>
+                                            </domain:rem>
+                                        </domain:update>
+                                    </update>
+                                    ' . $dnssec . '
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $update_domain = switchepp_write_xml($client, $xmlUpdate, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*************************Domain Register****************************#
+
+function switchepp_RegisterDomain($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xmlcheck = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <check>
+                                    <domain:check xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . switcheppGetDomainName($params['domainid']) . '</domain:name>
+                                    </domain:check>
+                                </check>
+                            <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                            </command>
+                        </epp>';
+
+        $domain_check = switchepp_write_xml($client, $xmlcheck, __FUNCTION__ . '( check domain)');
+        if (0 == (int) $domain_check->response->resData->children("domain", true)->chkData->cd[0]->name->attributes()->avail)
+            throw new exception($domain_check->response->resData->children("domain", true)->chkData->cd[0]->name . ' ' . $domain_check->response->resData->children("domain", true)->chkData->cd[0]->reason);
+
+        $regContactId = strtoupper(switchepp_generateContactID(8) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($regContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlclient = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>REG' . $regContactId . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $params['fullname'] . '</contact:name>
+                                            <contact:org>' . $params['companyname'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $params['address1'] . '</contact:street>
+                                                <contact:street>' . $params['address2'] . '</contact:street>
+                                                <contact:city>' . $params['city'] . '</contact:city>
+                                                <contact:pc>' . $params['postcode'] . '</contact:pc>
+                                                <contact:cc>' . $params['country'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $params['phonenumberformatted'] . '</contact:voice>
+                                        <contact:email>' . $params['email'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>Regcon-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $create_reg_contact = switchepp_write_xml($client, $xmlclient, __FUNCTION__ . '( create reg contact)');
+            $reg_contact_id = $create_reg_contact->response->resData->children('contact', true)->creData->id;
+        } else {
+            $reg_contact_id = $regContactId;
+        }
+        #*************tech create*****************#     
+        $techContactId = strtoupper(switchepp_generateContactID(6) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($techContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlTech = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>TE' . $techContactId . '</contact:id>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $params['adminfirstname'] . ' ' . $params['adminlastname'] . '</contact:name>
+                                                <contact:org>' . $params['admincompanyname'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $params['adminaddress1'] . '</contact:street>
+                                                    <contact:street>' . $params['adminaddress2'] . '</contact:street>
+                                                    <contact:city>' . $params['admincity'] . '</contact:city>
+                                                    <contact:pc>' . $params['adminpostcode'] . '</contact:pc>
+                                                    <contact:cc>' . $params['admincountry'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $params['adminfullphonenumber'] . '</contact:voice>
+                                            <contact:email>' . $params['adminemail'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>Tec-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:create>
+                                    </create>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $create_tech_contact = switchepp_write_xml($client, $xmlTech, __FUNCTION__ . '( create tech contact)');
+            $tech_contact_id = $create_tech_contact->response->resData->children('contact', true)->creData->id;
+        } else {
+            $tech_contact_id = $techContactId;
+        }
+        #*******************NameServer*************#                
+        if ($params['ns1']) {
+            $ns .= '<domain:hostObj>' . $params['ns1'] . '</domain:hostObj>';
+        }
+        if ($params['ns2']) {
+            $ns .= '<domain:hostObj>' . $params['ns2'] . '</domain:hostObj>';
+        }
+        if ($params['ns3']) {
+            $ns .= '<domain:hostObj>' . $params['ns3'] . '</domain:hostObj>';
+        }
+        if ($params['ns4']) {
+            $ns .= '<domain:hostObj>' . $params['ns4'] . '</domain:hostObj>';
+        }
+        if ($ns) {
+            $nsnameserver = ' <domain:ns>
+                                    ' . $ns . '
+                             </domain:ns>';
+        }
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:create xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                             <secDNS:dsData> 
+                                                        <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                        <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                        <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                        <secDNS:digest>' . $digest . '</secDNS:digest>
+                                              </secDNS:dsData>
+                                        </secDNS:create>
+                                   </extension>';
+        }
+        $domainPw = switchepp_generateRandomString(15);
+        #domian create command
+        $xmldomain = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <domain:create xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            ' . $nsnameserver . '
+                                             <domain:registrant>' . $reg_contact_id . '</domain:registrant>
+                                             <domain:contact type="tech">' . $tech_contact_id . '</domain:contact>
+                                             <domain:authInfo>
+                                             <domain:pw>' . $domainPw . '</domain:pw>
+                                             </domain:authInfo>
+                                        </domain:create>
+                                    </create>
+                                   ' . $dnssec . '
+                                <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                </command>
+                            </epp>';
+        $domain_create = switchepp_write_xml($client, $xmldomain, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**********************************Get Contact Detail*******************************#
+
+function switchepp_GetContactDetails($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $registrant_id = $info_domain->response->resData->children("domain", true)->infData->registrant;   #registrant id
+        $Tech_id = $info_domain->response->resData->children("domain", true)->infData->contact;    #Tech id
+        $xml2 = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $registrant_id . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+        $info_contact = switchepp_write_xml($client, $xml2, __FUNCTION__ . '(registrant contact info)');
+        $contactdataArr = $info_contact->response->resData->children("contact", true)->infData;
+        $results["Registrant"]["Contact Name"] = $contactdataArr->postalInfo->name;
+        $results["Registrant"]["Organisation"] = $contactdataArr->postalInfo->org;
+        $results["Registrant"]["Address line 1"] = $contactdataArr->postalInfo->addr->street[0];
+        $results["Registrant"]["Address line 2"] = $contactdataArr->postalInfo->addr->street[1];
+        $results["Registrant"]["TownCity"] = $contactdataArr->postalInfo->addr->city;
+        $results["Registrant"]["Zip code"] = $contactdataArr->postalInfo->addr->pc;
+        $results["Registrant"]["Country Code"] = $contactdataArr->postalInfo->addr->cc;
+        $results["Registrant"]["Phone"] = $contactdataArr->voice;
+        $results["Registrant"]["Email"] = $contactdataArr->email;
+        if (!empty($Tech_id)) {
+            #get tech detail
+            $xml3 = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $Tech_id . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $tect_info_contact = switchepp_write_xml($client, $xml3, __FUNCTION__ . '(tech contact info)');
+            #*************************Show tech information in field****************************#
+            $techdataArr = $tect_info_contact->response->resData->children("contact", true)->infData;
+            $results["Technical"]["Contact Name"] = $techdataArr->postalInfo->name;
+            $results["Technical"]["Organisation"] = $techdataArr->postalInfo->org;
+            $results["Technical"]["Address line 1"] = $techdataArr->postalInfo->addr->street[0];
+            $results["Technical"]["Address line 2"] = $techdataArr->postalInfo->addr->street[1];
+            $results["Technical"]["TownCity"] = $techdataArr->postalInfo->addr->city;
+            $results["Technical"]["Zip code"] = $techdataArr->postalInfo->addr->pc;
+            $results["Technical"]["Country Code"] = $techdataArr->postalInfo->addr->cc;
+            $results["Technical"]["Phone"] = $techdataArr->voice;
+            $results["Technical"]["Email"] = $techdataArr->email;
+        }
+    } catch (Exception $ex) {
+        $results['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $results;
+}
+
+#******************Save Contact/Tech Detail*********************#
+
+function switchepp_SaveContactDetails($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $registrant_id = $info_domain->response->resData->children("domain", true)->infData->registrant;   #registrant id
+        $Tech_id = $info_domain->response->resData->children("domain", true)->infData->contact;    #Tech id        
+
+        $contactArr = ['Registrant' => $registrant_id, 'Technical' => $Tech_id];
+        $updateContactArr = $getContactArr = [];
+
+        foreach ($contactArr as $type => $contactId) {
+            if (!empty($contactArr[$type])) {
+                $contact = [];
+                $contact = $params['contactdetails'][$type];
+                $updateName = ($contact['Full Name']) ? $contact['Full Name'] : $contact['Contact Name'];
+                $updateOrg = ($contact['Organisation Name']) ? $contact['Organisation Name'] : $contact['Organisation'];
+                $updateAdd1 = ($contact['Address 1']) ? $contact['Address 1'] : $contact['Address line 1'];
+                $updateAdd2 = ($contact['Address 2']) ? $contact['Address 2'] : $contact['Address line 2'];
+                $updateCity = ($contact['City']) ? $contact['City'] : $contact['TownCity'];
+                $updateZip = ($contact['Postcode']) ? $contact['Postcode'] : $contact['Zip code'];
+                $updateCc = ($contact['Country']) ? $contact['Country'] : $contact['Country Code'];
+                $updateEmail = $contact['Email'];
+                $updatePhn = ($contact['Phone Number']) ? $contact['Phone Number'] : $contact['Phone'];
+                $updateContactArr['Contact Name'] = htmlspecialchars(trim($updateName));
+                $updateContactArr['Organisation'] = htmlspecialchars(trim($updateOrg));
+                $updateContactArr['Address line 1'] = htmlspecialchars(trim($updateAdd1));
+                $updateContactArr['Address line 2'] = htmlspecialchars(trim($updateAdd2));
+                $updateContactArr['TownCity'] = htmlspecialchars(trim($updateCity));
+                $updateContactArr['Zip code'] = htmlspecialchars(trim($updateZip));
+                $updateContactArr['Country Code'] = htmlspecialchars(trim($updateCc));
+                $updateContactArr['Phone'] = htmlspecialchars(trim($updatePhn));
+                $updateContactArr['Email'] = htmlspecialchars(trim($updateEmail));
+
+                $contactInfo = switchepp_contact_info($client, $contactId, 'Get ' . $type);
+                $contact_detail = simplexml_load_string($contactInfo);
+                $contactdataArr = $contact_detail->response->resData->children("contact", true)->infData;
+                foreach ($contactdataArr->postalInfo as $contactFromSwitch) {
+                    $getName = htmlspecialchars($contactFromSwitch->name);
+                    $getOrg = htmlspecialchars($contactFromSwitch->org);
+                    $getAdd1 = htmlspecialchars($contactFromSwitch->addr->street[0]);
+                    $getAdd2 = htmlspecialchars($contactFromSwitch->addr->street[1]);
+                    $getCity = htmlspecialchars($contactFromSwitch->addr->city);
+                    $getZip = htmlspecialchars($contactFromSwitch->addr->pc);
+                    $getCc = htmlspecialchars($contactFromSwitch->addr->cc);
+                    $getContactArr['Contact Name'] = trim($getName);
+                    $getContactArr['Organisation'] = trim($getOrg);
+                    $getContactArr['Address line 1'] = trim($getAdd1);
+                    $getContactArr['Address line 2'] = trim($getAdd2);
+                    $getContactArr['TownCity'] = trim($getCity);
+                    $getContactArr['Zip code'] = trim($getZip);
+                    $getContactArr['Country Code'] = trim($getCc);
+                }
+                $getEmail = htmlspecialchars($contactdataArr->email);
+                $getPhn = htmlspecialchars($contactdataArr->voice);
+                $getContactArr['Phone'] = trim($getPhn);
+                $getContactArr['Email'] = trim($getEmail);
+                if ($getContactArr == $updateContactArr)
+                    continue;
+
+                $updateXml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <update>
+                                    <contact:update xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $contactId . '</contact:id>
+                                        <contact:chg>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $updateContactArr['Contact Name'] . '</contact:name>
+                                                <contact:org>' . $updateContactArr['Organisation'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $updateContactArr['Address line 1'] . '</contact:street>
+                                                    <contact:street>' . $updateContactArr['Address line 2'] . '</contact:street>
+                                                    <contact:city>' . $updateContactArr['TownCity'] . '</contact:city>
+                                                    <contact:sp>' . $updateContactArr['TownCity'] . '</contact:sp>
+                                                    <contact:pc>' . $updateContactArr['Zip code'] . '</contact:pc>
+                                                    <contact:cc>' . $updateContactArr['Country Code'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $updateContactArr['Phone'] . '</contact:voice>
+                                            <contact:fax/>
+                                            <contact:email>' . $updateContactArr['Email'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>con-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:chg>
+                                    </contact:update>
+                                </update>
+                            <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+                switchepp_write_xml($client, $updateXml, 'Save ' . $type);
+            }
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#************************Domain Delete*************************#
+
+function switchepp_RequestDelete($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+
+        $deletxml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <delete>
+                                    <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . $domainname . '</domain:name>
+                                    </domain:delete>
+                                    </delete>
+                            <clTRID>delete-domain-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+        $delete_domain = switchepp_write_xml($client, $deletxml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#******************************Domain transfer********************************#
+
+function switchepp_TransferDomain($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+
+        $IDN = new idna_convert();
+        $input = switcheppGetDomainName($params['domainid']);
+        $domainname = $IDN->encode($input);
+        #domain transfer
+        $xmlTransfer = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <transfer op="request">
+                            <domain:transfer xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                <domain:name>' . $domainname . '</domain:name>
+                                    <domain:authInfo>
+                                            <domain:pw>' . htmlentities($params['transfersecret']) . '</domain:pw>
+                                    </domain:authInfo>
+                            </domain:transfer>
+                        </transfer>
+                    <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                    </command>
+                </epp>';
+        $Transfer_domain = switchepp_write_xml($client, $xmlTransfer, __FUNCTION__);
+        $regContactId = strtoupper(switchepp_generateContactID(8) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($regContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlclient = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <create>
+                                    <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>RE' . $regContactId . '</contact:id>
+                                        <contact:postalInfo type="loc">
+                                            <contact:name>' . $params['fullname'] . '</contact:name>
+                                            <contact:org>' . $params['companyname'] . '</contact:org>
+                                            <contact:addr>
+                                                <contact:street>' . $params['address1'] . '</contact:street>
+                                                <contact:street>' . $params['address2'] . '</contact:street>
+                                                <contact:city>' . $params['city'] . '</contact:city>
+                                                <contact:pc>' . $params['postcode'] . '</contact:pc>
+                                                <contact:cc>' . $params['country'] . '</contact:cc>
+                                            </contact:addr>
+                                        </contact:postalInfo>
+                                        <contact:voice>' . $params['phonenumberformatted'] . '</contact:voice>
+                                        <contact:email>' . $params['email'] . '</contact:email>
+                                        <contact:authInfo>
+                                            <contact:pw>Con-' . time() . '</contact:pw>
+                                        </contact:authInfo>
+                                    </contact:create>
+                                </create>
+                            <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $create_reg_contact = switchepp_write_xml($client, $xmlclient, __FUNCTION__ . ' (create reg contact)');
+            $reg_contact_id = $create_reg_contact->response->resData->children('contact', true)->creData->id;
+        } else
+            $reg_contact_id = $regContactId;
+        #*************tech create*****************#            
+        $techContactId = strtoupper(switchepp_generateContactID(6) . $params['domainid']);
+        $contactCheckXml = switchepp_checkContact($techContactId);
+        $contact_check = switchepp_write_xml($client, $contactCheckXml, __FUNCTION__ . ' (check contact)');
+        if (1 == (int) $contact_check->response->resData->children("contact", true)->chkData->cd[0]->id->attributes()->avail) {
+            $xmlTech = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <create>
+                                        <contact:create xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>TE' . $techContactId . '</contact:id>
+                                            <contact:postalInfo type="loc">
+                                                <contact:name>' . $params['adminfirstname'] . ' ' . $params['adminlastname'] . '</contact:name>
+                                                <contact:org>' . $params['admincompanyname'] . '</contact:org>
+                                                <contact:addr>
+                                                    <contact:street>' . $params['adminaddress1'] . '</contact:street>
+                                                    <contact:street>' . $params['adminaddress2'] . '</contact:street>
+                                                    <contact:city>' . $params['admincity'] . '</contact:city>
+                                                    <contact:pc>' . $params['adminpostcode'] . '</contact:pc>
+                                                    <contact:cc>' . $params['admincountry'] . '</contact:cc>
+                                                </contact:addr>
+                                            </contact:postalInfo>
+                                            <contact:voice>' . $params['adminfullphonenumber'] . '</contact:voice>
+                                            <contact:email>' . $params['adminemail'] . '</contact:email>
+                                            <contact:authInfo>
+                                                <contact:pw>Tec-' . time() . '</contact:pw>
+                                            </contact:authInfo>
+                                        </contact:create>
+                                    </create>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+            $create_tech_contact = switchepp_write_xml($client, $xmlTech, __FUNCTION__ . ' (create tech contact)');
+            $tech_contact_id = $create_tech_contact->response->resData->children('contact', true)->creData->id;
+        } else
+            $tech_contact_id = $techContactId;
+        if ($params['dnssec'] == "on") {
+            $digestType = $params['digest_type'];
+            if (empty($digestType))
+                $digestType = 1;
+            if ($digestType == 1) {
+                $string = switchepp_generateDigestRandomString(40);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 40);
+            } elseif ($digestType == 2) {
+                $string = switchepp_generateDigestRandomString(64);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 64);
+            } elseif ($digestType == 3 || $digestType == 4) {
+                $string = switchepp_generateDigestRandomString(96);
+                $digest = strtoupper(bin2hex($string));
+                $digest = substr($digest, 0, 96);
+            }
+            $params['algorithm'] = (!empty($params['algorithm'])) ? $params['algorithm'] : '5';
+            $dnssec = '<extension>
+                                        <secDNS:update xmlns:secDNS="urn:ietf:params:xml:ns:secDNS-1.1">
+                                            <secDNS:add> 
+                                                <secDNS:dsData> 
+                                                    <secDNS:keyTag>' . substr(time(), 0, 5) . '</secDNS:keyTag> 
+                                                    <secDNS:alg>' . $params['algorithm'] . '</secDNS:alg> 
+                                                    <secDNS:digestType>' . $digestType . '</secDNS:digestType> 
+                                                        <secDNS:digest>' . $digest . '</secDNS:digest>
+                                                </secDNS:dsData>
+                                            </secDNS:add>
+                                        </secDNS:update> 
+                                    </extension>';
+        }
+        $xmlUpdate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                                <domain:add>
+                                                    <domain:contact type="tech">' . $tech_contact_id . '</domain:contact>
+                                                </domain:add>
+                                                <domain:chg>
+                                                   <domain:registrant>' . $reg_contact_id . '</domain:registrant>
+                                                </domain:chg>
+                                        </domain:update>
+                                    </update>
+                                    ' . $dnssec . '
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                           </epp>';
+        $update_domain = switchepp_write_xml($client, $xmlUpdate, __FUNCTION__ . ' (Domain update)');
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Get Epp Code******************************#
+
+function switchepp_GetEPPCode($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $domainPw = switchepp_generateRandomString(15);
+        $xml = switchepp_update_domain_auth($params, $domainPw);
+        $domainUpdate = switchepp_write_xml($client, $xml, __FUNCTION__);
+        $values['eppcode'] = $domainPw;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Custom button function******************************#
+
+function switchepp_AdminCustomButtonArray() {
+    $buttonarray = array(
+        "Restore Domain" => "Restore",
+    );
+    return $buttonarray;
+}
+
+#***************************Restore Domain******************************#
+
+function switchepp_Restore($params) {
+    try {
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #Domain Restore XML
+        $xml = switchepp_domain_restore($params);
+        $domainRestore = switchepp_write_xml($client, $xml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***************************Admin Fields******************************#
+
+function switchepp_AdminDomainsTabFields($params) {
+    try {
+
+        $settingArr = getSwitchEPP_setting($params['domainid']);  #get registrar config settings
+
+        $params = array_merge($params, $settingArr);
+        // $check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = $info_domain->response->resData->children("domain", true)->infData->exDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->exDate)) : '';
+        $status = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        $upDate = $info_domain->response->resData->children("domain", true)->infData->upDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->upDate)) : '';
+        $transferDate = $info_domain->response->resData->children("domain", true)->infData->trDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->trDate)) : '';
+        $createDate = $info_domain->response->resData->children("domain", true)->infData->crDate ? date('m-d-Y', strtotime($info_domain->response->resData->children("domain", true)->infData->crDate)) : '';
+        $html = '';
+        $html .= '<table width="100%" style="margin-bottom:0;" class="datatable">';
+        $html .= '<tbody>';
+        $html .= '<tr align="left">';
+        $html .= '<th style="text-align: left;">Item</th>';
+        $html .= '<th style="text-align: left;">Content</th>';
+
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Status</td>';
+        $html .= '<td>' . $status . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Creation Date</td>';
+        $html .= '<td>' . $createDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Expiration Date</td>';
+        $html .= '<td>' . $expDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Last Update</td>';
+        $html .= '<td>' . $upDate . '</td>';
+        $html .= '</tr>';
+        $html .= '<tr align="left">';
+        $html .= '<td>Last Transfer</td>';
+        $html .= '<td>' . $transferDate . '</td>';
+        $html .= '</tr>';
+        $html .= '</tbody>';
+        $html .= '</table>';
+
+        $values['Domain Detail'] = $html;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*******************Module Syncronize********************#
+
+function switchepp_Sync($params) {
+
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = substr($info_domain->response->resData->children("domain", true)->infData->exDate, 0, 10);
+        $statusres = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        $timestamp = strtotime($info_domain->response->resData->children("domain", true)->infData->exDate);
+        if ($timestamp === false) {
+            return array(
+                'error' => 'Renewal date empty for domain: ' . $params['domain']
+            );
+        }
+        Capsule::table('tbldomains')->where('id', $params['domainid'])->update(['expirydate' => $expDate]);
+        $domain = Capsule::table('tbldomains')
+                ->where('id', '=', $params['domainid'])
+                ->where('donotrenew', '=', '1')
+                ->where('registrar', '=', 'switchepp')
+                ->whereRaw('`expirydate` >= CURRENT_DATE() AND `expirydate` < ADDDATE(CURRENT_DATE(), INTERVAL 1 DAY)')
+                ->first();
+
+        if (isset($domain->expirydate)) {
+            $IDN = new idna_convert();
+            $input = switcheppGetDomainName($params['domainid']);
+            $domainname = $IDN->encode($input);
+
+            $deletxml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <delete>
+                                    <domain:delete xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                        <domain:name>' . $domainname . '</domain:name>
+                                    </domain:delete>
+                                    </delete>
+                            <clTRID>delete-domain-' . rand(1000, 9999) . '</clTRID>
+                            </command>
+                        </epp>';
+            $delete_domain = switchepp_write_xml($client, $deletxml, __FUNCTION__ . ' (delete domain)');
+        }
+        if ($timestamp < time()) {
+            $values['expirydate'] = $expDate;
+            $values['expired'] = true;
+        } else {
+            $values['expirydate'] = $expDate;
+            $values['active'] = true;
+        }
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+
+    return $values;
+}
+
+#*******************Transfer Syncronize********************#
+
+function switchepp_TransferSync($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $info_domain = switchepp_write_xml($client, $xml, __FUNCTION__ . '(domain info)');
+        $expDate = substr($info_domain->response->resData->children("domain", true)->infData->exDate, 0, 10);
+        $statusres = $info_domain->response->resData->children("domain", true)->infData->status->attributes()->s;
+        if (!$statusres) {
+            Capsule::table('tbldomains')->where('id', $params['domainid'])->update(["status" => "Cancelled"]);
+            $values['error'] = "TransferSync/domain-info: Domain not found";
+        }
+        Capsule::table('tbldomains')->where('id', $params['domainid'])->update(['expirydate' => $expDate]);
+        if ($statusres == "ok" || $statusres == "serverTransferProhibited") {
+            $values['completed'] = true;
+        } else {
+            $values['error'] = "Sync/domain-info: Unknown status code '$statusres' ";
+        }
+        $values['expirydate'] = $expDate;
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#***********************Register Nameserver**************************#  
+
+function switchepp_RegisterNameserver($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $xml_Hostcreate = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                               <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <create>
+                                            <host:create xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                 <host:name>' . $params['nameserver'] . '</host:name>
+                                                 <host:addr ip="v4">' . $params['ipaddress'] . '</host:addr>
+                                            </host:create>
+                                        </create>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                               </epp>';
+        $host_create = switchepp_write_xml($client, $xml_Hostcreate, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**************************Update Nameserver************************#
+
+function switchepp_ModifyNameserver($params) {
+    try {
+        //$check_license = switchepp_license_status($params);     #Check License
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $update_req = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                    <command>
+                                        <update>
+                                            <host:update xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                                <host:name>' . $params['nameserver'] . '</host:name>
+                                                <host:add>
+                                                    <host:addr ip="v4">' . $params['currentipaddress'] . '</host:addr>
+                                                </host:add>
+                                                <host:rem>
+                                                    <host:addr ip="v6">' . $params['newipaddress'] . '</host:addr>
+                                                </host:rem>
+                                            </host:update>
+                                        </update>
+                                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                                    </command>
+                                </epp>';
+        $update = switchepp_write_xml($client, $update_req, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#**********************Delete Nameserver****************************#
+
+function switchepp_DeleteNameserver($params) {
+    try {
+        $client = switchepp_clientloginepp($params);      #Epp Connection
+        $login = switchepp_loggedinepp($client, $params);      #Epp Client login
+        #get domain info
+        $xml = switchepp_domain_info($params);
+        $delete_xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                           <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                             <command>
+                                <delete>
+                                    <host:delete
+                                        xmlns:host="urn:ietf:params:xml:ns:host-1.0">
+                                        <host:name>' . $params['nameserver'] . '</host:name>
+                                    </host:delete>
+                                </delete>
+                             <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                             </command>
+                           </epp>';
+        $delete = switchepp_write_xml($client, $delete_xml, __FUNCTION__);
+    } catch (Exception $ex) {
+        $values['error'] = $ex->getMessage();
+    }
+    if (!empty($client))
+        switchepp_logoutepp($client, $params);
+    return $values;
+}
+
+#*********************Create Epp Connection**************************#
+
+function switchepp_clientloginepp($params) {
+    try {
+        $certFile = __DIR__ . '/cert/cert.pem';
+        $client = new Net_EPP_Client();
+        $use_ssl = true;
+        if (file_exists($certFile)) {
+            $context = stream_context_create();
+            stream_context_set_option($context, 'ssl', 'verify_peer', false);
+            stream_context_set_option($context, 'ssl', 'allow_self_signed', true);
+            stream_context_set_option($context, 'ssl', 'local_cert', $certFile);
+            stream_context_set_option($context, 'ssl', 'passphrase', $params['passphrase']);
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        } else {
+            $context = false;
+            $client->connect($params['eppurl'], $params['eppport'], 300, $use_ssl, $context) or die("Not connected with epp server");
+        }
+    } catch (Exception $e) {
+        $port = $params['eppport'];
+        throw new exception("Connection Error: " . $e->getMessage());
+    }
+    return $client;
+}
+
+#*********************Epp client login**************************#
+
+function switchepp_loggedinepp($client, $params) {
+    error_log("switchepp_loggedinepp " . $client . " | " . $params);
+    
+    if ($params['svcExtension'] == "on") {
+        $dnssec = '<svcExtension>
+                        <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
+                        <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
+                        <extURI>urn:ietf:params:xml:ns:changePoll-1.0</extURI>
+                        <extURI>https://www.nic.ch/epp/balance-1.0</extURI>
+                    </svcExtension>';
+    } else {
+	$dnssec = '<svcExtension>
+                        <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
+                        <extURI>urn:ietf:params:xml:ns:changePoll-1.0</extURI>
+                        <extURI>https://www.nic.ch/epp/balance-1.0</extURI>
+                    </svcExtension>';
+    }
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <login>
+                            <clID>' . $params['registrar_id'] . '</clID>
+                            <pw>' . $params['registrar_password'] . '</pw>
+                            <options>
+                                <version>1.0</version>
+                                <lang>en</lang>
+                            </options>
+                            <svcs>
+                                <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
+                                <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>
+                                ' . $dnssec . '
+                            </svcs>
+                        </login>
+                    <clTRID>' . rand(9999999, 100000) . '</clTRID>
+                    </command>
+                </epp>';
+
+    error_log("EPP LOGIN: " . $xml);
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', 'login', $xml, $response);
+    $result = new SimpleXMLElement($response);
+
+    if ($result->response->result->attributes()->code >= 2000) {
+        throw new exception($result->response->result->msg . '. ' . $result->response->result->extValue->reason);
+    }
+    return $result;
+}
+
+function switchepp_logoutepp($client, $params) {
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <epp:command xmlns:epp="urn:ietf:params:xml:ns:epp-1.0">
+                                <epp:logout />
+                                <epp:clTRID>' . $params['registrar_id'] . '</epp:clTRID>
+                            </epp:command>
+                        </epp>';
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', 'logout', $xml, $response);
+}
+
+#******************** Get Contact info*****************#
+
+function switchepp_contact_info($client, $contactId, $contactType) {
+    #get contact detail
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <info>
+                                        <contact:info xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                            <contact:id>' . $contactId . '</contact:id>
+                                        </contact:info>
+                                    </info>
+                                <clTRID>clientref-' . rand(1000, 9999) . '</clTRID>
+                                </command>
+                            </epp>';
+    $response = $client->request($xml);
+    logModuleCall('SWITCH EPP', $contactType, $xml, $response);
+    return $response;
+}
+
+#***********************Get domain info*************************#
+
+function switchepp_domain_info($params) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                        <info>
+                            <domain:info xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                <domain:name hosts="all">' . $domainname . '</domain:name>
+                            </domain:info>
+                        </info>
+                    <clTRID>clientref-' . rand(100, 999) . '</clTRID>
+                    </command>
+                </epp>';
+    return $xml;
+}
+
+function switchepp_domain_restore($params) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                    <command>
+                    <update>
+                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                            <domain:name>' . $domainname . '</domain:name>
+                            <domain:chg />
+                        </domain:update>
+                    </update>
+                    <extension>
+                        <rgp:update xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0">
+                            <rgp:restore op="request" />
+                        </rgp:update>
+                    </extension>
+                 </command>
+                </epp>';
+    return $xml;
+}
+
+function switchepp_update_domain_auth($params, $domainPw) {
+    $IDN = new idna_convert();
+    $input = switcheppGetDomainName($params['domainid']);
+    $domainname = $IDN->encode($input);
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                            <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                                <command>
+                                    <update>
+                                        <domain:update xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
+                                            <domain:name>' . $domainname . '</domain:name>
+                                            <domain:chg>
+                                                <domain:authInfo>
+                                                    <domain:pw>' . $domainPw . '</domain:pw>
+                                                </domain:authInfo>
+                                            </domain:chg>
+                             </domain:update>
+                             </update>
+                             <clTRID>domainupdate-' . rand(1000, 9999) . '</clTRID>
+                             </command>
+                            </epp>';
+    return $xml;
+}
+
+function switchepp_checkContact($id) {
+    $xml = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+                        <epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
+                            <command>
+                                <check>
+                                    <contact:check xmlns:contact="urn:ietf:params:xml:ns:contact-1.0">
+                                        <contact:id>' . $id . '</contact:id>
+                                    </contact:check>
+                                </check>
+                            <clTRID>ABC-12345</clTRID>
+                            </command>
+                        </epp>';
+    return $xml;
+}
+
+function switchepp_generateRandomString($length = 15) {
+    $characters = 'abcdefghijklmnopqrstuvwxyz123456789!@$*%#ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switchepp_generateDigestRandomString($length = 15) {
+    $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switchepp_generateContactID($length = 15) {
+    $characters = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    $charactersLength = strlen($characters);
+    $randomString = '';
+    for ($i = 0; $i < $length; $i++) {
+        $randomString .= $characters[rand(0, $charactersLength - 1)];
+    }
+    return $randomString;
+}
+
+function switcheppGetDomainName($id) {
+    $data = Capsule::table('tbldomains')->where('id', $id)->first();
+    return $data->domain;
+}
+
+function switchepp_write_xml($client, $xml, $action, $extra = NULL) {
+    $response = $client->request($xml);
+    if (empty($extra)) {
+        logModuleCall('SWITCH EPP', $action, $xml, $response);
+        $result = new SimpleXMLElement($response);
+
+        if ($result->response->result->attributes()->code >= 2000) {
+            throw new exception($result->response->result->msg . '. ' . $result->response->result->extValue->reason);
+        }
+        return $result;
+    }
+}
+
+function getSwitchEPP_setting($id) {
+    #select table domain data
+    $domain_select_data = Capsule::table('tbldomains')->where('id', $id)->first();
+
+    #select registrar data
+    foreach (Capsule::table('tblregistrars')->where('registrar', $domain_select_data->registrar)->get() as $registrar_data) {
+        $data[$registrar_data->setting] = decrypt($registrar_data->value);
+    }
+    return $data;
+}
+
+function switchepp_license_status($params) {
+    if ($license_check['status'] != 'Active') {
+        throw new exception('license is ' . $license_check['status']);
+    }
+    return $license_check;
+}
+
+#License function
+
+
+?>