From ab6b153a7540fee8f49f2b0140fc7c8c580c2bd1 Mon Sep 17 00:00:00 2001 From: Nigel Kukard <nkukard@lbsd.net> Date: Sat, 5 Sep 2015 09:19:55 +0000 Subject: [PATCH] Set passwords for domain and contacts --- modules/registrars/cozaepp/cozaepp.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/registrars/cozaepp/cozaepp.php b/modules/registrars/cozaepp/cozaepp.php index 91004e7..5acb2f6 100644 --- a/modules/registrars/cozaepp/cozaepp.php +++ b/modules/registrars/cozaepp/cozaepp.php @@ -429,6 +429,9 @@ function cozaepp_RegisterDomain($params) { try { $client = _cozaepp_Client($domain); + # registry.net.za expects 'coza' as the password + $pw = "coza"; + # Send registration $request = $client->request($xml = ' <epp:epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" @@ -452,7 +455,7 @@ function cozaepp_RegisterDomain($params) { <contact:fax></contact:fax> <contact:email>'.$RegistrantEmailAddress.'</contact:email> <contact:authInfo> - <contact:pw>AxA8AjXbAH'.rand().rand().'</contact:pw> + <contact:pw>'.$pw.'</contact:pw> </contact:authInfo> </contact:create> </epp:create> @@ -495,6 +498,9 @@ function cozaepp_RegisterDomain($params) { $_server = _cozaepp_SldLookup($domain); if ($_server['additional_contacts']) { + # Generate a random password to be used for the additional contact + $pw = substr(md5($domain . time() . rand(0, 1000000)), 0,15); + $request = $client->request($xml = ' <epp:epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" xmlns:contact="urn:ietf:params:xml:ns:contact-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> @@ -517,7 +523,7 @@ function cozaepp_RegisterDomain($params) { <contact:fax></contact:fax> <contact:email>'.$AdminEmailAddress.'</contact:email> <contact:authInfo> - <contact:pw>AxA8AjXbAH'.rand().rand().'</contact:pw> + <contact:pw>'.$pw.'</contact:pw> </contact:authInfo> </contact:create> </epp:create> @@ -548,9 +554,12 @@ function cozaepp_RegisterDomain($params) { <domain:contact type="billing">'.$additional_contactid.'</domain:contact>'; } + # registry.net.za expects 'coza' as the password + $pw = "coza"; + $domaincreate .= ' <domain:authInfo> - <domain:pw>coza</domain:pw> + <domain:pw>'.$pw.'</domain:pw> </domain:authInfo> </domain:create> </epp:create> @@ -1557,6 +1566,9 @@ function cozaepp_RecreateContact($params) { # Check for available contact id $registrant = _cozaepp_CheckContact($domain); + # Generate a random password for the contact + $pw = substr(md5($domain . time() . rand(0, 1000000)), 0,15); + # Recreate contact $request = $client->request($xml = ' <epp:epp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:epp="urn:ietf:params:xml:ns:epp-1.0" @@ -1581,7 +1593,7 @@ function cozaepp_RecreateContact($params) { <contact:fax></contact:fax> <contact:email>'.$contact["Registrant"]["Email"].'</contact:email> <contact:authInfo> - <contact:pw>AxA8AjXbAH'.rand().rand().'</contact:pw> + <contact:pw>'.$pw.'</contact:pw> </contact:authInfo> </contact:create> </epp:create> -- GitLab