|
@@ -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>
|