Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.01 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace Registry;
  15.  
  16. class cocca
  17. {
  18. public static $debug = null;
  19. public static $module = null;
  20.  
  21. public static function build(array $registrydata)
  22. {
  23. $client = new \AfriCC\EPP\Client( array(
  24. 'host' => $registrydata['hostname'],
  25. 'port' => $registrydata['port'],
  26. 'username' => $registrydata['username'],
  27. 'password' => $registrydata['password'],
  28. 'services' => array(
  29. ($registrydata['allowhostobjects'] == 'on' ? 'urn:ietf:params:xml:ns:host-1.0' : null),
  30. 'urn:ietf:params:xml:ns:domain-1.0',
  31. 'urn:ietf:params:xml:ns:contact-1.0'
  32. ),
  33. 'serviceExtensions' => array( 'urn:ietf:params:xml:ns:rgp-1.0' ),
  34. 'connect_timeout' => $registrydata['timeout'],
  35. 'protocol' => $registrydata['protocol'],
  36. 'local_cert' => $registrydata['certificatepath'],
  37. 'passphrase' => $registrydata['certificatepassphrase']
  38. ) );
  39. self::$debug = (string) $registrydata['debug'];
  40. self::$module = (string) $registrydata['module'];
  41. return $client;
  42. }
  43.  
  44. public static function createHostIfNotExists(\AfriCC\EPP\Client $client, $host, $ips = NULL)
  45. {
  46. $first = '\\AfriCC\\EPP\\Extension\\';
  47. $last = '\\Info\\Host';
  48. $nsext = $first . strtoupper( self::$module ) . $last;
  49.  
  50. if (class_exists( $nsext )) {
  51. $frame = new $nsext( );
  52. }
  53. else {
  54. $frame = new \AfriCC\EPP\Frame\Command\Info\Host( );
  55. }
  56.  
  57. $frame->setHost( $host );
  58. $response = $client->request( $frame );
  59.  
  60. if (self::$debug == 'on') {
  61. logModuleCall( 'eppregistrar_' . self::$module, 'EPP Host Info', $frame, $response );
  62. }
  63.  
  64. unset( $frame );
  65.  
  66. if (!(($response instanceof \AfriCC\EPP\Frame\Response))) {
  67. throw new Exception( strtoupper( self::$module ) . '/HostInfo: unable to get response' );
  68. }
  69.  
  70. if ($response->code( ) === 2303) {
  71. $first = '\\AfriCC\\EPP\\Extension\\';
  72. $last = '\\Create\\Host';
  73. $nsext = $first . strtoupper( self::$module ) . $last;
  74.  
  75. if (class_exists( $nsext )) {
  76. $frame = new $nsext( );
  77. }
  78. else {
  79. $frame = new \AfriCC\EPP\Frame\Command\Create\Host( );
  80. }
  81.  
  82. $frame->setHost( $host );
  83.  
  84. if (!(empty( $ips )) && is_array( $ips )) {
  85. foreach ($ips as $ip) {
  86. $frame->addAddr( $ip );
  87. }
  88. }
  89.  
  90. $cre_response = $client->request( $frame );
  91.  
  92. if (self::$debug == 'on') {
  93. logModuleCall( 'eppregistrar_' . self::$module, 'EPP Host Create', $frame, $cre_response );
  94. }
  95.  
  96. unset( $frame );
  97.  
  98. if (!(($cre_response instanceof \AfriCC\EPP\Frame\Response))) {
  99. throw new Exception( strtoupper( self::$module ) . '/HostCreate: unable to get response' );
  100. }
  101.  
  102. if (!($cre_response->success( ))) {
  103. .................................................................
  104. .............................
  105. ..........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement