Advertisement
Guest User

Untitled

a guest
Oct 10th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.69 KB | None | 0 0
  1. <?php
  2.  
  3. function template_getConfigArray() {
  4. $configarray = array(
  5. "Username" => array( "Type" => "text", "Size" => "20", "Description" => "Enter your username here", ),
  6. "Password" => array( "Type" => "password", "Size" => "20", "Description" => "Enter your password here", ),
  7. "TestMode" => array( "Type" => "yesno", ),
  8. );
  9. return $configarray;
  10. }
  11.  
  12. function template_GetNameservers($params) {
  13. $username = $params["Username"];
  14. $password = $params["Password"];
  15. $testmode = $params["TestMode"];
  16. $tld = $params["tld"];
  17. $sld = $params["sld"];
  18. # Put your code to get the nameservers here and return the values below
  19. $values["ns1"] = $nameserver1;
  20. $values["ns2"] = $nameserver2;
  21. $values["ns3"] = $nameserver3;
  22. $values["ns4"] = $nameserver4;
  23. # If error, return the error message in the value below
  24. $values["error"] = $error;
  25. return $values;
  26. }
  27.  
  28. function template_SaveNameservers($params) {
  29. $username = $params["Username"];
  30. $password = $params["Password"];
  31. $testmode = $params["TestMode"];
  32. $tld = $params["tld"];
  33. $sld = $params["sld"];
  34. $nameserver1 = $params["ns1"];
  35. $nameserver2 = $params["ns2"];
  36. $nameserver3 = $params["ns3"];
  37. $nameserver4 = $params["ns4"];
  38. # Put your code to save the nameservers here
  39. # If error, return the error message in the value below
  40. $values["error"] = $error;
  41. return $values;
  42. }
  43.  
  44. function template_GetRegistrarLock($params) {
  45. $username = $params["Username"];
  46. $password = $params["Password"];
  47. $testmode = $params["TestMode"];
  48. $tld = $params["tld"];
  49. $sld = $params["sld"];
  50. # Put your code to get the lock status here
  51. if ($lock=="1") {
  52. $lockstatus="locked";
  53. } else {
  54. $lockstatus="unlocked";
  55. }
  56. return $lockstatus;
  57. }
  58.  
  59. function template_SaveRegistrarLock($params) {
  60. $username = $params["Username"];
  61. $password = $params["Password"];
  62. $testmode = $params["TestMode"];
  63. $tld = $params["tld"];
  64. $sld = $params["sld"];
  65. if ($params["lockenabled"]) {
  66. $lockstatus="locked";
  67. } else {
  68. $lockstatus="unlocked";
  69. }
  70. # Put your code to save the registrar lock here
  71. # If error, return the error message in the value below
  72. $values["error"] = $Enom->Values["Err1"];
  73. return $values;
  74. }
  75.  
  76. function template_GetEmailForwarding($params) {
  77. $username = $params["Username"];
  78. $password = $params["Password"];
  79. $testmode = $params["TestMode"];
  80. $tld = $params["tld"];
  81. $sld = $params["sld"];
  82. # Put your code to get email forwarding here - the result should be an array of prefixes and forward to emails (max 10)
  83. foreach ($result AS $value) {
  84. $values[$counter]["prefix"] = $value["prefix"];
  85. $values[$counter]["forwardto"] = $value["forwardto"];
  86. }
  87. return $values;
  88. }
  89.  
  90. function template_SaveEmailForwarding($params) {
  91. $username = $params["Username"];
  92. $password = $params["Password"];
  93. $testmode = $params["TestMode"];
  94. $tld = $params["tld"];
  95. $sld = $params["sld"];
  96. foreach ($params["prefix"] AS $key=>$value) {
  97. $forwardarray[$key]["prefix"] = $params["prefix"][$key];
  98. $forwardarray[$key]["forwardto"] = $params["forwardto"][$key]
  99. }
  100. # Put your code to save email forwarders here
  101. }
  102.  
  103. function template_GetDNS($params) {
  104. $username = $params["Username"];
  105. $password = $params["Password"];
  106. $testmode = $params["TestMode"];
  107. $tld = $params["tld"];
  108. $sld = $params["sld"];
  109. # Put your code here to get the current DNS settings - the result should be an array of hostname, record type, and address
  110. $hostrecords = array();
  111. $hostrecords[] = array( "hostname" => "ns1", "type" => "A", "address" => "192.168.0.1", );
  112. $hostrecords[] = array( "hostname" => "ns2", "type" => "A", "address" => "192.168.0.2", );
  113. return $hostrecords;
  114.  
  115. }
  116.  
  117. function template_SaveDNS($params) {
  118. $username = $params["Username"];
  119. $password = $params["Password"];
  120. $testmode = $params["TestMode"];
  121. $tld = $params["tld"];
  122. $sld = $params["sld"];
  123. # Loop through the submitted records
  124. foreach ($params["dnsrecords"] AS $key=>$values) {
  125. $hostname = $values["hostname"];
  126. $type = $values["type"];
  127. $address = $values["address"];
  128. # Add your code to update the record here
  129. }
  130. # If error, return the error message in the value below
  131. $values["error"] = $Enom->Values["Err1"];
  132. return $values;
  133. }
  134.  
  135. function template_RegisterDomain($params) {
  136. $username = $params["Username"];
  137. $password = $params["Password"];
  138. $testmode = $params["TestMode"];
  139. $tld = $params["tld"];
  140. $sld = $params["sld"];
  141. $regperiod = $params["regperiod"];
  142. $nameserver1 = $params["ns1"];
  143. $nameserver2 = $params["ns2"];
  144. $nameserver3 = $params["ns3"];
  145. $nameserver4 = $params["ns4"];
  146. # Registrant Details
  147. $RegistrantFirstName = $params["firstname"];
  148. $RegistrantLastName = $params["lastname"];
  149. $RegistrantAddress1 = $params["address1"];
  150. $RegistrantAddress2 = $params["address2"];
  151. $RegistrantCity = $params["city"];
  152. $RegistrantStateProvince = $params["state"];
  153. $RegistrantPostalCode = $params["postcode"];
  154. $RegistrantCountry = $params["country"];
  155. $RegistrantEmailAddress = $params["email"];
  156. $RegistrantPhone = $params["phonenumber"];
  157. # Admin Details
  158. $AdminFirstName = $params["adminfirstname"];
  159. $AdminLastName = $params["adminlastname"];
  160. $AdminAddress1 = $params["adminaddress1"];
  161. $AdminAddress2 = $params["adminaddress2"];
  162. $AdminCity = $params["admincity"];
  163. $AdminStateProvince = $params["adminstate"];
  164. $AdminPostalCode = $params["adminpostcode"];
  165. $AdminCountry = $params["admincountry"];
  166. $AdminEmailAddress = $params["adminemail"];
  167. $AdminPhone = $params["adminphonenumber"];
  168. # Put your code to register domain here
  169. # If error, return the error message in the value below
  170. $values["error"] = $error;
  171. return $values;
  172. }
  173.  
  174. function template_TransferDomain($params) {
  175. $username = $params["Username"];
  176. $password = $params["Password"];
  177. $testmode = $params["TestMode"];
  178. $tld = $params["tld"];
  179. $sld = $params["sld"];
  180. $regperiod = $params["regperiod"];
  181. $transfersecret = $params["transfersecret"];
  182. $nameserver1 = $params["ns1"];
  183. $nameserver2 = $params["ns2"];
  184. # Registrant Details
  185. $RegistrantFirstName = $params["firstname"];
  186. $RegistrantLastName = $params["lastname"];
  187. $RegistrantAddress1 = $params["address1"];
  188. $RegistrantAddress2 = $params["address2"];
  189. $RegistrantCity = $params["city"];
  190. $RegistrantStateProvince = $params["state"];
  191. $RegistrantPostalCode = $params["postcode"];
  192. $RegistrantCountry = $params["country"];
  193. $RegistrantEmailAddress = $params["email"];
  194. $RegistrantPhone = $params["phonenumber"];
  195. # Admin Details
  196. $AdminFirstName = $params["adminfirstname"];
  197. $AdminLastName = $params["adminlastname"];
  198. $AdminAddress1 = $params["adminaddress1"];
  199. $AdminAddress2 = $params["adminaddress2"];
  200. $AdminCity = $params["admincity"];
  201. $AdminStateProvince = $params["adminstate"];
  202. $AdminPostalCode = $params["adminpostcode"];
  203. $AdminCountry = $params["admincountry"];
  204. $AdminEmailAddress = $params["adminemail"];
  205. $AdminPhone = $params["adminphonenumber"];
  206. # Put your code to transfer domain here
  207. # If error, return the error message in the value below
  208. $values["error"] = $error;
  209. return $values;
  210. }
  211.  
  212. function template_RenewDomain($params) {
  213. $username = $params["Username"];
  214. $password = $params["Password"];
  215. $testmode = $params["TestMode"];
  216. $tld = $params["tld"];
  217. $sld = $params["sld"];
  218. $regperiod = $params["regperiod"];
  219. # Put your code to renew domain here
  220. # If error, return the error message in the value below
  221. $values["error"] = $error;
  222. return $values;
  223. }
  224.  
  225. function template_GetContactDetails($params) {
  226. $username = $params["Username"];
  227. $password = $params["Password"];
  228. $testmode = $params["TestMode"];
  229. $tld = $params["tld"];
  230. $sld = $params["sld"];
  231. # Put your code to get WHOIS data here
  232. # Data should be returned in an array as follows
  233. $values["Registrant"]["First Name"] = $firstname;
  234. $values["Registrant"]["Last Name"] = $lastname;
  235. $values["Admin"]["First Name"] = $adminfirstname;
  236. $values["Admin"]["Last Name"] = $adminlastname;
  237. $values["Tech"]["First Name"] = $techfirstname;
  238. $values["Tech"]["Last Name"] = $techlastname;
  239. return $values;
  240. }
  241.  
  242. function template_SaveContactDetails($params) {
  243. $username = $params["Username"];
  244. $password = $params["Password"];
  245. $testmode = $params["TestMode"];
  246. $tld = $params["tld"];
  247. $sld = $params["sld"];
  248. # Data is returned as specified in the GetContactDetails() function
  249. $firstname = $params["contactdetails"]["Registrant"]["First Name"];
  250. $lastname = $params["contactdetails"]["Registrant"]["Last Name"];
  251. $adminfirstname = $params["contactdetails"]["Admin"]["First Name"];
  252. $adminlastname = $params["contactdetails"]["Admin"]["Last Name"];
  253. $techfirstname = $params["contactdetails"]["Tech"]["First Name"];
  254. $techlastname = $params["contactdetails"]["Tech"]["Last Name"];
  255. # Put your code to save new WHOIS data here
  256. # If error, return the error message in the value below
  257. $values["error"] = $error;
  258. return $values;
  259. }
  260.  
  261. function template_GetEPPCode($params) {
  262. $username = $params["Username"];
  263. $password = $params["Password"];
  264. $testmode = $params["TestMode"];
  265. $tld = $params["tld"];
  266. $sld = $params["sld"];
  267. # Put your code to request the EPP code here - if the API returns it, pass back as below - otherwise return no value and it will assume code is emailed
  268. $values["eppcode"] = $eppcode;
  269. # If error, return the error message in the value below
  270. $values["error"] = $error;
  271. return $values;
  272. }
  273.  
  274. function template_RegisterNameserver($params) {
  275. $username = $params["Username"];
  276. $password = $params["Password"];
  277. $testmode = $params["TestMode"];
  278. $tld = $params["tld"];
  279. $sld = $params["sld"];
  280. $nameserver = $params["nameserver"];
  281. $ipaddress = $params["ipaddress"];
  282. # Put your code to register the nameserver here
  283. # If error, return the error message in the value below
  284. $values["error"] = $error;
  285. return $values;
  286. }
  287.  
  288. function template_ModifyNameserver($params) {
  289. $username = $params["Username"];
  290. $password = $params["Password"];
  291. $testmode = $params["TestMode"];
  292. $tld = $params["tld"];
  293. $sld = $params["sld"];
  294. $nameserver = $params["nameserver"];
  295. $currentipaddress = $params["currentipaddress"];
  296. $newipaddress = $params["newipaddress"];
  297. # Put your code to update the nameserver here
  298. # If error, return the error message in the value below
  299. $values["error"] = $error;
  300. return $values;
  301. }
  302.  
  303. function template_DeleteNameserver($params) {
  304. $username = $params["Username"];
  305. $password = $params["Password"];
  306. $testmode = $params["TestMode"];
  307. $tld = $params["tld"];
  308. $sld = $params["sld"];
  309. $nameserver = $params["nameserver"];
  310. # Put your code to delete the nameserver here
  311. # If error, return the error message in the value below
  312. $values["error"] = $error;
  313. return $values;
  314. }
  315.  
  316. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement