Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace Registry;
- class cocca
- {
- public static $debug = null;
- public static $module = null;
- public static function build(array $registrydata)
- {
- $client = new \AfriCC\EPP\Client( array(
- 'host' => $registrydata['hostname'],
- 'port' => $registrydata['port'],
- 'username' => $registrydata['username'],
- 'password' => $registrydata['password'],
- 'services' => array(
- ($registrydata['allowhostobjects'] == 'on' ? 'urn:ietf:params:xml:ns:host-1.0' : null),
- 'urn:ietf:params:xml:ns:domain-1.0',
- 'urn:ietf:params:xml:ns:contact-1.0'
- ),
- 'serviceExtensions' => array( 'urn:ietf:params:xml:ns:rgp-1.0' ),
- 'connect_timeout' => $registrydata['timeout'],
- 'protocol' => $registrydata['protocol'],
- 'local_cert' => $registrydata['certificatepath'],
- 'passphrase' => $registrydata['certificatepassphrase']
- ) );
- self::$debug = (string) $registrydata['debug'];
- self::$module = (string) $registrydata['module'];
- return $client;
- }
- public static function createHostIfNotExists(\AfriCC\EPP\Client $client, $host, $ips = NULL)
- {
- $first = '\\AfriCC\\EPP\\Extension\\';
- $last = '\\Info\\Host';
- $nsext = $first . strtoupper( self::$module ) . $last;
- if (class_exists( $nsext )) {
- $frame = new $nsext( );
- }
- else {
- $frame = new \AfriCC\EPP\Frame\Command\Info\Host( );
- }
- $frame->setHost( $host );
- $response = $client->request( $frame );
- if (self::$debug == 'on') {
- logModuleCall( 'eppregistrar_' . self::$module, 'EPP Host Info', $frame, $response );
- }
- unset( $frame );
- if (!(($response instanceof \AfriCC\EPP\Frame\Response))) {
- throw new Exception( strtoupper( self::$module ) . '/HostInfo: unable to get response' );
- }
- if ($response->code( ) === 2303) {
- $first = '\\AfriCC\\EPP\\Extension\\';
- $last = '\\Create\\Host';
- $nsext = $first . strtoupper( self::$module ) . $last;
- if (class_exists( $nsext )) {
- $frame = new $nsext( );
- }
- else {
- $frame = new \AfriCC\EPP\Frame\Command\Create\Host( );
- }
- $frame->setHost( $host );
- if (!(empty( $ips )) && is_array( $ips )) {
- foreach ($ips as $ip) {
- $frame->addAddr( $ip );
- }
- }
- $cre_response = $client->request( $frame );
- if (self::$debug == 'on') {
- logModuleCall( 'eppregistrar_' . self::$module, 'EPP Host Create', $frame, $cre_response );
- }
- unset( $frame );
- if (!(($cre_response instanceof \AfriCC\EPP\Frame\Response))) {
- throw new Exception( strtoupper( self::$module ) . '/HostCreate: unable to get response' );
- }
- if (!($cre_response->success( ))) {
- .................................................................
- .............................
- ..........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement