mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 12:48:08 +09:00
Delete OpenSRS and CNic Toolkit from repo (#1012)
* Delete OpenSRS from repo Seems to be unused, and it is very very old. We can re-introduce it another time if we need it * Delete CNic_Toolkit None of our source code seems to reference this at all. I'm guessing this was included incase someone wanted to create their own integration and needed it
This commit is contained in:
1 parent
8f842fb400
commit
7b52420d32
146 files changed
-13090
No files matched your search
@@ -1,885 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit - toolkit classes for PHP
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
//
|
||||
// $Id: Toolkit.php,v 1.60 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
if (!extension_loaded('curl')) trigger_error('CNic_Toolkit requires the cURL extension!', E_USER_ERROR);
|
||||
|
||||
class CNic_Toolkit {
|
||||
|
||||
/**
|
||||
* The version of this release
|
||||
* @var string
|
||||
*/
|
||||
var $VERSION = '0.0.34';
|
||||
|
||||
/**
|
||||
* The hostname of the Toolkit service
|
||||
* @var string
|
||||
*/
|
||||
var $HOSTNAME = 'toolkit.centralnic.com';
|
||||
|
||||
/**
|
||||
* where we store request parameters:
|
||||
* @var array
|
||||
*/
|
||||
private $params;
|
||||
|
||||
/**
|
||||
* constructor. the behaviour of this method is dependant on the number of arguments it is given.
|
||||
* However, the first argument is always a string containing the command to execute.
|
||||
*/
|
||||
function __construct() {
|
||||
$this->params = array('test' => '0');
|
||||
$no_args = func_num_args();
|
||||
switch ($no_args) {
|
||||
case 1:
|
||||
$this->command = func_get_arg(0);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
list($this->command, $this->params['domain']) = func_get_args();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
list($this->command, $this->params['domain'], $this->ssl) = func_get_args();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
list($this->command, $this->ssl, $this->user, $this->password) = func_get_args();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
list($this->command, $this->params['domain'], $this->ssl, $this->user, $this->password) = func_get_args();
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error('invalid number of arguments!', E_USER_ERROR);
|
||||
|
||||
}
|
||||
|
||||
$this->agent = curl_init();
|
||||
$curl_version = curl_version();
|
||||
curl_setopt($this->agent, CURLOPT_USERAGENT, sprintf(
|
||||
'CNic_Toolkit/%s (cURL %s, OpenSSL %s, PHP %s, %s %s)',
|
||||
$this->VERSION,
|
||||
$curl_version['version'],
|
||||
$curl_version['ssl_version'],
|
||||
phpversion(),
|
||||
php_uname('s'),
|
||||
php_uname('r')
|
||||
));
|
||||
|
||||
ini_set('include_path', ini_get('include_path').':'.dirname(dirname(__FILE__)));
|
||||
}
|
||||
|
||||
/**
|
||||
* set a query parameter
|
||||
* @param string $name
|
||||
* @param mixed $value
|
||||
*/
|
||||
function set($name, $value) {
|
||||
$this->params[$name] = $value;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* prepare the query, execute it and return the response
|
||||
* @return CNic_Toolkit_Response
|
||||
*/
|
||||
function execute() {
|
||||
require_once('CNic/Toolkit/Response.php');
|
||||
curl_setopt($this->agent, CURLOPT_TIMEOUT, (isset($this->params['timeout']) && $this->params['timeout'] > 0 ? $this->params['timeout'] : 10));
|
||||
switch ($this->command) {
|
||||
case 'suffixes':
|
||||
return $this->_suffixes();
|
||||
|
||||
case 'search':
|
||||
return $this->_search();
|
||||
|
||||
case 'whois':
|
||||
return $this->_whois();
|
||||
|
||||
case 'create_handle':
|
||||
return $this->_create_handle();
|
||||
|
||||
case 'handle_info':
|
||||
return $this->_handle_info();
|
||||
|
||||
case 'register':
|
||||
return $this->_register(0);
|
||||
|
||||
case 'register_idn':
|
||||
return $this->_register(1);
|
||||
|
||||
case 'modify':
|
||||
return $this->_modify();
|
||||
|
||||
case 'modify_handle':
|
||||
return $this->_modify_handle();
|
||||
|
||||
case 'renewals':
|
||||
return $this->_renewals();
|
||||
|
||||
case 'list_domains':
|
||||
return $this->_list_domains();
|
||||
|
||||
case 'issue_renewals':
|
||||
return $this->_issue_renewals();
|
||||
|
||||
case 'pricing':
|
||||
return $this->_get_pricing();
|
||||
|
||||
case 'delete':
|
||||
return $this->_delete_domain();
|
||||
|
||||
case 'decline':
|
||||
return $this->_decline_domain();
|
||||
|
||||
case 'undecline':
|
||||
return $this->_undecline_domain();
|
||||
|
||||
case 'start_transfer':
|
||||
return $this->_start_transfer();
|
||||
|
||||
case 'cancel_transfer':
|
||||
return $this->_cancel_transfer();
|
||||
|
||||
case 'check_transfer':
|
||||
return $this->_check_transfer();
|
||||
|
||||
case 'reactivate':
|
||||
return $this->_reactivate_request();
|
||||
|
||||
case 'push_domain':
|
||||
return $this->_push_domain();
|
||||
|
||||
case 'auth_info':
|
||||
return $this->_auth_info();
|
||||
|
||||
case 'poll_transfers':
|
||||
return $this->_poll_transfers();
|
||||
|
||||
case 'approve_transfer':
|
||||
return $this->_approve_transfer();
|
||||
|
||||
case 'reject_transfer':
|
||||
return $this->_reject_transfer();
|
||||
|
||||
case 'list_outstanding_domains':
|
||||
return $this->_list_outstanding_domains();
|
||||
|
||||
case 'submit_payment_batch':
|
||||
return $this->_submit_payment_batch();
|
||||
|
||||
case 'registrant_transfer':
|
||||
return $this->_registrant_transfer();
|
||||
|
||||
case 'lock_domain':
|
||||
return $this->_lock_domain();
|
||||
|
||||
case 'unlock_domain':
|
||||
return $this->_unlock_domain();
|
||||
|
||||
case 'validate_domain':
|
||||
return $this->_validate_domain();
|
||||
|
||||
default:
|
||||
trigger_error('Invalid command', E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _suffixes() {
|
||||
require_once('CNic/Toolkit/Response/Suffixes.php');
|
||||
$url = $this->_base().'suffixes?test='.$this->params['test'];
|
||||
$this->_raw_data = $this->_request($url);
|
||||
return new CNic_Toolkit_Response_Suffixes($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _search() {
|
||||
require_once('CNic/Toolkit/Response/Search.php');
|
||||
$url = $this->_base().'search';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
if (isset($this->params['suffixlist'])) $params['suffixlist'] = implode(',', $this->params['suffixlist']);
|
||||
$this->_raw_data = $this->_request($url, $params);
|
||||
return new CNic_Toolkit_Response_Search($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _whois() {
|
||||
require_once('CNic/Toolkit/Response/Whois.php');
|
||||
$url = $this->_base().'wwwhois';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, $params);
|
||||
return new CNic_Toolkit_Response_Whois($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _create_handle() {
|
||||
require_once('CNic/Toolkit/Response/CreateHandle.php');
|
||||
$url = $this->_base().'create_handle';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'visible' => ($this->params['visible'] === 0 ? 0 : 1),
|
||||
);
|
||||
if (!empty($this->params['handle']['street1'])) {
|
||||
$params['name'] = $this->params['handle']['name'];
|
||||
$params['company'] = $this->params['handle']['company'];
|
||||
$params['street1'] = $this->params['handle']['street1'];
|
||||
$params['street2'] = $this->params['handle']['street2'];
|
||||
$params['street3'] = $this->params['handle']['street3'];
|
||||
$params['city'] = $this->params['handle']['city'];
|
||||
$params['sp'] = $this->params['handle']['sp'];
|
||||
$params['postcode'] = $this->params['handle']['postcode'];
|
||||
$params['country'] = $this->params['handle']['country'];
|
||||
$params['phone'] = $this->params['handle']['phone'];
|
||||
$params['fax'] = $this->params['handle']['fax'];
|
||||
$params['email'] = $this->params['handle']['email'];
|
||||
|
||||
} else {
|
||||
$params['handle'] = $this->_format_handle_string($this->params['handle']);
|
||||
|
||||
}
|
||||
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_CreateHandle($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _handle_info() {
|
||||
require_once('CNic/Toolkit/Response/HandleInfo.php');
|
||||
$url = $this->_base().'handle_info';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'handle' => $this->params['handle'],
|
||||
'test' => $this->params['test'],
|
||||
'visible' => ($this->params['visible'] === 0 ? 0 : 1),
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_HandleInfo($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _register($idn) {
|
||||
require_once('CNic/Toolkit/Response/Register.php');
|
||||
$url = $this->_base().'register';
|
||||
if (!isset($this->params['suffix'])) list($this->params['domain'], $this->params['suffix']) = explode('.', $this->params['domain'], 2);
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'suffix' => $this->params['suffix'],
|
||||
'registrant' => $this->params['registrant'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'chandle' => $this->_format_handle_string($this->params['chandle']),
|
||||
'thandle' => $this->_format_handle_string($this->params['thandle']),
|
||||
'period' => $this->params['period'],
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
if (isset($this->params['ahandle'])) $params['ahandle'] = $this->params['ahandle'];
|
||||
if (isset($this->params['bhandle'])) $params['bhandle'] = $this->params['bhandle'];
|
||||
if (isset($this->params['url'])) $params['url'] = $this->params['url'];
|
||||
if (isset($this->params['dns'])) $params = array_merge($params, $this->_dns_register_params($this->params['dns']));
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_Register($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _modify() {
|
||||
require_once('CNic/Toolkit/Response/Modify.php');
|
||||
$url = $this->_base().'modify';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
if (isset($this->params['thandle'])) $params['thandle'] = $this->_format_handle_string($this->params['thandle']);
|
||||
if (isset($this->params['chandle'])) $params['chandle'] = $this->_format_handle_string($this->params['chandle']);
|
||||
if (isset($this->params['ahandle'])) $params['url'] = $this->params['ahandle'];
|
||||
if (isset($this->params['bhandle'])) $params['url'] = $this->params['bhandle'];
|
||||
if (isset($this->params['ttl'])) $params['ttl'] = $this->_params['ttl'];
|
||||
if (isset($this->params['dns'])) $params = array_merge($params, $this->_dns_mod_params($this->params['dns']));
|
||||
if (isset($this->params['url'])) $params['url'] = $this->params['url'];
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_Modify($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _modify_handle() {
|
||||
require_once('CNic/Toolkit/Response/ModifyHandle.php');
|
||||
$url = $this->_base().'modify_handle';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
foreach ($this->params as $name => $value) $params[$name] = $value;
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_ModifyHandle($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _renewals() {
|
||||
require_once('CNic/Toolkit/Response/Renewals.php');
|
||||
$url = $this->_base().'upcoming_renewals';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'months' => $this->params['months'],
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'GET', $params);
|
||||
return new CNic_Toolkit_Response_Renewals($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _list_domains() {
|
||||
require_once('CNic/Toolkit/Response/DomainList.php');
|
||||
$url = $this->_base().'list_domains';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'offset' => $this->params['offset'],
|
||||
'length' => $this->params['length'],
|
||||
'orderby' => $this->params['orderby'],
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_DomainList($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _issue_renewals() {
|
||||
require_once('CNic/Toolkit/Response/IssueRenewals.php');
|
||||
$url = $this->_base().'issue_renewals';
|
||||
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password)
|
||||
);
|
||||
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
//'immediate' => $this->params['immediate'],
|
||||
'period' => $this->params['period'],
|
||||
);
|
||||
for ($i = 0 ; $i < count($this->params['domains']) ; $i++) $params["domains[$i]"] = $this->params['domains'][$i];
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_IssueRenewals($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _get_pricing() {
|
||||
require_once('CNic/Toolkit/Response/GetPricing.php');
|
||||
$url = $this->_base().'get_pricing';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'type' => $this->params['type']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_GetPricing($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _delete_domain() {
|
||||
require_once('CNic/Toolkit/Response/DeleteDomain.php');
|
||||
$url = $this->_base().'delete_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'reason' => $this->params['reason'],
|
||||
'immediate' => $this->params['immediate'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_DeleteDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _decline_domain() {
|
||||
require_once('CNic/Toolkit/Response/DeclineDomain.php');
|
||||
$url = $this->_base().'decline_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_DeclineDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _undecline_domain() {
|
||||
require_once('CNic/Toolkit/Response/UnDeclineDomain.php');
|
||||
$url = $this->_base().'undecline_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_UnDeclineDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _start_transfer() {
|
||||
require_once('CNic/Toolkit/Response/StartTransfer.php');
|
||||
$url = $this->_base().'start_transfer';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
);
|
||||
for ($i = 0 ; $i < count($this->params['domains']) ; $i++) $params["domains[$i]"] = $this->params['domains'][$i];
|
||||
//for ($i = 0 ; $i < count($this->params['authinfo']) ; $i++) $params["authinfo[$i]"] = $this->params['authinfo'][$i];
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_StartTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _cancel_transfer() {
|
||||
require_once('CNic/Toolkit/Response/CancelTransfer.php');
|
||||
$url = $this->_base().'cancel_transfer';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_CancelTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _check_transfer() {
|
||||
require_once('CNic/Toolkit/Response/CheckTransfer.php');
|
||||
$url = $this->_base().'check_transfer';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_CheckTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _reactivate_request() {
|
||||
require_once('CNic/Toolkit/Response/ReactivateDomain.php');
|
||||
$url = $this->_base().'reactivation_request';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'email' => $this->params['email'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_ReactivateDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _push_domain() {
|
||||
require_once('CNic/Toolkit/Response/PushDomain.php');
|
||||
$url = $this->_base().'push_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'handle' => $this->params['handle'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_PushDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _auth_info() {
|
||||
require_once('CNic/Toolkit/Response/AuthInfo.php');
|
||||
$url = $this->_base().'auth_info';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_AuthInfo($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _poll_transfers() {
|
||||
require_once('CNic/Toolkit/Response/PollTransfers.php');
|
||||
$url = $this->_base().'poll_transfers';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_PollTransfers($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _approve_transfer() {
|
||||
require_once('CNic/Toolkit/Response/ApproveTransfer.php');
|
||||
$url = $this->_base().'approve_transfer';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_ApproveTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _reject_transfer() {
|
||||
require_once('CNic/Toolkit/Response/RejectTransfer.php');
|
||||
$url = $this->_base().'reject_transfer';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_RejectTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _list_outstanding_domains() {
|
||||
require_once('CNic/Toolkit/Response/ListOutstandingDomains.php');
|
||||
$url = $this->_base().'list_outstanding_domains';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_ListOutstandingDomains($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _submit_payment_batch() {
|
||||
require_once('CNic/Toolkit/Response/SubmitPaymentBatch.php');
|
||||
$url = $this->_base().'submit_payment_batch';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'method' => $this->params['method'],
|
||||
);
|
||||
$i = 0;
|
||||
for ($i = 0 ; $i < count($this->params['domains']) ; $i++) $params["domains[$i]"] = $this->params['domains'][$i];
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_SubmitPaymentBatch($this->_raw_data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _registrant_transfer() {
|
||||
require_once('CNic/Toolkit/Response/RegistrantTransfer.php');
|
||||
$url = $this->_base().'registrant_transfer';
|
||||
$params = array(
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test'],
|
||||
'domain' => $this->params['domain'],
|
||||
'registrant' => $this->params['registrant']
|
||||
);
|
||||
foreach ($this->params as $name => $value) $params[$name] = $value;
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_RegistrantTransfer($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _lock_domain() {
|
||||
require_once('CNic/Toolkit/Response/LockDomain.php');
|
||||
$url = $this->_base().'lock_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_LockDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _unlock_domain() {
|
||||
require_once('CNic/Toolkit/Response/UnlockDomain.php');
|
||||
$url = $this->_base().'unlock_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_UnlockDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _validate_domain() {
|
||||
require_once('CNic/Toolkit/Response/ValidateDomain.php');
|
||||
$url = $this->_base().'validate_domain';
|
||||
$params = array(
|
||||
'domain' => $this->params['domain'],
|
||||
'user' => $this->user,
|
||||
'password' => $this->_crypt_md5($this->password),
|
||||
'test' => $this->params['test']
|
||||
);
|
||||
$this->_raw_data = $this->_request($url, 'POST', $params);
|
||||
return new CNic_Toolkit_Response_ValidateDomain($this->_raw_data);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************************************************/
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _request() {
|
||||
$no_args = func_num_args();
|
||||
switch ($no_args) {
|
||||
case 1:
|
||||
$url = func_get_arg(0);
|
||||
$method = 'GET';
|
||||
$params = array();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
list($url, $params) = func_get_args();
|
||||
$method = 'GET';
|
||||
break;
|
||||
|
||||
case 3:
|
||||
list($url, $method, $params) = func_get_args();
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error('invalid number of arguments to CNic_Toolkit::_get()', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if ($method == 'POST') curl_setopt($this->agent, CURLOPT_POST, 1);
|
||||
// this makes curl return the content when curl_exec() is done:
|
||||
curl_setopt($this->agent, CURLOPT_RETURNTRANSFER, 1);
|
||||
|
||||
$post_vars = array();
|
||||
if (count($params) > 0) {
|
||||
foreach ($params as $name => $value) {
|
||||
if (in_array(gettype($value), array('array', 'object', 'resource'))) trigger_error(sprintf("cannot use value of type %s as value for '%s', must be a string", gettype($value), $name), E_USER_ERROR);
|
||||
$post_vars[] = sprintf('%s=%s', urlencode(strtolower($name)), urlencode($value));
|
||||
}
|
||||
}
|
||||
|
||||
if ($method == 'POST' && count($params) > 0) {
|
||||
curl_setopt($this->agent, CURLOPT_POSTFIELDS, implode('&', $post_vars));
|
||||
|
||||
} elseif (count($params) > 0) {
|
||||
$url .= '?'.implode('&', $post_vars);
|
||||
|
||||
}
|
||||
|
||||
curl_setopt($this->agent, CURLOPT_URL, $url);
|
||||
$response = stripslashes(curl_exec($this->agent));
|
||||
if (empty($response)) {
|
||||
return sprintf("Status: 1\nMessage: %s (CURL error %d)\n",
|
||||
curl_error($this->agent),
|
||||
curl_errno($this->agent)
|
||||
);
|
||||
|
||||
} else {
|
||||
return $response;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _format_handle_string($handle) {
|
||||
if (is_string($handle)) {
|
||||
return $handle;
|
||||
|
||||
} elseif (!is_array($handle)) {
|
||||
trigger_error('invalid variable type passed to CNic_Toolkit::_format_handle_string()', E_USER_ERROR);
|
||||
|
||||
} else {
|
||||
return 'new::' . implode('::', array_values($handle));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _dns_register_params($dns) {
|
||||
if (!is_array($dns)) {
|
||||
trigger_error('invalid variable type passed to CNic_Toolkit::_dns_register_params()', E_USER_ERROR);
|
||||
|
||||
} else {
|
||||
$array = array();
|
||||
$i = 0;
|
||||
foreach ($dns as $key => $value) {
|
||||
$array["dns[$i]"] = (is_int($key) ? $value : sprintf('%s::%s', $key, $value));
|
||||
$i++;
|
||||
}
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _dns_mod_params($dns) {
|
||||
if (!is_array($dns)) {
|
||||
trigger_error('invalid variable type passed to CNic_Toolkit::_dns_mod_params()', E_USER_ERROR);
|
||||
|
||||
} else {
|
||||
$array = array();
|
||||
$i = 0;
|
||||
if (@count($dns['add']) > 0) {
|
||||
foreach ($dns['add'] as $server) {
|
||||
if (@count($server) == 2) {
|
||||
$array["dns[$i]"] = sprintf('add:%s:%s', $server[0], $server[1]);
|
||||
$i++;
|
||||
|
||||
} elseif (!empty($server)) {
|
||||
$array["dns[$i]"] = 'add:'.$server;
|
||||
$i++;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($dns['drop'] == 'all') {
|
||||
$array["dns[$i]"] = 'drop:all';
|
||||
$i++;
|
||||
|
||||
} elseif (@count($dns['drop']) > 0) {
|
||||
foreach ($dns['drop'] as $server) {
|
||||
$array["dns[$i]"] = 'drop:'.$server;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @access private
|
||||
*/
|
||||
private function _base()
|
||||
{
|
||||
if(in_array($this->command, array('whois', 'search', 'suffixes')))
|
||||
{
|
||||
return 'http://' . $this->HOSTNAME.'/srv/';
|
||||
}
|
||||
else
|
||||
{
|
||||
return 'https://' . $this->HOSTNAME.'/srv/';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* this function forces the creation of an MD5-crypted hash.
|
||||
* This is because MD5 has better support than other
|
||||
* ciphers on different platforms, so we know that
|
||||
* password hashes will use a cipher the server can understand
|
||||
* @access private
|
||||
*/
|
||||
private function _crypt_md5($str) {
|
||||
$salt = '$1$' . substr(md5(uniqid(rand(), 1)), 0, 8) . '$';
|
||||
$crypted = crypt($str, $salt);
|
||||
return $crypted;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response - base class for response objects
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Response.php,v 1.9 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response {
|
||||
|
||||
var $_response = array();
|
||||
|
||||
function CNic_Toolkit_Response($raw_data) {
|
||||
$this->_raw = $raw_data;
|
||||
$lines = explode("\n", trim($raw_data));
|
||||
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line);
|
||||
if (preg_match('/:\s?/', $line))
|
||||
list($name, $value) = preg_split('/:\s?/', $line, 2);
|
||||
else
|
||||
$name = $value = $line;
|
||||
if (preg_match('/(::|=)/', $value)) {
|
||||
if (preg_match('/=/', $value)) {
|
||||
$pairs = explode('::', $value);
|
||||
foreach ($pairs as $pair) {
|
||||
list($n, $v) = explode('=', $pair, 2);
|
||||
$v = preg_replace('/^\"?/', '', $v);
|
||||
$v = preg_replace('/\"?$/', '', $v);
|
||||
$values[$n] = $v;
|
||||
}
|
||||
$this->_response[strtolower($name)][] = $values;
|
||||
} else {
|
||||
$this->_response[strtolower($name)][] = explode('::', $value);
|
||||
}
|
||||
} else {
|
||||
$this->_response[strtolower($name)][] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function is_success() {
|
||||
return ((isset($this->_response['query-status'][0]) ? $this->_response['query-status'][0] : $this->_response['status'][0]) == 0 ? true : false);
|
||||
}
|
||||
|
||||
function is_error() {
|
||||
return ($this->is_success() ? false : true);
|
||||
}
|
||||
|
||||
function error() {
|
||||
return $this->response('message');
|
||||
}
|
||||
|
||||
function keys() {
|
||||
return array_keys($this->_response);
|
||||
}
|
||||
|
||||
function response($key) {
|
||||
return $this->_expand($this->_response[$key]);
|
||||
}
|
||||
|
||||
function _expand($struct) {
|
||||
if (is_string($struct)) {
|
||||
return $struct;
|
||||
} elseif (is_array($struct)) {
|
||||
if (count($struct) == 1 && $this->is_assoc($struct)) {
|
||||
return $this->_expand($struct[0]);
|
||||
} else {
|
||||
return $struct;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// sort of a kludge to work out whether an array is associative or not
|
||||
// (since "indexed" arrays in PHP are just associative arrays with ordered
|
||||
// numerical keys). Walk through the keys in order and see if they're all
|
||||
// numerical and sequential. This is what you get for not using XML :p
|
||||
function is_assoc($array) {
|
||||
$keys = array_keys($array);
|
||||
for ($i = 0 ; $i < count($keys) ; $i++) {
|
||||
if ($keys[$i] !== $i) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_ApproveTransfer - response object for approving domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: ApproveTransfer.php,v 1.3 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_ApproveTransfer extends CNic_Toolkit_Response {
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_AuthInfo - response object for transfer codes
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: AuthInfo.php,v 1.3 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_AuthInfo extends CNic_Toolkit_Response {
|
||||
|
||||
function auth_code() {
|
||||
return $this->response('authcode');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_CancelTransfer - response object for cancelling domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: CancelTransfer.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_CancelTransfer extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_CheckTransfer - response object for checking the status of domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: CheckTransfer.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_CheckTransfer extends CNic_Toolkit_Response {
|
||||
|
||||
function status() {
|
||||
return $this->response('transfer-status');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_CreateHandle - response object for creating handles
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: CreateHandle.php,v 1.7 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_CreateHandle extends CNic_Toolkit_Response {
|
||||
|
||||
function handle() {
|
||||
return $this->response('handle');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_DeclineDomain - response object for declining renewals
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: DeclineDomain.php,v 1.7 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_DeclineDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_DeleteDomain - response object for deletion requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: DeleteDomain.php,v 1.7 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_DeleteDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_DomainList - response object for domain lists
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: DomainList.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_DomainList extends CNic_Toolkit_Response {
|
||||
|
||||
function domains() {
|
||||
return preg_grep('/\..{3}$/i', $this->keys());
|
||||
}
|
||||
|
||||
function regdate($domain) {
|
||||
list($status, $regdate, $expirydate) = $this->response($domain);
|
||||
return $regdate;
|
||||
}
|
||||
|
||||
function expirydate($domain) {
|
||||
list($status, $regdate, $expirydate) = $this->response($domain);
|
||||
return $expirydate;
|
||||
}
|
||||
|
||||
function status($domain) {
|
||||
list($status, $regdate, $expirydate) = $this->response($domain);
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_GetPricing - response object for pricing information
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: GetPricing.php,v 1.7 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_GetPricing extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_ModifyHandle - response object for handle information
|
||||
// requests.
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: HandleInfo.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_HandleInfo extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Whois - response object for whois requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: IssueRenewals.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_IssueRenewals extends CNic_Toolkit_Response {
|
||||
|
||||
function invoice() {
|
||||
return $this->response('invoice');
|
||||
}
|
||||
|
||||
function proforma() {
|
||||
return $this->response('proforma');
|
||||
}
|
||||
|
||||
function amount() {
|
||||
return $this->response('amount');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_ListOutstandingDomains - response object listing outstanding domains
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: ListOutstandingDomains.php,v 1.4 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_ListOutstandingDomains extends CNic_Toolkit_Response {
|
||||
|
||||
function domains() {
|
||||
$domains = array();
|
||||
foreach ($this->keys() as $domain) {
|
||||
$info = $this->response($domain);
|
||||
if (is_array($info)) {
|
||||
$info['domain'] = $domain;
|
||||
$domains[] = $info;
|
||||
}
|
||||
}
|
||||
return $domains;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
// CNic_Toolkit_Response_LockDomain - response object for locking domains
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: LockDomain.php,v 1.2 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_LockDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Modify - response object for modification requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Modify.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Modify extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_ModifyHandle - response object for handle modification
|
||||
// requests.
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: ModifyHandle.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_ModifyHandle extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,23 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_PollTransfers - response object for polling domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: PollTransfers.php,v 1.4 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_PollTransfers extends CNic_Toolkit_Response {
|
||||
|
||||
function transfers() {
|
||||
$transfers = array();
|
||||
foreach (preg_grep('/^domain=/', $this->keys()) as $key) {
|
||||
$info = $this->response($key);
|
||||
$info['domain'] = preg_replace('/^domain=/', '', $key);
|
||||
$info['type'] = $info[':type'];
|
||||
unset($info[':type']);
|
||||
$transfers[] = $info;
|
||||
}
|
||||
return $transfers;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_PushDomain - response object for domain push requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: PushDomain.php,v 1.4 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_PushDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_ReactivateDomain - response object for domain reactivation requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: ReactivateDomain.php,v 1.4 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_ReactivateDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,16 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Register - response object for registrations
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Register.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Register extends CNic_Toolkit_Response {
|
||||
|
||||
function amount() {
|
||||
return $this->response('amount');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_RegistrantTransfer - response object for transfering domain registrants
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id:
|
||||
|
||||
class CNic_Toolkit_Response_RegistrantTransfer extends CNic_Toolkit_Response {
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_RejectTransfer - response object for rejecting domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: RejectTransfer.php,v 1.3 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_RejectTransfer extends CNic_Toolkit_Response {
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Renewals - response object for renewals list
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Renewals.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Renewals extends CNic_Toolkit_Response {
|
||||
|
||||
function domains() {
|
||||
return $this->keys();
|
||||
}
|
||||
|
||||
function amount($domain) {
|
||||
list($amount, $expiry) = $this->response($domain);
|
||||
return $amount;
|
||||
}
|
||||
|
||||
function expiry($domain) {
|
||||
list($amount, $expiry) = $this->response($domain);
|
||||
return $expiry;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,42 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Search - response object for searches
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Search.php,v 1.9 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Search extends CNic_Toolkit_Response {
|
||||
|
||||
function is_registered($suffix) {
|
||||
foreach ($this->keys() as $key) {
|
||||
if (preg_match("/$suffix$/i", $key)) {
|
||||
$data = $this->response($key);
|
||||
return ($data[0] == 1 ? true : false);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function registrant($suffix) {
|
||||
foreach ($this->keys() as $key) {
|
||||
if (preg_match("/$suffix$/i", $key)) {
|
||||
$data = $this->response($key);
|
||||
return $data[1];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function expiry($suffix) {
|
||||
foreach ($this->keys() as $key) {
|
||||
if (preg_match("/$suffix$/i", $key)) {
|
||||
$data = $this->response($key);
|
||||
return $data[2];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_StartTransfer - response object for starting domain transfers
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: StartTransfer.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_StartTransfer extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,10 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_SubmitPaymentBatch - response object for submitting payment advice
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: SubmitPaymentBatch.php,v 1.3 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_SubmitPaymentBatch extends CNic_Toolkit_Response {
|
||||
}
|
||||
?>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Suffixes - response object for suffixes
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Suffixes.php,v 1.8 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Suffixes extends CNic_Toolkit_Response {
|
||||
|
||||
function suffixes() {
|
||||
$suffixes = $this->keys();
|
||||
unset($suffixes[0]);
|
||||
unset($suffixes[1]);
|
||||
sort($suffixes, SORT_STRING);
|
||||
return $suffixes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_DeclineDomain - response object for reversing declined renewals
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: UnDeclineDomain.php,v 1.5 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_UnDeclineDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
|
||||
// CNic_Toolkit_Response_UnlockDomain - response object for unlocking domains
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: UnlockDomain.php,v 1.2 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_UnlockDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_StartTransfer - response object for validating domain names
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: ValidateDomain.php,v 1.1 2011/05/13 13:22:44 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_ValidateDomain extends CNic_Toolkit_Response {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
// CNic_Toolkit_Response_Whois - response object for whois requests
|
||||
// Copyright (c) 2011 CentralNic Ltd. All rights reserved. This program is
|
||||
// free software; you can redistribute it and/or modify it under the terms
|
||||
// of the GNU GPL
|
||||
// $Id: Whois.php,v 1.10 2011/05/13 13:21:26 gavin Exp $
|
||||
|
||||
class CNic_Toolkit_Response_Whois extends CNic_Toolkit_Response {
|
||||
|
||||
function response($key) {
|
||||
// hack, cos we want an array of arrays, so don't flatten:
|
||||
if (strtolower($key) == 'dns') {
|
||||
return $this->_response['dns'];
|
||||
} else {
|
||||
return $this->_expand($this->_response[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
class class_xml {
|
||||
public function __construct () {}
|
||||
public function __destruct() {}
|
||||
|
||||
public function xml2array($fileLocation){
|
||||
$xml_values = array();
|
||||
if (!file_exists($fileLocation)){
|
||||
trigger_error("oSRS Error - Unable to find config file, please make sure paths and active config file name are correct in openSRS_config.php.");
|
||||
$result = false;
|
||||
}
|
||||
else{
|
||||
$contents = file_get_contents($fileLocation);
|
||||
|
||||
$parser = xml_parser_create('');
|
||||
if(!$parser) return false;
|
||||
|
||||
xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
|
||||
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
|
||||
xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
|
||||
xml_parse_into_struct($parser, trim($contents), $xml_values);
|
||||
xml_parser_free($parser);
|
||||
if (!$xml_values) return array();
|
||||
|
||||
$xml_array = array();
|
||||
$last_tag_ar =& $xml_array;
|
||||
$parents = array();
|
||||
$last_counter_in_tag = array(1=>0);
|
||||
foreach ($xml_values as $data) {
|
||||
switch($data['type']) {
|
||||
case 'open':
|
||||
$last_counter_in_tag[$data['level']+1] = 0;
|
||||
$new_tag = array('name' => $data['tag']);
|
||||
|
||||
if(isset($data['attributes'])) $new_tag['attributes'] = $data['attributes'];
|
||||
if(isset($data['value']) && trim($data['value'])) $new_tag['value'] = trim($data['value']);
|
||||
|
||||
$last_tag_ar[$last_counter_in_tag[$data['level']]] = $new_tag;
|
||||
$parents[$data['level']] =& $last_tag_ar;
|
||||
$last_tag_ar =& $last_tag_ar[$last_counter_in_tag[$data['level']]++];
|
||||
break;
|
||||
|
||||
case 'complete':
|
||||
$new_tag = array('name' => $data['tag']);
|
||||
|
||||
if(isset($data['attributes'])) $new_tag['attributes'] = $data['attributes'];
|
||||
if(isset($data['value']) && trim($data['value'])) $new_tag['value'] = trim($data['value']);
|
||||
|
||||
$last_count = count($last_tag_ar)-1;
|
||||
$last_tag_ar[$last_counter_in_tag[$data['level']]++] = $new_tag;
|
||||
break;
|
||||
|
||||
case 'close':
|
||||
$last_tag_ar =& $parents[$data['level']];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
};
|
||||
}
|
||||
$result = $xml_array;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getValueByPath($xml_array, $tagPath) {
|
||||
$tmp_arr =& $xml_array;
|
||||
$tag_path = explode('/', $tagPath);
|
||||
|
||||
foreach($tag_path as $tag_name) {
|
||||
$res = false;
|
||||
foreach($tmp_arr as $key => $node) {
|
||||
if(is_int($key) && $node['name'] == $tag_name) {
|
||||
$tmp_arr = $node;
|
||||
$res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!$res) return false;
|
||||
}
|
||||
|
||||
return $tmp_arr;
|
||||
}
|
||||
|
||||
public function renameFile ($path, $input) {
|
||||
$result = rename ($path . $input .".xml", $path . $input .".txt");
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// $arr = xml2array('test.xml');
|
||||
// print_r(getValueByPath($arr, 'tag/sub_tag/sub_sub_tag'));
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
<file>example_user.xml</file>
|
||||
</config>
|
||||
@@ -1,26 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<config>
|
||||
<osrsRegular>
|
||||
<osrs_username>test</osrs_username>
|
||||
<osrs_key>3b6a2dd0ca99387940bb56fba15bfe8e5ac927201eac9772d7617d362c4986d78a7910b91c631abc293caf43f0dec81894901404bf4e9804</osrs_key>
|
||||
<osrs_environment>TEST</osrs_environment>
|
||||
<osrs_protocol>XCP</osrs_protocol>
|
||||
<osrs_host>horizon.opensrs.net</osrs_host>
|
||||
<osrs_port>55000</osrs_port>
|
||||
<osrs_sslPort>55443</osrs_sslPort>
|
||||
<osrs_baseClassVersion>2.8.0</osrs_baseClassVersion>
|
||||
<osrs_version>XML:0.1</osrs_version>
|
||||
</osrsRegular>
|
||||
<osrsFastLookup>
|
||||
<osrs_host>horizon.opensrs.net</osrs_host>
|
||||
<osrs_port>51000</osrs_port>
|
||||
</osrsFastLookup>
|
||||
<osrsEMail>
|
||||
<osrs_host>ssl://admin.test.hostedemail.com</osrs_host>
|
||||
<osrs_port>4449</osrs_port>
|
||||
<osrs_username>mail_user</osrs_username>
|
||||
<osrs_password>mail_password</osrs_password>
|
||||
<osrs_domain>mail_domain</osrs_domain>
|
||||
<osrs_portwait>10</osrs_portwait>
|
||||
</osrsEMail>
|
||||
</config>
|
||||
-72
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authAuthenticateUser extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->username)) {
|
||||
trigger_error ("oSRS Error - Username string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->password)) {
|
||||
trigger_error ("oSRS Error - Password string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "AUTHENTICATE",
|
||||
"object" => "USER",
|
||||
"attributes" => array (
|
||||
"crypt_type" => $this->crypt_type,
|
||||
"username" => $this->_dataObject->data->username,
|
||||
"password" => $this->_dataObject->data->password
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authChangeOwnership extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->cookie)) {
|
||||
trigger_error ("oSRS Error - Cookie string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->username)) {
|
||||
trigger_error ("oSRS Error - Username string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->password)) {
|
||||
trigger_error ("oSRS Error - Password string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "CHANGE",
|
||||
"object" => "OWNERSHIP",
|
||||
"cookie" => $this->_dataObject->data->cookie,
|
||||
// "registrant_ip" => "12.34.56.78",
|
||||
"attributes" => array (
|
||||
"username" => $this->_dataObject->data->username,
|
||||
"password" => $this->_dataObject->data->password
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->move_all) && $this->_dataObject->data->move_all != "") $cmd['attributes']['move_all'] = $this->_dataObject->data->move_all;
|
||||
if (isSet($this->_dataObject->data->reg_domain) && $this->_dataObject->data->reg_domain != "") $cmd['attributes']['reg_domain'] = $this->_dataObject->data->reg_domain;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authChangePassword extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// if (!isSet($this->_dataObject->data->cookie)) {
|
||||
// trigger_error ("oSRS Error - Cookie string is not defined.", E_USER_WARNING);
|
||||
// $allPassed = false;
|
||||
// }
|
||||
|
||||
if (!isSet($this->_dataObject->data->reg_password)) {
|
||||
trigger_error ("oSRS Error - New Password is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "CHANGE",
|
||||
"object" => "PASSWORD",
|
||||
// "registrant_ip" => "12.34.56.78",
|
||||
"attributes" => array (
|
||||
"reg_password" => $this->_dataObject->data->reg_password
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "") $cmd['domain'] = $this->_dataObject->data->domain;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authCheckVersion extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "CHECK",
|
||||
"object" => "VERSION",
|
||||
"attributes" => array (
|
||||
"sender" => "OpenSRS SERVER",
|
||||
"version" => "2.32",
|
||||
"state" => "ready"
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authSendAuthcode extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain_name)) {
|
||||
trigger_error ("oSRS Error - Domain name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "SEND_AUTHCODE",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
"domain_name" => $this->_dataObject->data->domain_name
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class authSendPassword extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain_name)) {
|
||||
trigger_error ("oSRS Error - Domain name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "SEND_PASSWORD",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
"domain_name" => $this->_dataObject->data->domain_name,
|
||||
"send_to" => $this->_dataObject->data->send_to,
|
||||
"sub_user" => $this->_dataObject->data->sub_user
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,373 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class bulkChange extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->change_items) || $this->_dataObject->data->change_items == "") {
|
||||
trigger_error ("oSRS Error - change_items is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->change_type) || $this->_dataObject->data->change_type == "") {
|
||||
trigger_error ("oSRS Error - change_type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}else{
|
||||
|
||||
switch($this->_dataObject->data->change_type){
|
||||
case "availability_check":
|
||||
break;
|
||||
case "domain_renew":
|
||||
if(!$this->_allDomainRenewCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "push_domains":
|
||||
if(!$this->_allPushDomainsCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "dns_zone":
|
||||
if(!$this->_allDnsZoneCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "dns_zone_record":
|
||||
if(!$this->_allDnsZoneRecordCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_contacts":
|
||||
if(!$this->_allDomainContactsCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_forwarding":
|
||||
if(!$this->_allDomainForwardingCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_lock":
|
||||
if(!$this->_allDomainLockCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_parked_pages":
|
||||
if(!$this->_allDomainParkedPagesCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_nameservers":
|
||||
if(!$this->_allDomainNameserversCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "whois_privacy":
|
||||
if(!$this->_allWhoisPrivacyCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
default:
|
||||
trigger_error ("oSRS Error - Unknown change type.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
private function _allDomainRenewCheck(){
|
||||
$allDomainRenewPassed=true;
|
||||
|
||||
if(!isSet($this->_dataObject->data->period) && $this->_dataObject->data->period == "" &&
|
||||
!isSet($this->_dataObject->data->let_expire) && $this->_dataObject->data->let_expire == "" &&
|
||||
!isSet($this->_dataObject->data->auto_renew) && $this->_dataObject->data->auto_renew == "" ) {
|
||||
|
||||
trigger_error ("oSRS Error - change type is domain_renew but at least one of period, let_expire or auto_renew has to be defined.", E_USER_WARNING);
|
||||
$allDomainRenewPassed = false;
|
||||
}
|
||||
|
||||
return $allDomainRenewPassed;
|
||||
}
|
||||
|
||||
private function _allPushDomainsCheck(){
|
||||
$allPushDomainsPassed=true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->gaining_reseller_username) || $this->_dataObject->data->gaining_reseller_username == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone but gaining_reseller_username is not defined.", E_USER_WARNING);
|
||||
$allPushDomainsPassed = false;
|
||||
}
|
||||
return $allPushDomainsPassed;
|
||||
}
|
||||
|
||||
private function _allDnsZoneCheck(){
|
||||
$allDnsZonePassed=true;
|
||||
if (!isSet($this->_dataObject->data->apply_to_domains) || $this->_dataObject->data->apply_to_domains == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone but apply_to_domains is not defined.", E_USER_WARNING);
|
||||
$allDnsZonePassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->dns_action) || $this->_dataObject->data->dns_action == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone but dns_action is not defined.", E_USER_WARNING);
|
||||
$allDnsZonePassed = false;
|
||||
}
|
||||
return $allDnsZonePassed;
|
||||
}
|
||||
|
||||
private function _allDnsZoneRecordCheck(){
|
||||
$allDnsZoneRecordPassed=true;
|
||||
if (!isSet($this->_dataObject->data->dns_action) || $this->_dataObject->data->dns_action == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone_record but dns_action is not defined.", E_USER_WARNING);
|
||||
$allDnsZoneRecordPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->dns_record_type) || $this->_dataObject->data->dns_record_type == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone_record but dns_record_type is not defined.", E_USER_WARNING);
|
||||
$allDnsZoneRecordPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->dns_record_data) || $this->_dataObject->data->dns_record_data == "") {
|
||||
trigger_error ("oSRS Error - change type is dns_zone_record but dns_record_data is not defined.", E_USER_WARNING);
|
||||
$allDnsZoneRecordPassed = false;
|
||||
}
|
||||
return $allDnsZoneRecordPassed;
|
||||
}
|
||||
|
||||
private function _allDomainContactsCheck(){
|
||||
$allDomainContactsPassed=true;
|
||||
if (!isSet($this->_dataObject->data->type) || $this->_dataObject->data->type == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_contacts but type is not defined.", E_USER_WARNING);
|
||||
$alllDomainContactsPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->personal) || $this->_dataObject->personal == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_contacts but personal is not defined.", E_USER_WARNING);
|
||||
$alllDomainContactsPassed = false;
|
||||
}
|
||||
return $allDomainContactsPassed;
|
||||
}
|
||||
|
||||
private function _allDomainForwardingCheck(){
|
||||
$allDomainForwardingPassed=true;
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_forwarding but op_type is not defined.", E_USER_WARNING);
|
||||
$allDomainForwardingPassed = false;
|
||||
}
|
||||
return $allDomainForwardingPassed;
|
||||
}
|
||||
|
||||
private function _allDomainLockCheck(){
|
||||
$allDomainLockPassed=true;
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_lock but op_type is not defined.", E_USER_WARNING);
|
||||
$allDomainLockPassed = false;
|
||||
}
|
||||
return $allDomainLockPassed;
|
||||
}
|
||||
|
||||
private function _allDomainNameserversCheck(){
|
||||
$allDomainNameserversPassed=true;
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_nameservers but op_type is not defined.", E_USER_WARNING);
|
||||
$allDomainNameserversPassed = false;
|
||||
}
|
||||
if(!isSet($this->_dataObject->data->add_ns) && $this->_dataObject->data->add_ns == "" &&
|
||||
!isSet($this->_dataObject->data->remove_ns) && $this->_dataObject->data->remove_ns == "" &&
|
||||
!isSet($this->_dataObject->data->assign_ns) && $this->_dataObject->data->assign_ns == "" ) {
|
||||
|
||||
trigger_error ("oSRS Error - change type is domain_nameservers but at least one of add_ns, remove_ns or assign_ns has to be defined.", E_USER_WARNING);
|
||||
$allDomainNameserversPassed = false;
|
||||
}
|
||||
return $allDomainNameserversPassed;
|
||||
}
|
||||
|
||||
private function _allDomainParkedPagesCheck(){
|
||||
$allDomainParkedPagesPassed=true;
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - change type is domain_parked_pages but op_type is not defined.", E_USER_WARNING);
|
||||
$allDomainParkedPagesPassed = false;
|
||||
}
|
||||
return $allDomainParkedPagesPassed;
|
||||
}
|
||||
|
||||
private function _allWhoisPrivacyCheck(){
|
||||
$allWhoisPrivacyPassed=true;
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - change type is whois_privacy but op_type is not defined.", E_USER_WARNING);
|
||||
$allWhoisPrivacyPassed = false;
|
||||
}
|
||||
return $allWhoisPrivacyPassed;
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$this->_dataObject->data->change_items = explode (",", $this->_dataObject->data->change_items);
|
||||
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'submit_bulk_change',
|
||||
'object' => 'bulk_change',
|
||||
'attributes' => array (
|
||||
'change_type' => $this->_dataObject->data->change_type,
|
||||
'change_items' => $this->_dataObject->data->change_items
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->apply_to_locked_domains) && $this->_dataObject->data->apply_to_locked_domains != "")
|
||||
$cmd['attributes']['apply_to_locked_domains'] = $this->_dataObject->data->apply_to_locked_domains;
|
||||
if (isSet($this->_dataObject->data->contact_email) && $this->_dataObject->data->contact_email != "")
|
||||
$cmd['attributes']['contact_email'] = $this->_dataObject->data->contact_email;
|
||||
if (isSet($this->_dataObject->data->apply_to_all_reseller_items) && $this->_dataObject->data->apply_to_all_reseller_items!= "")
|
||||
$cmd['attributes']['apply_to_all_reseller_items'] = $this->_dataObject->data->apply_to_all_reseller_items;
|
||||
|
||||
switch($this->_dataObject->data->change_type){
|
||||
case "availability_check":
|
||||
break;
|
||||
case "domain_renew":
|
||||
if (isSet($this->_dataObject->data->period) && $this->_dataObject->data->period!= "")
|
||||
$cmd['attributes']['period'] = $this->_dataObject->data->period;
|
||||
if (isSet($this->_dataObject->data->let_expire) && $this->_dataObject->data->let_expire!= "")
|
||||
$cmd['attributes']['let_expire'] = $this->_dataObject->data->let_expire;
|
||||
if (isSet($this->_dataObject->data->auto_renew) && $this->_dataObject->data->auto_renew!= "")
|
||||
$cmd['attributes']['auto_renew'] = $this->_dataObject->data->auto_renew;
|
||||
if (isSet($this->_dataObject->data->affiliate_id) && $this->_dataObject->data->affiliate_id!= "")
|
||||
$cmd['attributes']['affiliate_id'] = $this->_dataObject->data->affiliate_id;
|
||||
break;
|
||||
case "push_domains":
|
||||
if (isSet($this->_dataObject->data->gaining_reseller_username) && $this->_dataObject->data->gaining_reseller_username!= "")
|
||||
$cmd['attributes']['gaining_reseller_username'] = $this->_dataObject->data->gaining_reseller_username;
|
||||
break;
|
||||
case "dns_zone":
|
||||
if (isSet($this->_dataObject->data->apply_to_domains) && $this->_dataObject->data->apply_to_domains!= "")
|
||||
$cmd['attributes']['apply_to_domains'] = $this->_dataObject->data->apply_to_domains;
|
||||
if (isSet($this->_dataObject->data->dns_action) && $this->_dataObject->data->dns_action!= "")
|
||||
$cmd['attributes']['dns_action'] = $this->_dataObject->data->dns_action;
|
||||
if (isSet($this->_dataObject->data->dns_template) && $this->_dataObject->data->dns_template!= "")
|
||||
$cmd['attributes']['dns_template'] = $this->_dataObject->data->dns_template;
|
||||
if (isSet($this->_dataObject->data->only_if) && $this->_dataObject->data->only_if!= "")
|
||||
$cmd['attributes']['only_if'] = $this->_dataObject->data->only_if;
|
||||
if (isSet($this->_dataObject->data->force_dns_nameservers) && $this->_dataObject->data->force_dns_nameservers!= "")
|
||||
$cmd['attributes']['force_dns_nameservers'] = $this->_dataObject->data->force_dns_nameservers;
|
||||
break;
|
||||
case "dns_zone_record":
|
||||
if (isSet($this->_dataObject->data->dns_action) && $this->_dataObject->data->dns_action!= "")
|
||||
$cmd['attributes']['dns_action'] = $this->_dataObject->data->dns_action;
|
||||
if (isSet($this->_dataObject->data->dns_record_type) && $this->_dataObject->data->dns_record_type!= "")
|
||||
$cmd['attributes']['dns_record_type'] = $this->_dataObject->data->dns_record_type;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->ip_address) && $this->_dataObject->data->dns_record_data->ip_address!= "")
|
||||
$cmd['attributes']['dns_record_data']['ip_address'] = $this->_dataObject->data->dns_record_data->ip_address;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->subdomain) && $this->_dataObject->data->dns_record_data->subdomain!= "")
|
||||
$cmd['attributes']['dns_record_data']['subdomain'] = $this->_dataObject->data->dns_record_data->subdomain;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->ipv6_address) && $this->_dataObject->data->dns_record_data->ipv6_address!= "")
|
||||
$cmd['attributes']['dns_record_data']['ipv6_address'] = $this->_dataObject->data->dns_record_data->ipv6_address;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->hostname) && $this->_dataObject->data->dns_record_data->hostname!= "") $
|
||||
$cmd['attributes']['dns_record_data']['hostname'] = $this->_dataObject->data->dns_record_data->hostname;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->priority) && $this->_dataObject->data->dns_record_data->priority!= "")
|
||||
$cmd['attributes']['dns_record_data']['priority'] = $this->_dataObject->data->dns_record_data->priority;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->weight) && $this->_dataObject->data->dns_record_data->weight!= "")
|
||||
$cmd['attributes']['dns_record_data']['weight'] = $this->_dataObject->data->dns_record_data->weight;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->port) && $this->_dataObject->data->dns_record_data->port!= "")
|
||||
$cmd['attributes']['dns_record_data']['port'] = $this->_dataObject->data->dns_record_data->port;
|
||||
if (isSet($this->_dataObject->data->dns_record_data->text) && $this->_dataObject->data->dns_record_data->text!= "")
|
||||
$cmd['attributes']['dns_record_data']['text'] = $this->_dataObject->data->dns_record_data->text;
|
||||
if (isSet($this->_dataObject->data->only_if) && $this->_dataObject->data->only_if!= "")
|
||||
$cmd['attributes']['only_if'] = $this->_dataObject->data->only_if;
|
||||
break;
|
||||
case "domain_contacts":
|
||||
// Allows for multiple contact changes with the same data
|
||||
if (isSet($this->_dataObject->data->type) && $this->_dataObject->data->type!= "" &&
|
||||
isSet($this->_dataObject->personal) && $this->_dataObject->personal!= ""){
|
||||
|
||||
$contact_types=explode (",", $this->_dataObject->data->type);
|
||||
|
||||
$i=0;
|
||||
foreach($contact_types as $contact_type){
|
||||
$cmd['attributes']['contacts'][$i]['type'] = $contact_type;
|
||||
$cmd['attributes']['contacts'][$i]['set'] = $this->_createUserData();
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "domain_forwarding":
|
||||
if (isSet($this->_dataObject->data->op_type) && $this->_dataObject->data->op_type!= "")
|
||||
$cmd['attributes']['op_type'] = $this->_dataObject->data->op_type;
|
||||
break;
|
||||
case "domain_lock":
|
||||
if (isSet($this->_dataObject->data->op_type) && $this->_dataObject->data->op_type!= "")
|
||||
$cmd['attributes']['op_type'] = $this->_dataObject->data->op_type;
|
||||
break;
|
||||
case "domain_parked_pages":
|
||||
if (isSet($this->_dataObject->data->op_type) && $this->_dataObject->data->op_type!= "")
|
||||
$cmd['attributes']['op_type'] = $this->_dataObject->data->op_type;
|
||||
break;
|
||||
case "domain_nameservers":
|
||||
if (isSet($this->_dataObject->data->op_type) && $this->_dataObject->data->op_type!= "")
|
||||
$cmd['attributes']['op_type'] = $this->_dataObject->data->op_type;
|
||||
if (isSet($this->_dataObject->data->add_ns) && $this->_dataObject->data->add_ns!= "")
|
||||
$cmd['attributes']['add_ns'] = explode(",",$this->_dataObject->data->add_ns);
|
||||
if (isSet($this->_dataObject->data->remove_ns) && $this->_dataObject->data->remove_ns!= "")
|
||||
$cmd['attributes']['remove_ns'] = explode(",",$this->_dataObject->data->remove_ns);
|
||||
if (isSet($this->_dataObject->data->assign_ns) && $this->_dataObject->data->assign_ns!= "")
|
||||
$cmd['attributes']['assign_ns'] = explode(",",$this->_dataObject->data->assign_ns);
|
||||
break;
|
||||
case "whois_privacy":
|
||||
if (isSet($this->_dataObject->data->op_type) && $this->_dataObject->data->op_type!= "")
|
||||
$cmd['attributes']['op_type'] = $this->_dataObject->data->op_type;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class bulkSubmit extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->change_items) || $this->_dataObject->data->change_items == "") {
|
||||
trigger_error ("oSRS Error - change_items is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->change_type) || $this->_dataObject->data->change_type == "") {
|
||||
trigger_error ("oSRS Error - change_type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - op_type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
|
||||
private function _processRequest (){
|
||||
|
||||
$this->_dataObject->data->change_items = explode(",", $this->_dataObject->data->change_items);
|
||||
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'submit',
|
||||
'object' => 'bulk_change',
|
||||
'attributes' => array (
|
||||
'change_items' => $this->_dataObject->data->change_items,
|
||||
'change_type' => $this->_dataObject->data->change_type,
|
||||
'op_type' => $this->_dataObject->data->op_type,
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->contact_email) && $this->_dataObject->data->contact_email != "") $cmd['attributes']['contact_email'] = $this->_dataObject->data->contact_email;
|
||||
if (isSet($this->_dataObject->data->apply_to_locked_domains) && $this->_dataObject->data->apply_to_locked_domains != "") $cmd['attributes']['apply_to_locked_domains'] = $this->_dataObject->data->apply_to_locked_domains;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class bulkTransfer extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->custom_tech_contact) || $this->_dataObject->data->custom_tech_contact == "") {
|
||||
trigger_error ("oSRS Error - custom_tech_contact is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->domain_list) || $this->_dataObject->data->domain_list == "") {
|
||||
trigger_error ("oSRS Error - domain_list is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->reg_username) || $this->_dataObject->data->reg_username == "") {
|
||||
trigger_error ("oSRS Error - reg_username is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->reg_password) || $this->_dataObject->data->reg_password == "") {
|
||||
trigger_error ("oSRS Error - reg_password is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed)
|
||||
$allPassed=$this->_allTimeRequired();
|
||||
|
||||
if ($allPassed){
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
private function _allTimeRequired(){
|
||||
$subtest = true;
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$this->_dataObject->data->domain_list = explode (",", $this->_dataObject->data->domain_list);
|
||||
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'bulk_transfer',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'contact_set' => array(
|
||||
'owner' => $this->_createUserData(),
|
||||
'admin' => $this->_createUserData(),
|
||||
'billing' => $this->_createUserData(),
|
||||
'tech' => $this->_createUserData()
|
||||
),
|
||||
'reg_username' => $this->_dataObject->data->reg_username,
|
||||
'reg_domain' => $this->_dataObject->data->reg_domain,
|
||||
'reg_password' => $this->_dataObject->data->reg_password,
|
||||
'custom_tech_contact' => $this->_dataObject->data->custom_tech_contact,
|
||||
'domain_list' => $this->_dataObject->data->domain_list
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
|
||||
if (isSet($this->_dataObject->data->reg_domain) || $this->_dataObject->data->reg_domain != "") $cmd['attributes']['reg_domain'] = $this->_dataObject->data->reg_domain;
|
||||
|
||||
if (isSet($this->_dataObject->data->affiliate_id) && $this->_dataObject->data->affiliate_id != "") $cmd['attributes']['affiliate_id'] = $this->_dataObject->data->affiliate_id;
|
||||
if (isSet($this->_dataObject->data->handle) && $this->_dataObject->data->handle != "") $cmd['attributes']['handle'] = $this->_dataObject->data->handle;
|
||||
if (isSet($this->_dataObject->data->registrant_ip) && $this->_dataObject->data->registrant_ip != "") $cmd['attributes']['registrant_ip'] = $this->_dataObject->data->registrant_ip;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class cookieDelete extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->cookie)) {
|
||||
trigger_error ("oSRS Error - Cookie code not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "delete",
|
||||
"object" => "cookie",
|
||||
// "registrant_ip" => "12.34.56.78",
|
||||
"attributes" => array (
|
||||
"cookie" => $this->_dataObject->data->cookie
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class cookieQuit extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "quit",
|
||||
"object" => "session",
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class cookieSet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->reg_username)) {
|
||||
trigger_error ("oSRS Error - Username string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->reg_password)) {
|
||||
trigger_error ("oSRS Error - Password string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "set",
|
||||
"object" => "cookie",
|
||||
// "registrant_ip" => "12.34.56.78",
|
||||
"attributes" => array (
|
||||
"reg_username" => $this->_dataObject->data->reg_username,
|
||||
"reg_password" => $this->_dataObject->data->reg_password,
|
||||
"domain" => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class cookieUpdate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->reg_username)) {
|
||||
trigger_error ("oSRS Error - Username string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->reg_password)) {
|
||||
trigger_error ("oSRS Error - Password string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Existing domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain_new)) {
|
||||
trigger_error ("oSRS Error - New domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->cookie)) {
|
||||
trigger_error ("oSRS Error - Cookie code not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "update",
|
||||
"object" => "cookie",
|
||||
"cookie" => $this->_dataObject->data->cookie,
|
||||
"attributes" => array (
|
||||
"reg_username" => $this->_dataObject->data->reg_username,
|
||||
"reg_password" => $this->_dataObject->data->reg_password,
|
||||
"domain" => $this->_dataObject->data->domain,
|
||||
'domain_new' => $this->_dataObject->data->domain_new
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsCreate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'create_dns_zone',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->dns_template) && $this->_dataObject->data->dns_template != "") $cmd['attributes']['dns_template'] = $this->_dataObject->data->dns_template;
|
||||
|
||||
// records - A
|
||||
$a_ip_address = "";
|
||||
$a_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->a_ip_address) && $this->_dataObject->data->a_ip_address != "") $a_ip_address = $this->_dataObject->data->a_ip_address;
|
||||
if (isSet($this->_dataObject->data->a_subdomain) && $this->_dataObject->data->a_subdomain != "") $a_subdomain = $this->_dataObject->data->a_subdomain;
|
||||
if ($a_ip_address != "" && $a_subdomain != ""){
|
||||
$cmd['attributes']['records']['A'][0] = array(
|
||||
'ip_address' => $a_ip_address,
|
||||
'subdomain' => $a_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - AAAA
|
||||
$aaaa_ipv6_address = "";
|
||||
$aaaa_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->aaaa_ipv6_address) && $this->_dataObject->data->aaaa_ipv6_address != "") $aaaa_ipv6_address = $this->_dataObject->data->aaaa_ipv6_address;
|
||||
if (isSet($this->_dataObject->data->aaaa_subdomain) && $this->_dataObject->data->aaaa_subdomain != "") $aaaa_subdomain = $this->_dataObject->data->aaaa_subdomain;
|
||||
if ($aaaa_ipv6_address != "" && $aaaa_subdomain != ""){
|
||||
$cmd['attributes']['records']['AAAA'][0] = array(
|
||||
'ipv6_address' => $aaaa_ipv6_address,
|
||||
'subdomain' =>$aaaa_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - CNAME
|
||||
$cname_hostname = "";
|
||||
$cname_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->cname_hostname) && $this->_dataObject->data->cname_hostname != "") $cname_hostname = $this->_dataObject->data->cname_hostname;
|
||||
if (isSet($this->_dataObject->data->cname_subdomain) && $this->_dataObject->data->cname_subdomain != "") $cname_subdomain = $this->_dataObject->data->cname_subdomain;
|
||||
if ($cname_hostname != "" && $cname_subdomain != ""){
|
||||
$cmd['attributes']['records']['CNAME'][0] = array(
|
||||
'hostname' => $cname_hostname,
|
||||
'subdomain' => $cname_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - MX
|
||||
$mx_priority = "";
|
||||
$mx_subdomain = "";
|
||||
$mx_hostname = "";
|
||||
if (isSet($this->_dataObject->data->mx_priority) && $this->_dataObject->data->mx_priority != "") $mx_priority = $this->_dataObject->data->mx_priority;
|
||||
if (isSet($this->_dataObject->data->mx_subdomain) && $this->_dataObject->data->mx_subdomain != "") $mx_subdomain = $this->_dataObject->data->mx_subdomain;
|
||||
if (isSet($this->_dataObject->data->mx_hostname) && $this->_dataObject->data->mx_hostname != "") $mx_hostname = $this->_dataObject->data->mx_hostname;
|
||||
if ($mx_priority != "" && $mx_subdomain != "" && $mx_hostname != ""){
|
||||
$cmd['attributes']['records']['MX'][0] = array(
|
||||
'priority' => $mx_priority,
|
||||
'subdomain' => $mx_subdomain,
|
||||
'hostname' => $mx_hostname
|
||||
);
|
||||
}
|
||||
|
||||
// records - SRV
|
||||
$srv_priority = "";
|
||||
$srv_weight = "";
|
||||
$srv_subdomain = "";
|
||||
$srv_hostname = "";
|
||||
$srv_port = "";
|
||||
if (isSet($this->_dataObject->data->srv_priority) && $this->_dataObject->data->srv_priority != "") $srv_priority = $this->_dataObject->data->srv_priority;
|
||||
if (isSet($this->_dataObject->data->srv_weight) && $this->_dataObject->data->srv_weight != "") $srv_weight = $this->_dataObject->data->srv_weight;
|
||||
if (isSet($this->_dataObject->data->srv_subdomain) && $this->_dataObject->data->srv_subdomain != "") $srv_subdomain = $this->_dataObject->data->srv_subdomain;
|
||||
if (isSet($this->_dataObject->data->srv_hostname) && $this->_dataObject->data->srv_hostname != "") $srv_hostname = $this->_dataObject->data->srv_hostname;
|
||||
if (isSet($this->_dataObject->data->srv_port) && $this->_dataObject->data->srv_port != "") $srv_port = $this->_dataObject->data->srv_port;
|
||||
if ($srv_priority != "" && $srv_weight != "" && $srv_subdomain != "" && $srv_hostname != "" && $srv_port != ""){
|
||||
$cmd['attributes']['records']['SRV'][0] = array(
|
||||
'priority' => $srv_priority,
|
||||
'weight' => $srv_weight,
|
||||
'subdomain' => $srv_subdomain,
|
||||
'hostname' => $srv_hostname,
|
||||
'port' => $srv_port
|
||||
);
|
||||
}
|
||||
|
||||
// records - TXT
|
||||
$txt_subdomain = "";
|
||||
$txt_text = "";
|
||||
if (isSet($this->_dataObject->data->txt_subdomain) && $this->_dataObject->data->txt_subdomain != "") $txt_subdomain = $this->_dataObject->data->txt_subdomain;
|
||||
if (isSet($this->_dataObject->data->txt_text) && $this->_dataObject->data->txt_text != "") $txt_text = $this->_dataObject->data->txt_text;
|
||||
if ($txt_subdomain != "" && $txt_text != ""){
|
||||
$cmd['attributes']['records']['TXT'][0] = array(
|
||||
'subdomain' => $txt_subdomain,
|
||||
'text' => $txt_text
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsDelete extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'delete_dns_zone',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsForce extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'force_dns_nameservers',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsGet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'get_dns_zone',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsReset extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'reset_dns_zone',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->dns_template) && $this->_dataObject->data->dns_template != "") $cmd['attributes']['dns_template'] = $this->_dataObject->data->dns_template;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class dnsSet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'set_dns_zone',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->dns_template) && $this->_dataObject->data->dns_template != "") $cmd['attributes']['dns_template'] = $this->_dataObject->data->dns_template;
|
||||
|
||||
// records - A
|
||||
$a_ip_address = "";
|
||||
$a_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->a_ip_address) && $this->_dataObject->data->a_ip_address != "") $a_ip_address = $this->_dataObject->data->a_ip_address;
|
||||
if (isSet($this->_dataObject->data->a_subdomain) && $this->_dataObject->data->a_subdomain != "") $a_subdomain = $this->_dataObject->data->a_subdomain;
|
||||
if ($a_ip_address != "" && $a_subdomain != ""){
|
||||
$cmd['attributes']['records']['A'][0] = array(
|
||||
'ip_address' => $a_ip_address,
|
||||
'subdomain' => $a_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - AAAA
|
||||
$aaaa_ipv6_address = "";
|
||||
$aaaa_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->aaaa_ipv6_address) && $this->_dataObject->data->aaaa_ipv6_address != "") $aaaa_ipv6_address = $this->_dataObject->data->aaaa_ipv6_address;
|
||||
if (isSet($this->_dataObject->data->aaaa_subdomain) && $this->_dataObject->data->aaaa_subdomain != "") $aaaa_subdomain = $this->_dataObject->data->aaaa_subdomain;
|
||||
if ($aaaa_ipv6_address != "" && $aaaa_subdomain != ""){
|
||||
$cmd['attributes']['records']['AAAA'][0] = array(
|
||||
'ipv6_address' => $aaaa_ipv6_address,
|
||||
'subdomain' =>$aaaa_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - CNAME
|
||||
$cname_hostname = "";
|
||||
$cname_subdomain = "";
|
||||
if (isSet($this->_dataObject->data->cname_hostname) && $this->_dataObject->data->cname_hostname != "") $cname_hostname = $this->_dataObject->data->cname_hostname;
|
||||
if (isSet($this->_dataObject->data->cname_subdomain) && $this->_dataObject->data->cname_subdomain != "") $cname_subdomain = $this->_dataObject->data->cname_subdomain;
|
||||
if ($cname_hostname != "" && $cname_subdomain != ""){
|
||||
$cmd['attributes']['records']['CNAME'][0] = array(
|
||||
'hostname' => $cname_hostname,
|
||||
'subdomain' => $cname_subdomain
|
||||
);
|
||||
}
|
||||
|
||||
// records - MX
|
||||
$mx_priority = "";
|
||||
$mx_subdomain = "";
|
||||
$mx_hostname = "";
|
||||
if (isSet($this->_dataObject->data->mx_priority) && $this->_dataObject->data->mx_priority != "") $mx_priority = $this->_dataObject->data->mx_priority;
|
||||
if (isSet($this->_dataObject->data->mx_subdomain) && $this->_dataObject->data->mx_subdomain != "") $mx_subdomain = $this->_dataObject->data->mx_subdomain;
|
||||
if (isSet($this->_dataObject->data->mx_hostname) && $this->_dataObject->data->mx_hostname != "") $mx_hostname = $this->_dataObject->data->mx_hostname;
|
||||
if ($mx_priority != "" && $mx_subdomain != "" && $mx_hostname != ""){
|
||||
$cmd['attributes']['records']['MX'][0] = array(
|
||||
'priority' => $mx_priority,
|
||||
'subdomain' => $mx_subdomain,
|
||||
'hostname' => $mx_hostname
|
||||
);
|
||||
}
|
||||
|
||||
// records - SRV
|
||||
$srv_priority = "";
|
||||
$srv_weight = "";
|
||||
$srv_subdomain = "";
|
||||
$srv_hostname = "";
|
||||
$srv_port = "";
|
||||
if (isSet($this->_dataObject->data->srv_priority) && $this->_dataObject->data->srv_priority != "") $srv_priority = $this->_dataObject->data->srv_priority;
|
||||
if (isSet($this->_dataObject->data->srv_weight) && $this->_dataObject->data->srv_weight != "") $srv_weight = $this->_dataObject->data->srv_weight;
|
||||
if (isSet($this->_dataObject->data->srv_subdomain) && $this->_dataObject->data->srv_subdomain != "") $srv_subdomain = $this->_dataObject->data->srv_subdomain;
|
||||
if (isSet($this->_dataObject->data->srv_hostname) && $this->_dataObject->data->srv_hostname != "") $srv_hostname = $this->_dataObject->data->srv_hostname;
|
||||
if (isSet($this->_dataObject->data->srv_port) && $this->_dataObject->data->srv_port != "") $srv_port = $this->_dataObject->data->srv_port;
|
||||
if ($srv_priority != "" && $srv_weight != "" && $srv_subdomain != "" && $srv_hostname != "" && $srv_port != ""){
|
||||
$cmd['attributes']['records']['SRV'][0] = array(
|
||||
'priority' => $srv_priority,
|
||||
'weight' => $srv_weight,
|
||||
'subdomain' => $srv_subdomain,
|
||||
'hostname' => $srv_hostname,
|
||||
'port' => $srv_port
|
||||
);
|
||||
}
|
||||
|
||||
// records - TXT
|
||||
$txt_subdomain = "";
|
||||
$txt_text = "";
|
||||
if (isSet($this->_dataObject->data->txt_subdomain) && $this->_dataObject->data->txt_subdomain != "") $txt_subdomain = $this->_dataObject->data->txt_subdomain;
|
||||
if (isSet($this->_dataObject->data->txt_text) && $this->_dataObject->data->txt_text != "") $txt_text = $this->_dataObject->data->txt_text;
|
||||
if ($txt_subdomain != "" && $txt_text != ""){
|
||||
$cmd['attributes']['records']['TXT'][0] = array(
|
||||
'subdomain' => $txt_subdomain,
|
||||
'text' => $txt_text
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class fwdCreate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'create_domain_forwarding',
|
||||
'object' => 'domain',
|
||||
'attributes' => array ()
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "") $cmd['attributes']['domain'] = $this->_dataObject->data->domain;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class fwdDelete extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'delete_domain_forwarding',
|
||||
'object' => 'domain',
|
||||
'attributes' => array()
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "") $cmd['attributes']['domain'] = $this->_dataObject->data->domain;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class fwdGet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'get_domain_forwarding',
|
||||
'object' => 'domain',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array(
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult[attributes];
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class fwdSet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->subdomain) || $this->_dataObject->data->subdomain == "") {
|
||||
trigger_error ("oSRS Error - subdomain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'set_domain_forwarding',
|
||||
'object' => 'domain',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'forwarding' => array (
|
||||
array (
|
||||
'subdomain' => $this->_dataObject->data->subdomain
|
||||
)
|
||||
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->description) && $this->_dataObject->data->description != "") $cmd['attributes']['forwarding'][0]['description'] = $this->_dataObject->data->description;
|
||||
if (isSet($this->_dataObject->data->destination_url) && $this->_dataObject->data->destination_url != "") $cmd['attributes']['forwarding'][0]['destination_url'] = $this->_dataObject->data->destination_url;
|
||||
if (isSet($this->_dataObject->data->enabled) && $this->_dataObject->data->enabled != "") $cmd['attributes']['forwarding'][0]['enabled'] = $this->_dataObject->data->enabled;
|
||||
if (isSet($this->_dataObject->data->keywords) && $this->_dataObject->data->keywords != "") $cmd['attributes']['forwarding'][0]['keywords'] = $this->_dataObject->data->keywords;
|
||||
if (isSet($this->_dataObject->data->masked) && $this->_dataObject->data->masked != "") $cmd['attributes']['forwarding'][0]['masked'] = $this->_dataObject->data->masked;
|
||||
if (isSet($this->_dataObject->data->title) && $this->_dataObject->data->title != "") $cmd['attributes']['forwarding'][0]['title'] = $this->_dataObject->data->title;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
<?php
|
||||
|
||||
class allinoneDomain extends openSRS_base {
|
||||
private $_domain = "";
|
||||
private $_tldSelect = array ();
|
||||
private $_tldAll = array ();
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
public $result;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
$domain = "";
|
||||
$arraSelected = array ();
|
||||
$arraAll = array ();
|
||||
$arraCall = array ();
|
||||
|
||||
if (isSet($this->_dataObject->data->domain)) {
|
||||
// Grab domain name
|
||||
$tdomain = $this->_dataObject->data->domain;
|
||||
$tdom = explode (".", $tdomain);
|
||||
$domain = $tdom[0];
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Select non empty one
|
||||
if (isSet($this->_dataObject->data->selected) && $this->_dataObject->data->selected != "") $arraSelected = explode (";", $this->_dataObject->data->selected);
|
||||
if (isSet($this->_dataObject->data->defaulttld) && $this->_dataObject->data->defaulttld != "") $arraAll = explode (";", $this->_dataObject->data->defaulttld);
|
||||
if (count($arraSelected) == 0) {
|
||||
if (count($arraAll) == 0){
|
||||
$arraCall = array (".com",".net",".org");
|
||||
} else {
|
||||
$arraCall = $arraAll;
|
||||
}
|
||||
} else {
|
||||
$arraCall = $arraSelected;
|
||||
}
|
||||
|
||||
|
||||
// Call function
|
||||
if ($allPassed) {
|
||||
$resObject = $this->_domainTLD ($domain, $arraCall);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Selected / all TLD options
|
||||
private function _domainTLD($domain, $request){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "name_suggest",
|
||||
"object" => "domain",
|
||||
"attributes" => array(
|
||||
"searchstring" => $domain,
|
||||
"service_override" => array(
|
||||
"lookup" => array(
|
||||
"tlds" => $request
|
||||
),
|
||||
"premium" => array(
|
||||
"tlds" => $request
|
||||
),
|
||||
"suggestion" => array(
|
||||
"tlds" => $request
|
||||
)
|
||||
),
|
||||
"services" => array(
|
||||
"lookup","premium","suggestion"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if(isSet($this->_dataObject->data->maximum) && $this->_dataObject->data->maximum != ""){
|
||||
$cmd['attributes']['service_override']['lookup']['maximum'] = $this->_dataObject->data->maximum;
|
||||
$cmd['attributes']['service_override']['premium']['maximum'] = $this->_dataObject->data->maximum;
|
||||
$cmd['attributes']['service_override']['suggestion']['maximum'] = $this->_dataObject->data->maximum;
|
||||
}
|
||||
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // FLip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
|
||||
// empty premium
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
|
||||
if (isSet($arrayResult['attributes']['premium']['items'])) {
|
||||
$tempHold = $arrayResult['attributes']['premium']['items'];
|
||||
} else {
|
||||
$tempHold = null; // Null if there are no premium domains
|
||||
}
|
||||
|
||||
$this->resultRaw = array (
|
||||
'lookup' => $arrayResult['attributes']['lookup']['items'],
|
||||
'premium' => $tempHold,
|
||||
'suggestion' => $arrayResult['attributes']['suggestion']['items']
|
||||
);
|
||||
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data - domain
|
||||
*/
|
||||
|
||||
class lookupBelongsToRsp extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Search domain string not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "belongs_to_rsp",
|
||||
"object" => "domain",
|
||||
"attributes" => array (
|
||||
"domain" => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
|
||||
class lookupDomain extends openSRS_base {
|
||||
private $_domain = "";
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
$domain = "";
|
||||
$arraSelected = array ();
|
||||
$arraAll = array ();
|
||||
$arraCall = array ();
|
||||
|
||||
if (isSet($this->_dataObject->data->domain)) {
|
||||
// Grab domain name
|
||||
$domain = $this->_dataObject->data->domain;
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Select non empty one
|
||||
if (isSet($this->_dataObject->data->selected) && $this->_dataObject->data->selected != "") $arraSelected = explode (";", $this->_dataObject->data->selected);
|
||||
if (isSet($this->_dataObject->data->defaulttld) && $this->_dataObject->data->defaulttld != "") $arraAll = explode (";", $this->_dataObject->data->defaulttld);
|
||||
|
||||
if (count($arraSelected) == 0) {
|
||||
if (count($arraAll) == 0){
|
||||
$arraCall = array (".com",".net",".org");
|
||||
} else {
|
||||
$arraCall = $arraAll;
|
||||
}
|
||||
} else {
|
||||
$arraCall = $arraSelected;
|
||||
}
|
||||
|
||||
// Call function
|
||||
if ($allPassed) {
|
||||
$resObject = $this->_domainTLD ($domain, $arraCall);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Selected / all TLD options
|
||||
private function _domainTLD($domain, $request){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "name_suggest",
|
||||
"object" => "domain",
|
||||
"attributes" => array(
|
||||
"searchstring" => $domain,
|
||||
"service_override" => array(
|
||||
"lookup" => array(
|
||||
"tlds" => $request
|
||||
),
|
||||
),
|
||||
"services" => array(
|
||||
"lookup"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if(isSet($this->_dataObject->data->maximum) && $this->_dataObject->data->maximum != ""){
|
||||
$cmd['attributes']['service_override']['lookup']['maximum'] = $this->_dataObject->data->maximum;
|
||||
}
|
||||
|
||||
// print_r ($cmd);
|
||||
// echo ("\n\n\n");
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
// echo ($xmlCMD);
|
||||
// echo ("\n\n\n");
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
// echo ($XMLresult);
|
||||
// echo ("\n\n\n");
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // FLip XML to Array
|
||||
// print_r ($arrayResult);
|
||||
// echo ("\n\n\n");
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes']['lookup']['items'])){
|
||||
$this->resultRaw = $arrayResult['attributes']['lookup']['items'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
|
||||
$this->resultFullRaw = array_merge($this->resultFullRaw, $this->resultRaw);
|
||||
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*/
|
||||
|
||||
class lookupGetBalance extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_BALANCE",
|
||||
"object" => "BALANCE",
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
|
||||
if (isset($arrayResult['attributes']))
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
else
|
||||
$this->resultRaw = $arrayResult;
|
||||
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data - domain - .CA only
|
||||
*/
|
||||
|
||||
class lookupGetCaBlockerList extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "get_ca_blocker_list",
|
||||
"object" => "domain",
|
||||
"attributes" => array (
|
||||
"domain" => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetDeletedDomains extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Maybe all attribute array should be compiled here
|
||||
if (isSet($this->_dataObject->data->owner_email)) {
|
||||
// Verify proper email
|
||||
}
|
||||
if (isSet($this->_dataObject->data->admin_email)) {
|
||||
// Verify proper email
|
||||
}
|
||||
if (isSet($this->_dataObject->data->billing_email)) {
|
||||
// Verify proper email
|
||||
}
|
||||
if (isSet($this->_dataObject->data->tech_email)) {
|
||||
// Verify proper email
|
||||
}
|
||||
if (isSet($this->_dataObject->data->del_from)) {
|
||||
// verify format - "2000-10-10" - YYYY-MM-DD
|
||||
}
|
||||
if (isSet($this->_dataObject->data->del_to)) {
|
||||
// verify format - "2000-10-10" - YYYY-MM-DD
|
||||
}
|
||||
if (isSet($this->_dataObject->data->exp_from)) {
|
||||
// verify format - "2000-10-10" - YYYY-MM-DD
|
||||
}
|
||||
if (isSet($this->_dataObject->data->exp_to)) {
|
||||
// verify format - "2000-10-10" - YYYY-MM-DD
|
||||
}
|
||||
if (isSet($this->_dataObject->data->page)) {
|
||||
// verify format - positive number
|
||||
}
|
||||
if (isSet($this->_dataObject->data->limit)) {
|
||||
// verify format - postive number
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_DELETED_DOMAINS",
|
||||
"object" => "domain",
|
||||
"attributes" => array ()
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->owner_email) && $this->_dataObject->data->owner_email != "") $cmd['attributes']['owner_email'] = $this->_dataObject->data->owner_email;
|
||||
if (isSet($this->_dataObject->data->admin_email) && $this->_dataObject->data->admin_email != "") $cmd['attributes']['admin_email'] = $this->_dataObject->data->admin_email;
|
||||
if (isSet($this->_dataObject->data->billing_email) && $this->_dataObject->data->billing_email != "") $cmd['attributes']['billing_email'] = $this->_dataObject->data->billing_email;
|
||||
if (isSet($this->_dataObject->data->tech_email) && $this->_dataObject->data->tech_email != "") $cmd['attributes']['tech_email'] = $this->_dataObject->data->tech_email;
|
||||
if (isSet($this->_dataObject->data->del_from) && $this->_dataObject->data->del_from != "") $cmd['attributes']['del_from'] = $this->_dataObject->data->del_from;
|
||||
if (isSet($this->_dataObject->data->del_to) && $this->_dataObject->data->del_to != "") $cmd['attributes']['del_to'] = $this->_dataObject->data->del_to;
|
||||
if (isSet($this->_dataObject->data->exp_from) && $this->_dataObject->data->exp_from != "") $cmd['attributes']['exp_from'] = $this->_dataObject->data->exp_from;
|
||||
if (isSet($this->_dataObject->data->exp_to) && $this->_dataObject->data->exp_to != "") $cmd['attributes']['exp_to'] = $this->_dataObject->data->exp_to;
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class lookupGetDomain extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->type) || $this->_dataObject->data->type == "") {
|
||||
trigger_error ("oSRS Error - type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'get',
|
||||
'object' => 'domain',
|
||||
/// 'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array (
|
||||
'type' => $this->_dataObject->data->type
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
if (isSet($this->_dataObject->data->registrant_ip) && $this->_dataObject->data->registrant_ip != "") $cmd['registrant_ip'] = $this->_dataObject->data->registrant_ip;
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->max_to_expiry) && $this->_dataObject->data->max_to_expiry != "") $cmd['attributes']['max_to_expiry'] = $this->_dataObject->data->max_to_expiry;
|
||||
if (isSet($this->_dataObject->data->min_to_expiry) && $this->_dataObject->data->min_to_expiry != "") $cmd['attributes']['min_to_expiry'] = $this->_dataObject->data->min_to_expiry;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetDomainsByExpiry extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->exp_from)) {
|
||||
trigger_error ("oSRS Error - exp_from is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->exp_to)) {
|
||||
trigger_error ("oSRS Error - exp_to is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_DOMAINS_BY_EXPIREDATE",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
'exp_from' => $this->_dataObject->data->exp_from,
|
||||
'exp_to' => $this->_dataObject->data->exp_to
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetDomainsContacts extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain_list)) {
|
||||
trigger_error ("oSRS Error - Domain list is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$domainListArray = explode (",", $this->_dataObject->data->domain_list);
|
||||
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_DOMAINS_CONTACTS",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
'domain_list' => $domainListArray
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetNotes extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->type)) {
|
||||
trigger_error ("oSRS Error - type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_NOTES",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'type' => $this->_dataObject->data->type
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
if (isSet($this->_dataObject->data->order_id) && $this->_dataObject->data->order_id != "") $cmd['attributes']['order_id'] = $this->_dataObject->data->order_id;
|
||||
if (isSet($this->_dataObject->data->transfer_id) && $this->_dataObject->data->transfer_id != "") $cmd['attributes']['transfer_id'] = $this->_dataObject->data->transfer_id;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetOrderInfo extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->order_id)) {
|
||||
trigger_error ("oSRS Error - order_id is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_ORDER_INFO",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
"order_id" => $this->_dataObject->data->order_id
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
if (isSet($this->_dataObject->data->order_id) && $this->_dataObject->data->order_id != "") $cmd['attributes']['order_id'] = $this->_dataObject->data->order_id;
|
||||
if (isSet($this->_dataObject->data->transfer_id) && $this->_dataObject->data->transfer_id != "") $cmd['attributes']['transfer_id'] = $this->_dataObject->data->transfer_id;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetOrdersByDomain extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_ORDERS_BY_DOMAIN",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->page) && $this->_dataObject->data->page != "") $cmd['attributes']['page'] = $this->_dataObject->data->page;
|
||||
if (isSet($this->_dataObject->data->order_from) && $this->_dataObject->data->order_from != "") $cmd['attributes']['order_from'] = $this->_dataObject->data->order_from;
|
||||
if (isSet($this->_dataObject->data->status) && $this->_dataObject->data->status != "") $cmd['attributes']['status'] = $this->_dataObject->data->status;
|
||||
if (isSet($this->_dataObject->data->type) && $this->_dataObject->data->type != "") $cmd['attributes']['type'] = $this->_dataObject->data->type;
|
||||
if (isSet($this->_dataObject->data->limit) && $this->_dataObject->data->limit != "") $cmd['attributes']['limit'] = $this->_dataObject->data->limit;
|
||||
if (isSet($this->_dataObject->data->order_to) && $this->_dataObject->data->order_to != "") $cmd['attributes']['order_to'] = $this->_dataObject->data->order_to;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* - none -
|
||||
*
|
||||
* Optional Data:
|
||||
* data - owner_email, admin_email, billing_email, tech_email, del_from, del_to, exp_from, exp_to, page, limit
|
||||
*/
|
||||
|
||||
class lookupGetPrice extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->domain)) {
|
||||
trigger_error ("oSRS Error - Domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "GET_PRICE",
|
||||
"object" => "DOMAIN",
|
||||
"attributes" => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->period) && $this->_dataObject->data->period != "") $cmd['attributes']['period'] = $this->_dataObject->data->period;
|
||||
if (isSet($this->_dataObject->data->reg_type) && $this->_dataObject->data->reg_type != "") $cmd['attributes']['reg_type'] = $this->_dataObject->data->reg_type;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
<?php
|
||||
|
||||
class premiumDomain extends openSRS_base {
|
||||
private $_domain = "";
|
||||
private $_tldSelect = array ();
|
||||
private $_tldAll = array ();
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
public $result;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
$domain = "";
|
||||
$arraSelected = array ();
|
||||
$arraAll = array ();
|
||||
$arraCall = array ();
|
||||
|
||||
if (isSet($this->_dataObject->data->domain)) {
|
||||
// Grab domain name
|
||||
$domain = $this->_dataObject->data->domain;
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Select non empty one
|
||||
if (isSet($this->_dataObject->data->selected) && $this->_dataObject->data->selected != "") $arraSelected = explode (";", $this->_dataObject->data->selected);
|
||||
if (isSet($this->_dataObject->data->defaulttld) && $this->_dataObject->data->defaulttld != "") $arraAll = explode (";", $this->_dataObject->data->defaulttld);
|
||||
if (count($arraSelected) == 0) {
|
||||
if (count($arraAll) == 0){
|
||||
$arraCall = array (".com",".net",".org");
|
||||
} else {
|
||||
$arraCall = $arraAll;
|
||||
}
|
||||
} else {
|
||||
$arraCall = $arraSelected;
|
||||
}
|
||||
|
||||
// Call function
|
||||
if ($allPassed) {
|
||||
$resObject = $this->_domainTLD ($domain, $arraCall);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Selected / all TLD options
|
||||
private function _domainTLD($domain, $request){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "name_suggest",
|
||||
"object" => "domain",
|
||||
"attributes" => array(
|
||||
"searchstring" => $domain,
|
||||
"service_override" => array(
|
||||
"premium" => array(
|
||||
"tlds" => $request
|
||||
)
|
||||
),
|
||||
"services" => array(
|
||||
"premium"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
if(isSet($this->_dataObject->data->maximum) && $this->_dataObject->data->maximum != ""){
|
||||
$cmd['attributes']['service_override']['premium']['maximum'] = $this->_dataObject->data->maximum;
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // FLip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes']['premium']['items'])) {
|
||||
$this->resultRaw = $arrayResult['attributes']['premium']['items'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult; // Null if there are no premium domains
|
||||
}
|
||||
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
<?php
|
||||
|
||||
class suggestDomain extends openSRS_base {
|
||||
private $_domain = "";
|
||||
private $_tldSelect = array ();
|
||||
private $_tldAll = array ();
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
public $result;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
$domain = "";
|
||||
$arraSelected = array ();
|
||||
$arraAll = array ();
|
||||
$arraCall = array ();
|
||||
|
||||
if (isSet($this->_dataObject->data->domain)) {
|
||||
// Grab domain name
|
||||
$domain = $this->_dataObject->data->domain;
|
||||
// $domain = htmlspecialchars($domain);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Search domain strinng not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Select non empty one
|
||||
if (isSet($this->_dataObject->data->selected) && $this->_dataObject->data->selected != "") $arraSelected = explode (";", $this->_dataObject->data->selected);
|
||||
if (isSet($this->_dataObject->data->defaulttld) && $this->_dataObject->data->defaulttld != "") $arraAll = explode (";", $this->_dataObject->data->defaulttld);
|
||||
if (count($arraSelected) == 0) {
|
||||
if (count($arraAll) == 0){
|
||||
$arraCall = array (".com",".net",".org");
|
||||
} else {
|
||||
$arraCall = $arraAll;
|
||||
}
|
||||
} else {
|
||||
$arraCall = $arraSelected;
|
||||
}
|
||||
|
||||
// Call function
|
||||
if ($allPassed) {
|
||||
$resObject = $this->_domainTLD ($domain, $arraCall);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Selected / all TLD options
|
||||
private function _domainTLD($domain, $request){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "name_suggest",
|
||||
"object" => "domain",
|
||||
"attributes" => array(
|
||||
"searchstring" => $domain,
|
||||
"service_override" => array(
|
||||
"suggestion" => array(
|
||||
"tlds" => $request
|
||||
)
|
||||
),
|
||||
"services" => array(
|
||||
"suggestion"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
if(isSet($this->_dataObject->data->maximum) && $this->_dataObject->data->maximum != ""){
|
||||
$cmd['attributes']['service_override']['suggestion']['maximum'] = $this->_dataObject->data->maximum;
|
||||
}
|
||||
|
||||
// print_r ($cmd);
|
||||
// echo ("\n\n\n");
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
// echo ($xmlCMD);
|
||||
// echo ("\n\n\n");
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
// echo ($XMLresult);
|
||||
// echo ("\n\n\n");
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // FLip XML to Array
|
||||
// print_r ($arrayResult);
|
||||
// echo ("\n\n\n");
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes']['suggestion']['items'])){
|
||||
$this->resultRaw = $arrayResult['attributes']['suggestion']['items'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsAdvancedUpdt extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->op_type) || $this->_dataObject->data->op_type == "") {
|
||||
trigger_error ("oSRS Error - op_type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'advanced_update_nameservers',
|
||||
'object' => 'domain',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array (
|
||||
'op_type' => $this->_dataObject->data->op_type
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->add_ns) && $this->_dataObject->data->add_ns != "") {
|
||||
$tempAdd = explode (",", $this->_dataObject->data->add_ns);
|
||||
$cmd['attributes']['add_ns'] = $tempAdd;
|
||||
}
|
||||
if (isSet($this->_dataObject->data->assign_ns) && $this->_dataObject->data->assign_ns != "") {
|
||||
$tempAdd = explode (",", $this->_dataObject->data->assign_ns);
|
||||
$cmd['attributes']['assign_ns'] = $tempAdd;
|
||||
}
|
||||
if (isSet($this->_dataObject->data->remove_ns) && $this->_dataObject->data->remove_ns != "") {
|
||||
$tempAdd = explode (",", $this->_dataObject->data->remove_ns);
|
||||
$cmd['attributes']['remove_ns'] = $tempAdd;
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsCreate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->name) || $this->_dataObject->data->name == "") {
|
||||
trigger_error ("oSRS Error - name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->ipaddress) || $this->_dataObject->data->ipaddress == "") {
|
||||
trigger_error ("oSRS Error - ipaddress is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'create',
|
||||
'object' => 'nameserver',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
// 'registrant_ip' => '12.34.56.78',
|
||||
'attributes' => array (
|
||||
'name' => $this->_dataObject->data->name,
|
||||
'ipaddress' => $this->_dataObject->data->ipaddress
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->add_to_all_registry) && $this->_dataObject->data->add_to_all_registry != "") $cmd['attributes']['add_to_all_registry'] = $this->_dataObject->data->add_to_all_registry;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsDelete extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->name) || $this->_dataObject->data->name == "") {
|
||||
trigger_error ("oSRS Error - name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'delete',
|
||||
'object' => 'nameserver',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
// 'registrant_ip' => '12.34.56.78',
|
||||
'attributes' => array (
|
||||
'name' => $this->_dataObject->data->name,
|
||||
'ipaddress' => $this->_dataObject->data->ipaddress
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsGet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->name) || $this->_dataObject->data->name == "") {
|
||||
trigger_error ("oSRS Error - name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'get',
|
||||
'object' => 'nameserver',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
// 'registrant_ip' => '12.34.56.78',
|
||||
'attributes' => array (
|
||||
'name' => $this->_dataObject->data->name
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsModify extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->ipaddress) || $this->_dataObject->data->ipaddress == "") {
|
||||
trigger_error ("oSRS Error - ipaddress is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->name) || $this->_dataObject->data->name == "") {
|
||||
trigger_error ("oSRS Error - name is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'modify',
|
||||
'object' => 'nameserver',
|
||||
// 'cookie' => $this->_dataObject->data->cookie,
|
||||
// 'registrant_ip' => '12.34.56.78',
|
||||
'attributes' => array (
|
||||
'ipaddress' => $this->_dataObject->data->ipaddress,
|
||||
'name' => $this->_dataObject->data->name
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->new_name) && $this->_dataObject->data->new_name != "") $cmd['attributes']['new_name'] = $this->_dataObject->data->new_name;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsRegistryAdd extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->fqdn) || $this->_dataObject->data->fqdn == "") {
|
||||
trigger_error ("oSRS Error - fqdn is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->tld) || $this->_dataObject->data->tld == "") {
|
||||
trigger_error ("oSRS Error - tld is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->all) || $this->_dataObject->data->all == "") {
|
||||
trigger_error ("oSRS Error - all is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'registry_add_ns',
|
||||
'object' => 'nameserver',
|
||||
'attributes' => array (
|
||||
'fqdn' => $this->_dataObject->data->fqdn,
|
||||
'tld' => $this->_dataObject->data->tld,
|
||||
'all' => $this->_dataObject->data->all
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class nsRegistryCheck extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->fqdn) || $this->_dataObject->data->fqdn == "") {
|
||||
trigger_error ("oSRS Error - fqdn is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->tld) || $this->_dataObject->data->tld == "") {
|
||||
trigger_error ("oSRS Error - tld is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'REGISTRY_CHECK_NAMESERVER',
|
||||
'object' => 'NAMESERVER',
|
||||
'attributes' => array (
|
||||
'fqdn' => $this->_dataObject->data->fqdn,
|
||||
'tld' => $this->_dataObject->data->tld
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class persDelete extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'DELETE',
|
||||
'object' => 'SURNAME',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class persNameSuggest extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->searchstring) || $this->_dataObject->data->searchstring == "") {
|
||||
trigger_error ("oSRS Error - searchstring is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'object' => 'SURNAME',
|
||||
'action' => 'NAME_SUGGEST',
|
||||
'attributes' => array (
|
||||
'searchstring' => $this->_dataObject->data->searchstring
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class persQuery extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'QUERY',
|
||||
'object' => 'SURNAME',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->query_dns) && $this->_dataObject->data->query_dns != "") $cmd['attributes']['query_dns'] = $this->_dataObject->data->query_dns;
|
||||
if (isSet($this->_dataObject->data->query_email) && $this->_dataObject->data->query_email != "") $cmd['attributes']['query_email'] = $this->_dataObject->data->query_email;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class persSUregister extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->mailbox_type) || $this->_dataObject->data->mailbox_type == "") {
|
||||
trigger_error ("oSRS Error - mailbox_type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->password) || $this->_dataObject->data->password == "") {
|
||||
trigger_error ("oSRS Error - password is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'SU_REGISTER',
|
||||
'object' => 'SURNAME',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'mailbox' => array (
|
||||
'mailbox_type' => $this->_dataObject->data->mailbox_type,
|
||||
'password' => $this->_dataObject->data->password
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->forward_email) && $this->_dataObject->data->forward_email != "") $cmd['attributes']['mailbox']['forward_email'] = $this->_dataObject->data->forward_email;
|
||||
$content = "";
|
||||
$name = "";
|
||||
$type = "";
|
||||
if (isSet($this->_dataObject->data->content) && $this->_dataObject->data->content != "") $content = $this->_dataObject->data->content;
|
||||
if (isSet($this->_dataObject->data->name) && $this->_dataObject->data->name != "") $name = $this->_dataObject->data->name;
|
||||
if (isSet($this->_dataObject->data->type) && $this->_dataObject->data->type != "") $type = $this->_dataObject->data->type;
|
||||
if ($content != "" && $name != "" && $type != ""){
|
||||
$cmd['attributes']['dnsRecords']['content'] = $content;
|
||||
$cmd['attributes']['dnsRecords']['name'] = $name;
|
||||
$cmd['attributes']['dnsRecords']['type'] = $type;
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class persUpdate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'UPDATE',
|
||||
'object' => 'SURNAME',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->mailbox_type) && $this->_dataObject->data->mailbox_type != "") $cmd['attributes']['mailbox']['mailbox_type'] = $this->_dataObject->data->mailbox_type;
|
||||
if (isSet($this->_dataObject->data->password) && $this->_dataObject->data->password != "") $cmd['attributes']['mailbox']['password'] = $this->_dataObject->data->password;
|
||||
if (isSet($this->_dataObject->data->disable_forward_email) && $this->_dataObject->data->disable_forward_email != "") $cmd['attributes']['mailbox']['disable_forward_email'] = $this->_dataObject->data->disable_forward_email;
|
||||
if (isSet($this->_dataObject->data->forward_email) && $this->_dataObject->data->forward_email != "") $cmd['attributes']['mailbox']['forward_email'] = $this->_dataObject->data->forward_email;
|
||||
if (isSet($this->_dataObject->data->type) && $this->_dataObject->data->type != "") $cmd['attributes']['dnsRecords'][0]['type'] = $this->_dataObject->data->type;
|
||||
if (isSet($this->_dataObject->data->name) && $this->_dataObject->data->name != "") $cmd['attributes']['dnsRecords'][0]['name'] = $this->_dataObject->data->name;
|
||||
if (isSet($this->_dataObject->data->content) && $this->_dataObject->data->content != "") $cmd['attributes']['dnsRecords'][0]['content'] = $this->_dataObject->data->content;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provActivate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if ((!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") && (!isSet($this->_dataObject->data->bypass) || $this->_dataObject->data->bypass == "")) {
|
||||
trigger_error ("oSRS Error - cookie / bypass is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if ( $this->_dataObject->data->cookie != "" && $this->_dataObject->data->bypass != "" ) {
|
||||
trigger_error ("oSRS Error - Both cookie and bypass cannot be set in one call.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->domainname)) {
|
||||
trigger_error ("oSRS Error - domainname is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
"protocol" => "XCP",
|
||||
"action" => "activate",
|
||||
"object" => "domain",
|
||||
// "cookie" => $this->_dataObject->data->cookie,
|
||||
"attributes" => array (
|
||||
'domainname' => $this->_dataObject->data->domainname
|
||||
)
|
||||
);
|
||||
|
||||
// Cookie / bypass
|
||||
if (isSet($this->_dataObject->data->cookie) && $this->_dataObject->data->cookie != "") $cmd['cookie'] = $this->_dataObject->data->cookie;
|
||||
if (isSet($this->_dataObject->data->bypass) && $this->_dataObject->data->bypass != "") $cmd['domain'] = $this->_dataObject->data->bypass;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provCancelActivate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->order_id)) {
|
||||
trigger_error ("oSRS Error - order_id is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'cancel_active_process',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'order_id' => $this->_dataObject->data->order_id
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provCancelPending extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->to_date) || $this->_dataObject->data->to_date == "") {
|
||||
trigger_error ("oSRS Error - to_date is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'cancel_pending_orders',
|
||||
'object' => 'order',
|
||||
'attributes' => array (
|
||||
'to_date' => $this->_dataObject->data->to_date
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->status) && $this->_dataObject->data->status != "") {
|
||||
$cmd['attributes']['status'] = explode (",", $this->_dataObject->data->status);
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,471 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provModify extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->cookie) || $this->_dataObject->data->cookie == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->affect_domains) || $this->_dataObject->data->affect_domains == "") {
|
||||
trigger_error ("oSRS Error - affect_domains is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->data) || $this->_dataObject->data->data == "") {
|
||||
trigger_error ("oSRS Error - data variable that defines the modify type is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
|
||||
}else{
|
||||
|
||||
switch($this->_dataObject->data->data){
|
||||
case "ced_info":
|
||||
if(!$this->_allCedInfoCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "rsp_whois_info":
|
||||
if(!$this->_allRspWhoisInfoCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "trademark":
|
||||
if(!$this->_allTrademarkCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "change_ips_tag":
|
||||
if(!$this->_allChangeIpsTagCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "contact_info":
|
||||
if(!$this->_allContactInfoCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "domain_auth_info":
|
||||
if(!$this->_allDomainAuthInfoCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "expire_action":
|
||||
if(!$this->_allExpireActionCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "forwarding_email":
|
||||
if(!$this->_allForwardingEmailCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "nexus_info":
|
||||
if(!$this->_allNexusInfoCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "parkpage_state":
|
||||
if(!$this->_allParkpageStateCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "status":
|
||||
if(!$this->_allStatusCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "uk_whois_opt":
|
||||
if(!$this->_allUKWhoisOptCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
case "whois_privacy_state":
|
||||
if(!$this->_allWhoisPrivacyStateCheck())
|
||||
$allPassed=false;
|
||||
break;
|
||||
default:
|
||||
trigger_error ("oSRS Error - Unknown change type.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
private function _allCedInfoCheck(){
|
||||
$allCedInfo=true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->ced_info) || $this->_dataObject->data->ced_info == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but ced_info is not defined.", E_USER_WARNING);
|
||||
$allCedInfo = false;
|
||||
}
|
||||
|
||||
if (!isSet($this->_dataObject->data->ced_info->contact_type) || $this->_dataObject->data->ced_info->contact_type == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but contact_type is not defined.", E_USER_WARNING);
|
||||
$allCedInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->ced_info->id_number) || $this->_dataObject->data->ced_info->id_number == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but id_number is not defined.", E_USER_WARNING);
|
||||
$allCedInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->ced_info->legal_entity_type) || $this->_dataObject->data->ced_info->legal_entity_type == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but legal_entity_type is not defined.", E_USER_WARNING);
|
||||
$allCedInfo= false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->ced_info->locality_country) || $this->_dataObject->data->ced_info->locality_country == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but locality_country is not defined.", E_USER_WARNING);
|
||||
$allCedInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->ced_info->locality_state_prov) || $this->_dataObject->data->ced_info->locality_state_prov == "") {
|
||||
trigger_error ("oSRS Error - change type is ced_info but locality_state_prov is not defined.", E_USER_WARNING);
|
||||
$allCedInfo = false;
|
||||
}
|
||||
|
||||
return $allCedInfo;
|
||||
}
|
||||
|
||||
|
||||
private function _allRspWhoisInfoCheck(){
|
||||
$allRspWhoisInfo=true;
|
||||
|
||||
if (!isSet($this->_dataObject->data->all) || $this->_dataObject->data->all == "") {
|
||||
trigger_error ("oSRS Error - change type is change_rsp_whois_info but all is not defined.", E_USER_WARNING);
|
||||
$allRspWhoisInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->flag) || $this->_dataObject->data->flag == "") {
|
||||
trigger_error ("oSRS Error - change type is rsp_whois_info but flag is not defined.", E_USER_WARNING);
|
||||
$allRspWhoisInfo = false;
|
||||
}
|
||||
|
||||
return $allRspWhoisInfo;
|
||||
}
|
||||
|
||||
private function _allTrademarkCheck(){
|
||||
$allTrademarkInfo=true;
|
||||
if (!isSet($this->_dataObject->data->trademark) || $this->_dataObject->data->trademark == "") {
|
||||
trigger_error ("oSRS Error - change type is trademark but trademark is not defined.", E_USER_WARNING);
|
||||
$allTrademarkInfo = false;
|
||||
}
|
||||
return $allTrademarkInfo;
|
||||
}
|
||||
|
||||
private function _allChangeIpsTagCheck(){
|
||||
$allChangeIpsTagInfo=true;
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - change type is change_ips_tag but domain is not defined.", E_USER_WARNING);
|
||||
$allChangeIpsTagInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->gaining_registrar_tag) || $this->_dataObject->data->gaining_registrar_tag == "") {
|
||||
trigger_error ("oSRS Error - change type is change_ips_tag but gaining_registrar_tag is not defined.", E_USER_WARNING);
|
||||
$allChangeIpsTagInfo = false;
|
||||
}
|
||||
return $allChangeIpsTagInfo;
|
||||
}
|
||||
|
||||
private function _allContactInfoCheck(){
|
||||
$allContactInfo=true;
|
||||
if (!isSet($this->_dataObject->personal) || $this->_dataObject->personal == "") {
|
||||
trigger_error ("oSRS Error - change type is contact_info but personal is not defined.", E_USER_WARNING);
|
||||
$allContactInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->contact_type) || $this->_dataObject->data->contact_type == "") {
|
||||
trigger_error ("oSRS Error - change type is contact_info but contact_type is not defined.", E_USER_WARNING);
|
||||
$allContactInfo = false;
|
||||
}
|
||||
|
||||
// Personal information
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - change type is contact_info but ". $reqPers[$i] ." is not defined in personal.", E_USER_WARNING);
|
||||
$allContactInfo = false;
|
||||
}
|
||||
}
|
||||
return $allContactInfo;
|
||||
}
|
||||
|
||||
private function _allDomainAuthInfoCheck(){
|
||||
$allDomainAuthInfo=true;
|
||||
if (!isSet($this->_dataObject->data->domain_auth_info) || $this->_dataObject->data->domain_auth_info == "") {
|
||||
trigger_error ("oSRS Error - data type is domain_auth_info but a domain_auth_info value is not defined.", E_USER_WARNING);
|
||||
$allDomainAuthInfo = false;
|
||||
}
|
||||
return $allDomainAuthInfo;
|
||||
}
|
||||
|
||||
private function _allExpireActionCheck(){
|
||||
$allExpireActionInfo=true;
|
||||
if (!isSet($this->_dataObject->data->auto_renew) || $this->_dataObject->data->auto_renew == "") {
|
||||
trigger_error ("oSRS Error - data type is expire_action but auto_renew is not defined.", E_USER_WARNING);
|
||||
$allExpireActionInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->let_expire) || $this->_dataObject->data->let_expire == "") {
|
||||
trigger_error ("oSRS Error - data type is expire_action but let_expire is not defined.", E_USER_WARNING);
|
||||
$allExpireActionInfo = false;
|
||||
}
|
||||
return $allExpireActionInfo;
|
||||
}
|
||||
|
||||
private function _allForwardingEmailCheck(){
|
||||
$allForwardingEmailInfo=true;
|
||||
if (!isSet($this->_dataObject->data->forwarding_email) || $this->_dataObject->data->forwarding_email == "") {
|
||||
trigger_error ("oSRS Error - data type is forwarding_email but a forwarding_email is not defined.", E_USER_WARNING);
|
||||
$allForwardingEmailInfo = false;
|
||||
}
|
||||
return $allForwardingEmailInfo;
|
||||
}
|
||||
|
||||
private function _allNexusInfoCheck(){
|
||||
$allNexusInfo=true;
|
||||
if (!isSet($this->_dataObject->data->nexus) || $this->_dataObject->data->nexus == "") {
|
||||
trigger_error ("oSRS Error - data type is nexus_info but nexus is not defined.", E_USER_WARNING);
|
||||
$allNexusInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->nexus->app_purpose) || $this->_dataObject->data->nexus->app_purpose == "") {
|
||||
trigger_error ("oSRS Error - data type is nexus_info but app_purpose is not defined.", E_USER_WARNING);
|
||||
$allNexusInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->nexus->category) || $this->_dataObject->data->nexus->category == "") {
|
||||
trigger_error ("oSRS Error - data type is nexus_info but category is not defined.", E_USER_WARNING);
|
||||
$allNexusInfo = false;
|
||||
}
|
||||
return $allNexusInfo;
|
||||
}
|
||||
|
||||
private function _allParkpageStateCheck(){
|
||||
$allParkpageStateInfo=true;
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - data type is parkpage_state but domain is not defined.", E_USER_WARNING);
|
||||
$allParkpageStateInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->state) || $this->_dataObject->data->state == "") {
|
||||
trigger_error ("oSRS Error - data type is parkpage_state but state is not defined.", E_USER_WARNING);
|
||||
$allParkPageStateInfo = false;
|
||||
}
|
||||
return $allParkpageStateInfo;
|
||||
}
|
||||
|
||||
|
||||
private function _allUKWhoisOptCheck(){
|
||||
$allUKWhoisOptInfo=true;
|
||||
if (!isSet($this->_dataObject->data->reg_type) || $this->_dataObject->data->reg_type == "") {
|
||||
trigger_error ("oSRS Error - change type is uk_whois_opt but reg_type is not defined.", E_USER_WARNING);
|
||||
$allUKWhoisOptInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->uk_whois_opt) || $this->_dataObject->data->uk_whois_opt == "") {
|
||||
trigger_error ("oSRS Error - change type is uk_whois_opt but uk_whois_opt is not defined.", E_USER_WARNING);
|
||||
$allUKWhoisOptInfo = false;
|
||||
}
|
||||
return $allUKWhoisOptInfo;
|
||||
}
|
||||
|
||||
private function _allStatusCheck(){
|
||||
$allStatusInfo=true;
|
||||
if (!isSet($this->_dataObject->data->lock_state) || $this->_dataObject->data->lock_state == "") {
|
||||
trigger_error ("oSRS Error - data type is status but lock_state is not defined.", E_USER_WARNING);
|
||||
$allStatusInfo = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->domain_name) || $this->_dataObject->data->domain_name == "") {
|
||||
trigger_error ("oSRS Error - data type is status but domain_name is not defined.", E_USER_WARNING);
|
||||
$allStatusInfo = false;
|
||||
}
|
||||
return $allStatusInfo;
|
||||
}
|
||||
|
||||
private function _allWhoisPrivacyStateCheck(){
|
||||
$allWhoisPrivacyStateInfo=true;
|
||||
if (!isSet($this->_dataObject->data->state) || $this->_dataObject->data->state == "") {
|
||||
trigger_error ("oSRS Error - change type is whois_privacy_state but state is not defined.", E_USER_WARNING);
|
||||
$allWhoisPrivacyStateInfo = false;
|
||||
}
|
||||
return $allWhoisPrivacyStateInfo;
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'modify',
|
||||
'object' => 'DOMAIN',
|
||||
'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array (
|
||||
'affect_domains' => $this->_dataObject->data->affect_domains,
|
||||
'data' => $this->_dataObject->data->data
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
|
||||
switch($this->_dataObject->data->data){
|
||||
case "ced_info":
|
||||
// ced_info data
|
||||
if (isSet($this->_dataObject->data->ced_info->contact_type) && $this->_dataObject->data->ced_info->contact_type != "")
|
||||
$cmd['attributes']['ced_info']['contact_type'] = $this->_dataObject->data->ced_info->contact_type;
|
||||
if (isSet($this->_dataObject->data->ced_info->id_number) && $this->_dataObject->data->ced_info->id_number != "")
|
||||
$cmd['attributes']['ced_info']['id_number'] = $this->_dataObject->data->ced_info->id_number;
|
||||
if (isSet($this->_dataObject->data->ced_info->id_type) && $this->_dataObject->data->ced_info->id_type != "")
|
||||
$cmd['attributes']['ced_info']['id_type'] = $this->_dataObject->data->ced_info->id_type;
|
||||
if (isSet($this->_dataObject->data->ced_info->id_type_info) && $this->_dataObject->data->ced_info->id_type_info != "")
|
||||
$cmd['attributes']['ced_info']['id_type_info'] = $this->_dataObject->data->ced_info->id_type_info;
|
||||
if (isSet($this->_dataObject->data->ced_info->legal_entity_type) && $this->_dataObject->data->ced_info->legal_entity_type != "")
|
||||
$cmd['attributes']['ced_info']['legal_entity_type'] = $this->_dataObject->data->ced_info->legal_entity_type;
|
||||
if (isSet($this->_dataObject->data->ced_info->legal_entity_type_info) && $this->_dataObject->data->ced_info->legal_entity_type_info != "")
|
||||
$cmd['attributes']['ced_info']['legal_entity_type_info'] = $this->_dataObject->data->ced_info->legal_entity_type_info;
|
||||
if (isSet($this->_dataObject->data->ced_info->locality_city) && $this->_dataObject->data->ced_info->locality_city != "")
|
||||
$cmd['attributes']['ced_info']['locality_city'] = $this->_dataObject->data->ced_info->locality_city;
|
||||
if (isSet($this->_dataObject->data->ced_info->locality_country) && $this->_dataObject->data->ced_info->locality_country != "")
|
||||
$cmd['attributes']['ced_info']['locality_country'] = $this->_dataObject->data->ced_info->locality_country;
|
||||
if (isSet($this->_dataObject->data->ced_info->locality_state_prov) && $this->_dataObject->data->ced_info->locality_state_prov != "")
|
||||
$cmd['attributes']['ced_info']['localicty_state_prov'] = $this->_dataObject->data->ced_info->locality_state_prov;
|
||||
|
||||
break;
|
||||
case "rsp_whois_info":
|
||||
//rsp_whois_info data
|
||||
if (isSet($this->_dataObject->data->all) && $this->_dataObject->data->all != "")
|
||||
$cmd['attributes']['all'] = $this->_dataObject->data->all;
|
||||
if (isSet($this->_dataObject->data->affect_domains) && $this->_dataObject->data->affect_domains != "")
|
||||
$cmd['attributes']['affect_domains'] = $this->_dataObject->data->affect_domains;
|
||||
if (isSet($this->_dataObject->data->flag) && $this->_dataObject->data->flag != "")
|
||||
$cmd['attributes']['flag'] = $this->_dataObject->data->flag;
|
||||
break;
|
||||
case "trademark":
|
||||
//trademark data
|
||||
if (isSet($this->_dataObject->data->trademark) && $this->_dataObject->data->trademark != "")
|
||||
$cmd['attributes']['trademark'] = $this->_dataObject->data->trademark;
|
||||
break;
|
||||
case "change_ips_tag":
|
||||
//change_ips_tag data
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "")
|
||||
$cmd['attributes']['domain'] = $this->_dataObject->data->domain;
|
||||
if (isSet($this->_dataObject->data->change_tag_all) && $this->_dataObject->data->change_tag_all != "")
|
||||
$cmd['attributes']['change_tag_all'] = $this->_dataObject->data->change_tag_all;
|
||||
if (isSet($this->_dataObject->data->gaining_registrar_tag) && $this->_dataObject->data->gaining_registrar_tag != "")
|
||||
$cmd['attributes']['gaining_registrar_tag'] = $this->_dataObject->data->gaining_registrar_tag;
|
||||
if (isSet($this->_dataObject->data->rsp_override) && $this->_dataObject->data->rsp_override != "")
|
||||
$cmd['attributes']['rsp_override'] = $this->_dataObject->data->rsp_override;
|
||||
break;
|
||||
case "contact_info":
|
||||
//contact_info data
|
||||
if (isSet($this->_dataObject->data->report_email) && $this->_dataObject->data->report_email != "")
|
||||
$cmd['attributes']['report_email'] = $this->_dataObject->data->report_email;
|
||||
if (isSet($this->_dataObject->data->contact_type) && $this->_dataObject->data->contact_type != ""){
|
||||
$contact_types=explode(",",$this->_dataObject->data->contact_type);
|
||||
foreach($contact_types as $contact_type)
|
||||
$cmd['attributes']['contact_set'][$contact_type] = $this->_createUserData();
|
||||
}
|
||||
break;
|
||||
case "domain_auth_info":
|
||||
//domain_auth_info data
|
||||
if (isSet($this->_dataObject->data->domain_auth_info) && $this->_dataObject->data->domain_auth_info != "")
|
||||
$cmd['attributes']['domain_auth_info'] = $this->_dataObject->data->domain_auth_info;
|
||||
break;
|
||||
case "expire_action":
|
||||
//expire_action data
|
||||
if (isSet($this->_dataObject->data->auto_renew) && $this->_dataObject->data->auto_renew != "")
|
||||
$cmd['attributes']['auto_renew'] = $this->_dataObject->data->auto_renew;
|
||||
if (isSet($this->_dataObject->data->let_expire) && $this->_dataObject->data->let_expire != "")
|
||||
$cmd['attributes']['let_expire'] = $this->_dataObject->data->let_expire;
|
||||
break;
|
||||
case "forwarding_email":
|
||||
if (isSet($this->_dataObject->data->forwarding_email) && $this->_dataObject->data->forwarding_email != "")
|
||||
$cmd['attributes']['forwarding_email'] = $this->_dataObject->data->forwarding_email;
|
||||
break;
|
||||
case "nexus_info":
|
||||
//nexus_info data
|
||||
if (isSet($this->_dataObject->data->nexus->app_purpose) && $this->_dataObject->data->nexus->app_purpose != "")
|
||||
$cmd['attributes']['nexus']['app_purpose'] = $this->_dataObject->data->nexus->app_purpose;
|
||||
if (isSet($this->_dataObject->data->nexus->category) && $this->_dataObject->data->nexus->category != "")
|
||||
$cmd['attributes']['nexus']['category'] = $this->_dataObject->data->nexus->category;
|
||||
if (isSet($this->_dataObject->data->nexus->validator) && $this->_dataObject->data->nexus->validator != "")
|
||||
$cmd['attributes']['nexus']['validator'] = $this->_dataObject->data->nexus->validator;
|
||||
break;
|
||||
case "parkpage_state":
|
||||
//parkpage_state
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "")
|
||||
$cmd['attributes']['domain'] = $this->_dataObject->data->domain;
|
||||
if (isSet($this->_dataObject->data->state) && $this->_dataObject->data->state != "")
|
||||
$cmd['attributes']['state'] = $this->_dataObject->data->state;
|
||||
break;
|
||||
case "status":
|
||||
//status data
|
||||
if (isSet($this->_dataObject->data->lock_state) && $this->_dataObject->data->lock_state != "")
|
||||
$cmd['attributes']['lock_state'] = $this->_dataObject->data->lock_state;
|
||||
if (isSet($this->_dataObject->data->domain_name) && $this->_dataObject->data->domain_name != "")
|
||||
$cmd['attributes']['domain_name'] = $this->_dataObject->data->domain_name;
|
||||
break;
|
||||
case "uk_whois_opt":
|
||||
//uk_whois_opt
|
||||
if (isSet($this->_dataObject->data->reg_type) && $this->_dataObject->data->reg_type != "")
|
||||
$cmd['attributes']['reg_type'] = $this->_dataObject->data->reg_type;
|
||||
if (isSet($this->_dataObject->data->uk_affect_domains) && $this->_dataObject->data->uk_affect_domains != "")
|
||||
$cmd['attributes']['uk_affect_domains'] = $this->_dataObject->data->uk_affect_domains;
|
||||
if (isSet($this->_dataObject->data->uk_whois_opt) && $this->_dataObject->data->uk_whois_opt != "")
|
||||
$cmd['attributes']['uk_whois_opt'] = $this->_dataObject->data->uk_whois_opt;
|
||||
break;
|
||||
case "whois_privacy_state":
|
||||
//whois_privacy_state
|
||||
if (isSet($this->_dataObject->data->state) && $this->_dataObject->data->state != "")
|
||||
$cmd['attributes']['state'] = $this->_dataObject->data->state;
|
||||
if (isSet($this->_dataObject->data->affect_domains) && $this->_dataObject->data->affect_domains != "")
|
||||
$cmd['attributes']['affect_domains'] = $this->_dataObject->data->affect_domains;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provProcessPending extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->order_id) || $this->_dataObject->data->order_id == "") {
|
||||
trigger_error ("oSRS Error - order_id is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'process_pending',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'order_id' => $this->_dataObject->data->order_id
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->owner_address) && $this->_dataObject->data->owner_address != "") $cmd['attributes']['owner_address'] = $this->_dataObject->data->owner_address;
|
||||
if (isSet($this->_dataObject->data->command) && $this->_dataObject->data->command != "") $cmd['attributes']['command'] = $this->_dataObject->data->command;
|
||||
if (isSet($this->_dataObject->data->fax_received) && $this->_dataObject->data->fax_received != "") $cmd['attributes']['fax_received'] = $this->_dataObject->data->fax_received;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provQueryQueuedRequest extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->request_id) || $this->_dataObject->data->request_id == "") {
|
||||
trigger_error ("oSRS Error - request_id is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'query_queued_request',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'request_id' => $this->_dataObject->data->request_id
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provRenew extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->auto_renew) || $this->_dataObject->data->auto_renew == "") {
|
||||
trigger_error ("oSRS Error - auto_renew is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->currentexpirationyear) || $this->_dataObject->data->currentexpirationyear == "") {
|
||||
trigger_error ("oSRS Error - currentexpirationyear is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->handle) || $this->_dataObject->data->handle == "") {
|
||||
trigger_error ("oSRS Error - handle is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->period) || $this->_dataObject->data->period == "") {
|
||||
trigger_error ("oSRS Error - period is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'renew',
|
||||
'object' => 'DOMAIN',
|
||||
'attributes' => array (
|
||||
'auto_renew' => $this->_dataObject->data->auto_renew,
|
||||
'currentexpirationyear' => $this->_dataObject->data->currentexpirationyear,
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'handle' => $this->_dataObject->data->handle,
|
||||
'period' => $this->_dataObject->data->period
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->f_parkp) && $this->_dataObject->data->f_parkp != "") $cmd['attributes']['f_parkp'] = $this->_dataObject->data->f_parkp;
|
||||
if (isSet($this->_dataObject->data->affiliate_id) && $this->_dataObject->data->affiliate_id != "") $cmd['attributes']['affiliate_id'] = $this->_dataObject->data->affiliate_id;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provRevoke extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->reseller) || $this->_dataObject->data->reseller == "") {
|
||||
trigger_error ("oSRS Error - reseller is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'revoke',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'reseller' => $this->_dataObject->data->reseller,
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->notes) && $this->_dataObject->data->notes != "") $cmd['attributes']['notes'] = $this->_dataObject->data->notes;
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,315 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provSWregister extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validate ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
private function _validate () {
|
||||
// Command required values
|
||||
if (isSet($this->_dataObject->data->domain) && $this->_dataObject->data->domain != "") {
|
||||
// find the TLD
|
||||
$this->_dataObject->data->domain = str_replace("www.", "", $this->_dataObject->data->domain);
|
||||
$tld = explode (".", $this->_dataObject->data->domain);
|
||||
|
||||
// Data validation with all the additional options
|
||||
$allPassed = true;
|
||||
$allPassed = $this->_allTimeRequired ();
|
||||
if ($tld[1] == "ca") $allPassed = $this->_ccTLD_ca();
|
||||
if ($tld[1] == "asia") $allPassed = $this->_ccTLD_asia();
|
||||
if ($tld[1] == "be") $allPassed = $this->_ccTLD_be();
|
||||
if ($tld[1] == "de") $allPassed = $this->_ccTLD_de();
|
||||
if ($tld[1] == "eu") $allPassed = $this->_ccTLD_eu();
|
||||
if ($tld[1] == "name") $allPassed = $this->_ccTLD_name();
|
||||
if ($tld[1] == "us") $allPassed = $this->_ccTLD_us();
|
||||
|
||||
// Call the process function
|
||||
if ($allPassed) {
|
||||
$this->_processRequest ($tld[1]);
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Domain is not defined.", E_USER_ERROR);
|
||||
die();
|
||||
}
|
||||
}
|
||||
|
||||
// Personal Information
|
||||
private function _allTimeRequired(){
|
||||
$subtest = true;
|
||||
//
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
|
||||
$reqData = array ("reg_type", "reg_username", "reg_password", "domain", "custom_nameservers", "period", "custom_tech_contact", "custom_nameservers");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
|
||||
// ccTLD specific validation
|
||||
private function _ccTLD_ca () {
|
||||
$subtest = true;
|
||||
$reqData = array ("isa_trademark", "lang_pref", "legal_type");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_asia () {
|
||||
$subtest = true;
|
||||
$reqData = array ("contact_type", "id_number", "id_type", "legal_entity_type", "locality_country");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->cedinfo->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_be () {
|
||||
$subtest = true;
|
||||
$reqData = array ("lang", "owner_confirm_address");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_de () {
|
||||
$subtest = true;
|
||||
$reqData = array ("owner_confirm_address");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_eu () {
|
||||
$subtest = true;
|
||||
$reqData = array ("country", "lang", "owner_confirm_address");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_us () {
|
||||
$subtest = true;
|
||||
$reqData = array ("app_purpose", "category");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->nexus->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
private function _ccTLD_name () {
|
||||
$subtest = true;
|
||||
$reqData = array ("forwarding_email");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$subtest = false;
|
||||
}
|
||||
}
|
||||
return $subtest;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest ($ccTLD){
|
||||
// Compile the command
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'SW_REGISTER',
|
||||
'object' => 'DOMAIN',
|
||||
'attributes' => array(
|
||||
'reg_type' => $this->_dataObject->data->reg_type,
|
||||
'reg_username' => $this->_dataObject->data->reg_username,
|
||||
'reg_password' => $this->_dataObject->data->reg_password,
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'custom_nameservers' => $this->_dataObject->data->custom_nameservers,
|
||||
'period' => $this->_dataObject->data->period,
|
||||
'custom_tech_contact' => $this->_dataObject->data->custom_tech_contact,
|
||||
'custom_nameservers' => $this->_dataObject->data->custom_nameservers,
|
||||
'contact_set' => array(
|
||||
'owner' => $this->_createUserData(),
|
||||
'admin' => $this->_createUserData(),
|
||||
'billing' => $this->_createUserData(),
|
||||
'tech' => $this->_createUserData()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->affiliate_id) && $this->_dataObject->data->affiliate_id != "") $cmd['attributes']['affiliate_id'] = $this->_dataObject->data->affiliate_id;
|
||||
if (isSet($this->_dataObject->data->auto_renew) && $this->_dataObject->data->auto_renew != "") $cmd['attributes']['auto_renew'] = $this->_dataObject->data->auto_renew;
|
||||
if (isSet($this->_dataObject->data->change_contact) && $this->_dataObject->data->change_contact != "") $cmd['attributes']['change_contact'] = $this->_dataObject->data->change_contact;
|
||||
if (isSet($this->_dataObject->data->custom_transfer_nameservers) && $this->_dataObject->data->custom_transfer_nameservers != "") $cmd['attributes']['custom_transfer_nameservers'] = $this->_dataObject->data->custom_transfer_nameservers;
|
||||
if (isSet($this->_dataObject->data->dns_template) && $this->_dataObject->data->dns_template != "") $cmd['attributes']['dns_template'] = $this->_dataObject->data->dns_template;
|
||||
if (isSet($this->_dataObject->data->encoding_type) && $this->_dataObject->data->encoding_type != "") $cmd['attributes']['encoding_type'] = $this->_dataObject->data->encoding_type;
|
||||
if (isSet($this->_dataObject->data->f_lock_domain) && $this->_dataObject->data->f_lock_domain != "") $cmd['attributes']['f_lock_domain'] = $this->_dataObject->data->f_lock_domain;
|
||||
if (isSet($this->_dataObject->data->f_parkp) && $this->_dataObject->data->f_parkp != "") $cmd['attributes']['f_parkp'] = $this->_dataObject->data->f_parkp;
|
||||
if (isSet($this->_dataObject->data->f_whois_privacy) && $this->_dataObject->data->f_whois_privacy != "") $cmd['attributes']['f_whois_privacy'] = $this->_dataObject->data->f_whois_privacy;
|
||||
if (isSet($this->_dataObject->data->handle) && $this->_dataObject->data->handle != "") $cmd['attributes']['handle'] = $this->_dataObject->data->handle;
|
||||
if (isSet($this->_dataObject->data->link_domains) && $this->_dataObject->data->link_domains != "") $cmd['attributes']['link_domains'] = $this->_dataObject->data->link_domains;
|
||||
if (isSet($this->_dataObject->data->master_order_id) && $this->_dataObject->data->master_order_id != "") $cmd['attributes']['master_order_id'] = $this->_dataObject->data->master_order_id;
|
||||
if (isSet($this->_dataObject->data->nameserver_list) && $this->_dataObject->data->nameserver_list != "") $cmd['attributes']['nameserver_list'] = $this->_dataObject->data->nameserver_list;
|
||||
if (isSet($this->_dataObject->data->premium_price_to_verify) && $this->_dataObject->data->premium_price_to_verify != "") $cmd['attributes']['premium_price_to_verify'] = $this->_dataObject->data->premium_price_to_verify;
|
||||
if (isSet($this->_dataObject->data->reg_domain) && $this->_dataObject->data->reg_domain != "") $cmd['attributes']['reg_domain'] = $this->_dataObject->data->reg_domain;
|
||||
|
||||
// NS records
|
||||
if ($this->_dataObject->data->custom_nameservers == 1){
|
||||
for ($j=1; $j<=10; $j++){
|
||||
$tns = "name". $j;
|
||||
$tso = "sortorder". $j;
|
||||
|
||||
$passArray = array ();
|
||||
$temHolder = array ();
|
||||
if (isSet($this->_dataObject->data->$tns)){
|
||||
if ($this->_dataObject->data->$tns != ""){
|
||||
$temHolder['name'] = $this->_dataObject->data->$tns;
|
||||
$temHolder['sortorder'] = $this->_dataObject->data->$tso;
|
||||
array_push ($passArray, $temHolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cmd['attributes']['nameserver_list'] = $passArray;
|
||||
}
|
||||
|
||||
// ccTLD specific
|
||||
if ($ccTLD == "ca") {
|
||||
$cmd['attributes']['isa_trademark'] = $this->_dataObject->data->isa_trademark;
|
||||
$cmd['attributes']['lang_pref'] = $this->_dataObject->data->lang_pref;
|
||||
$cmd['attributes']['legal_type'] = strtoupper($this->_dataObject->data->legal_type);
|
||||
if (isSet($this->_dataObject->data->ca_link_domain) && $this->_dataObject->data->ca_link_domain != "") $cmd['attributes']['ca_link_domain'] = $this->_dataObject->data->ca_link_domain;
|
||||
if (isSet($this->_dataObject->data->cwa) && $this->_dataObject->data->cwa != "") $cmd['attributes']['cwa'] = $this->_dataObject->data->cwa;
|
||||
if (isSet($this->_dataObject->data->domain_description) && $this->_dataObject->data->domain_description != "") $cmd['attributes']['domain_description'] = $this->_dataObject->data->domain_description;
|
||||
if (isSet($this->_dataObject->data->rant_agrees) && $this->_dataObject->data->rant_agrees != "") $cmd['attributes']['rant_agrees'] = $this->_dataObject->data->rant_agrees;
|
||||
if (isSet($this->_dataObject->data->rant_no) && $this->_dataObject->data->rant_no != "") $cmd['attributes']['rant_no'] = $this->_dataObject->data->rant_no;
|
||||
}
|
||||
|
||||
if ($ccTLD == "asia") {
|
||||
$cmd['attributes']['tld_data']['ced_info']['contact_type'] = $this->_dataObject->cedinfo->contact_type;
|
||||
$cmd['attributes']['tld_data']['ced_info']['id_number'] = $this->_dataObject->cedinfo->id_number;
|
||||
$cmd['attributes']['tld_data']['ced_info']['id_type'] = $this->_dataObject->cedinfo->id_type;
|
||||
$cmd['attributes']['tld_data']['ced_info']['legal_entity_type'] = $this->_dataObject->cedinfo->legal_entity_type;
|
||||
$cmd['attributes']['tld_data']['ced_info']['locality_country'] = $this->_dataObject->cedinfo->locality_country;
|
||||
if (isSet($this->_dataObject->cedinfo->id_type_info) && $this->_dataObject->cedinfo->id_type_info != "") $cmd['attributes']['tld_data']['ced_info']['id_type_info'] = $this->_dataObject->cedinfo->id_type_info;
|
||||
if (isSet($this->_dataObject->cedinfo->legal_entity_type_info) && $this->_dataObject->cedinfo->legal_entity_type_info != "") $cmd['attributes']['tld_data']['ced_info']['legal_entity_type_info'] = $this->_dataObject->cedinfo->legal_entity_type_info;
|
||||
if (isSet($this->_dataObject->cedinfo->locality_city) && $this->_dataObject->cedinfo->locality_city != "") $cmd['attributes']['tld_data']['ced_info']['locality_city'] = $this->_dataObject->cedinfo->locality_city;
|
||||
if (isSet($this->_dataObject->cedinfo->locality_state_prov) && $this->_dataObject->cedinfo->locality_state_prov != "") $cmd['attributes']['tld_data']['ced_info']['locality_state_prov'] = $this->_dataObject->cedinfo->locality_state_prov;
|
||||
}
|
||||
|
||||
if ($ccTLD == "eu"){
|
||||
$cmd['attributes']['country'] = strtoupper($this->_dataObject->data->country);
|
||||
$cmd['attributes']['lang'] = $this->_dataObject->data->lang;
|
||||
$cmd['attributes']['owner_confirm_address'] = $this->_dataObject->data->owner_confirm_address;
|
||||
}
|
||||
|
||||
if ($ccTLD == "be"){
|
||||
$cmd['attributes']['lang'] = $this->_dataObject->data->lang;
|
||||
$cmd['attributes']['owner_confirm_address'] = $this->_dataObject->data->owner_confirm_address;
|
||||
}
|
||||
|
||||
if ($ccTLD == "de"){
|
||||
$cmd['attributes']['owner_confirm_address'] = $this->_dataObject->data->owner_confirm_address;
|
||||
}
|
||||
|
||||
if ($ccTLD == "name") {
|
||||
$cmd['attributes']['tld_data']['forwarding_email'] = $this->_dataObject->data->forwarding_email;
|
||||
}
|
||||
|
||||
if ($ccTLD == "us") {
|
||||
$cmd['attributes']['tld_data']['nexus']['app_purpose'] = $this->_dataObject->nexus->app_purpose;
|
||||
$cmd['attributes']['tld_data']['nexus']['category'] = $this->_dataObject->nexus->category;
|
||||
if (isSet($this->_dataObject->nexus->validator) && $this->_dataObject->nexus->validator != "") $cmd['attributes']['tld_data']['nexus']['validator'] = $this->_dataObject->nexus->validator;
|
||||
}
|
||||
|
||||
|
||||
// Process the call
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
}
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provSendCIRAapproval extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'send_cira_approval_email',
|
||||
'object' => 'domain',
|
||||
'attributes' => array (
|
||||
'domain' => $this->_dataObject->data->domain
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,225 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class provUpdateAllInfo extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->domain) || $this->_dataObject->data->domain == "") {
|
||||
trigger_error ("oSRS Error - domain is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Check that the full contact set is there
|
||||
if (!isSet($this->_dataObject->data->owner_contact) || $this->_dataObject->data->owner_contact == ""){
|
||||
trigger_error ("oSRS Error - owner_contact is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}else{
|
||||
if(!$this->_allRequired("owner_contact"))
|
||||
$allPassed=false;
|
||||
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->admin_contact) || $this->_dataObject->data->admin_contact == ""){
|
||||
trigger_error ("oSRS Error - admin_contact is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}else{
|
||||
if(!$this->_allRequired("admin_contact"))
|
||||
$allPassed=false;
|
||||
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->tech_contact) || $this->_dataObject->data->tech_contact == ""){
|
||||
trigger_error ("oSRS Error - tech_contact in is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}else{
|
||||
if(!$this->_allRequired("tech_contact"))
|
||||
$allPassed=false;
|
||||
}
|
||||
if (!isSet($this->_dataObject->data->billing_contact) || $this->_dataObject->data->billing_contact == ""){
|
||||
trigger_error ("oSRS Error - billing_contact is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}else{
|
||||
if(!$this->_allRequired("billing_contact"))
|
||||
$allPassed=false;
|
||||
}
|
||||
|
||||
//Check Nameserver Values
|
||||
if (!isSet($this->_dataObject->data->nameserver_names) || $this->_dataObject->data->nameserver_names == "") {
|
||||
trigger_error ("oSRS Error - The function requires at least one nameserver is provided.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
//Check there are the samenumber of Nameserver IP values are there are Nameserver Name values
|
||||
if (isSet($this->_dataObject->data->nameserver_ips) && $this->_dataObject->data->nameserver_ips != "") {
|
||||
if(count(explode(",",$this->_dataObject->data->nameserver_ips)) != count(explode(",",$this->_dataObject->data->nameserver_names))){
|
||||
trigger_error ("oSRS Error - The function requires the same number of Nameserver IP addresses as Nameserver names if you are defining Nameserver IP addresses.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _allRequired($contact){
|
||||
$allInfo = true;
|
||||
// Check Contact information
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->data->$contact->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined in $contact contact set.", E_USER_WARNING);
|
||||
$allInfo = false;
|
||||
}
|
||||
}
|
||||
|
||||
return $allInfo;
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'update_all_info',
|
||||
'object' => 'domain',
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'attributes' => array (
|
||||
'domain' =>$this->_dataObject->data->domain,
|
||||
'nameserver_list' => $name_servers,
|
||||
'contact_set' => array(
|
||||
'owner' => array(
|
||||
"first_name" => $this->_dataObject->data->owner_contact->first_name,
|
||||
"last_name" => $this->_dataObject->data->owner_contact->last_name,
|
||||
"org_name" => $this->_dataObject->data->owner_contact->org_name,
|
||||
"address1" => $this->_dataObject->data->owner_contact->address1,
|
||||
"address2" => $this->_dataObject->data->owner_contact->address2,
|
||||
"address3" => $this->_dataObject->data->owner_contact->address3,
|
||||
"city" => $this->_dataObject->data->owner_contact->city,
|
||||
"state" => $this->_dataObject->data->owner_contact->state,
|
||||
"postal_code" => $this->_dataObject->data->owner_contact->postal_code,
|
||||
"country" => $this->_dataObject->data->owner_contact->country,
|
||||
"phone" => $this->_dataObject->data->owner_contact->phone,
|
||||
"fax" => $this->_dataObject->data->owner_contact->fax,
|
||||
"email" => $this->_dataObject->data->owner_contact->email,
|
||||
"lang_pref" => $this->_dataObject->data->owner_contact->lang_pref
|
||||
),
|
||||
|
||||
'admin' => array(
|
||||
"first_name" => $this->_dataObject->data->admin_contact->first_name,
|
||||
"last_name" => $this->_dataObject->data->admin_contact->last_name,
|
||||
"org_name" => $this->_dataObject->data->admin_contact->org_name,
|
||||
"address1" => $this->_dataObject->data->admin_contact->address1,
|
||||
"address2" => $this->_dataObject->data->admin_contact->address2,
|
||||
"address3" => $this->_dataObject->data->admin_contact->address3,
|
||||
"city" => $this->_dataObject->data->admin_contact->city,
|
||||
"state" => $this->_dataObject->data->admin_contact->state,
|
||||
"postal_code" => $this->_dataObject->data->admin_contact->postal_code,
|
||||
"country" => $this->_dataObject->data->admin_contact->country,
|
||||
"phone" => $this->_dataObject->data->admin_contact->phone,
|
||||
"fax" => $this->_dataObject->data->admin_contact->fax,
|
||||
"email" => $this->_dataObject->data->admin_contact->email,
|
||||
"lang_pref" => $this->_dataObject->data->admin_contact->lang_pref
|
||||
),
|
||||
|
||||
'tech' => array(
|
||||
"first_name" => $this->_dataObject->data->tech_contact->first_name,
|
||||
"last_name" => $this->_dataObject->data->tech_contact->last_name,
|
||||
"org_name" => $this->_dataObject->data->tech_contact->org_name,
|
||||
"address1" => $this->_dataObject->data->tech_contact->address1,
|
||||
"address2" => $this->_dataObject->data->tech_contact->address2,
|
||||
"address3" => $this->_dataObject->data->tech_contact->address3,
|
||||
"city" => $this->_dataObject->data->tech_contact->city,
|
||||
"state" => $this->_dataObject->data->tech_contact->state,
|
||||
"postal_code" => $this->_dataObject->data->tech_contact->postal_code,
|
||||
"country" => $this->_dataObject->data->tech_contact->country,
|
||||
"phone" => $this->_dataObject->data->tech_contact->phone,
|
||||
"fax" => $this->_dataObject->data->tech_contact->fax,
|
||||
"email" => $this->_dataObject->data->tech_contact->email,
|
||||
"lang_pref" => $this->_dataObject->data->tech_contact->lang_pref
|
||||
),
|
||||
'billing' => array(
|
||||
"first_name" => $this->_dataObject->data->billing_contact->first_name,
|
||||
"last_name" => $this->_dataObject->data->billing_contact->last_name,
|
||||
"org_name" => $this->_dataObject->data->billing_contact->org_name,
|
||||
"address1" => $this->_dataObject->data->billing_contact->address1,
|
||||
"address2" => $this->_dataObject->data->billing_contact->address2,
|
||||
"address3" => $this->_dataObject->data->billing_contact->address3,
|
||||
"city" => $this->_dataObject->data->billing_contact->city,
|
||||
"state" => $this->_dataObject->data->billing_contact->state,
|
||||
"postal_code" => $this->_dataObject->data->billing_contact->postal_code,
|
||||
"country" => $this->_dataObject->data->billing_contact->country,
|
||||
"phone" => $this->_dataObject->data->billing_contact->phone,
|
||||
"fax" => $this->_dataObject->data->billing_contact->fax,
|
||||
"email" => $this->_dataObject->data->billing_contact->email,
|
||||
"lang_pref" => $this->_dataObject->data->billing_contact->lang_pref
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->nameserver_names) && $this->_dataObject->data->nameserver_names != ""){
|
||||
|
||||
$nameServers=explode(",",$this->_dataObject->data->nameserver_names);
|
||||
|
||||
if (isSet($this->_dataObject->data->nameserver_ips) && $this->_dataObject->data->nameserver_ips != "")
|
||||
$ipAddresses=explode(",",$this->_dataObject->data->nameserver_ips);
|
||||
|
||||
$i=0;
|
||||
|
||||
foreach ($nameServers as $nameServer){
|
||||
$cmd['attributes']['nameserver_list'][$i]['fqdn'] = $nameServer;
|
||||
|
||||
if(isSet($ipAddresses[$i]))
|
||||
$cmd['attributes']['nameserver_list'][$i]['ipaddress'] = $ipAddresses[$i];
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-105
@@ -1,105 +0,0 @@
|
||||
<?php
|
||||
|
||||
class provUpdateContacts extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct($dataObject);
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Personal information
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
$reqData = array ("domain", "types");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function processRequest (){
|
||||
$this->_dataObject->data->types = explode (",", $this->_dataObject->data->types);
|
||||
|
||||
// Compile the command
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'update_contacts',
|
||||
'object' => 'domain',
|
||||
'cookie' => $this->_dataObject->data->cookie,
|
||||
'attributes' => array(
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'types' => $this->_dataObject->data->types,
|
||||
'contact_set' => array(
|
||||
'owner' => $this->_createUserData(),
|
||||
'admin' => $this->_createUserData(),
|
||||
'billing' => $this->_createUserData(),
|
||||
'tech' => $this->_createUserData()
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
@@ -1,132 +0,0 @@
|
||||
<?php
|
||||
|
||||
class subresActing extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
$reqData = array ("reg_username", "reg_password", "domain", "custom_nameservers", "as_subreseller", "bulk_order");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'SW_REGISTER',
|
||||
'object' => 'DOMAIN',
|
||||
'attributes' => array(
|
||||
'reg_type' => 'new',
|
||||
'reg_username' => $this->_dataObject->data->reg_username,
|
||||
'reg_password' => $this->_dataObject->data->reg_password,
|
||||
'reg_domain' => $this->_dataObject->data->reg_domain,
|
||||
'affiliate_id' => $this->_dataObject->data->affiliate_id,
|
||||
'auto_renew' => $this->_dataObject->data->auto_renew,
|
||||
'domain' => $this->_dataObject->data->domain,
|
||||
'contact_set' => array(
|
||||
'owner' => $this->_createUserData(),
|
||||
'admin' => $this->_createUserData(),
|
||||
'billing' => $this->_createUserData(),
|
||||
'tech' => $this->_createUserData()
|
||||
),
|
||||
'f_parkp' => $this->_dataObject->data->f_parkp,
|
||||
'f_whois_privacy' => $this->_dataObject->data->f_whois_privacy,
|
||||
'f_lock_domain' => $this->_dataObject->data->f_lock_domain,
|
||||
'period' => $this->_dataObject->data->period,
|
||||
'link_domains' => $this->_dataObject->data->link_domains,
|
||||
'custom_nameservers' => $this->_dataObject->data->custom_nameservers,
|
||||
'encoding_type' => $this->_dataObject->data->encoding_type,
|
||||
'custom_tech_contact' => $this->_dataObject->data->custom_tech_contact,
|
||||
'as_subreseller' => $this->_dataObject->data->as_subreseller,
|
||||
'bulk_order' => $this->_dataObject->data->bulk_order
|
||||
),
|
||||
);
|
||||
|
||||
if ($this->_dataObject->data->custom_nameservers == 1){
|
||||
for ($j=1; $j<=10; $j++){
|
||||
$tns = "name". $j;
|
||||
$tso = "sortorder". $j;
|
||||
|
||||
$passArray = array ();
|
||||
$temHolder = array ();
|
||||
if (isSet($this->_dataObject->data->$tns)){
|
||||
if ($this->_dataObject->data->$tns != ""){
|
||||
$temHolder['name'] = $this->_dataObject->data->$tns;
|
||||
$temHolder['sortorder'] = $this->_dataObject->data->$tso;
|
||||
array_push ($passArray, $temHolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$cmd['attributes']['nameserver_list'] = $passArray;
|
||||
}
|
||||
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // FLip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
$this->resultRaw = $arrayResult;
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
} else {
|
||||
echo ("Incorrect call data.<br>\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class subresCreate extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
$reqPers = array ("first_name", "last_name", "org_name", "address1", "city", "state", "country", "postal_code", "phone", "email", "lang_pref");
|
||||
for ($i = 0; $i < count($reqPers); $i++){
|
||||
if ($this->_dataObject->personal->$reqPers[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqPers[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
$reqData = array ("ccp_enabled", "low_balance_email", "password", "pricing_plan", "status", "system_status_email", "username");
|
||||
for ($i = 0; $i < count($reqData); $i++){
|
||||
if ($this->_dataObject->data->$reqData[$i] == "") {
|
||||
trigger_error ("oSRS Error - ". $reqData[$i] ." is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'action' => 'CREATE',
|
||||
'object' => 'SUBRESELLER',
|
||||
'attributes' => array (
|
||||
'ccp_enabled' => $this->_dataObject->data->ccp_enabled,
|
||||
'contact_set' => array(
|
||||
'owner' => $this->_createUserData(),
|
||||
'admin' => $this->_createUserData(),
|
||||
'billing' => $this->_createUserData(),
|
||||
'tech' => $this->_createUserData()
|
||||
),
|
||||
'low_balance_email' => $this->_dataObject->data->low_balance_email,
|
||||
'password' => $this->_dataObject->data->password,
|
||||
'pricing_plan' => $this->_dataObject->data->pricing_plan,
|
||||
'status' => $this->_dataObject->data->status,
|
||||
'system_status_email' => $this->_dataObject->data->system_status_email,
|
||||
'username' => $this->_dataObject->data->username
|
||||
)
|
||||
);
|
||||
|
||||
// Command optional values
|
||||
if (isSet($this->_dataObject->data->payment_email) && $this->_dataObject->data->payment_email != "") $cmd['attributes']['payment_email'] = $this->_dataObject->data->payment_email;
|
||||
if (isSet($this->_dataObject->data->url) && $this->_dataObject->data->url != "") $cmd['attributes']['url'] = $this->_dataObject->data->url;
|
||||
if (isSet($this->_dataObject->data->nameservers) && $this->_dataObject->data->nameservers != "") {
|
||||
// 'fqdn1' => 'parking1.mdnsservice.com'
|
||||
$tmpArray = explode (",", $this->_dataObject->data->nameservers);
|
||||
for ($i=0; $i<count($tmpArray); $i++){
|
||||
$cmd['attributes']['nameservers']['fqdn'. ($i+1)] = $tmpArray[$i];
|
||||
}
|
||||
}
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
|
||||
|
||||
private function _createUserData(){
|
||||
$userArray = array(
|
||||
"first_name" => $this->_dataObject->personal->first_name,
|
||||
"last_name" => $this->_dataObject->personal->last_name,
|
||||
"org_name" => $this->_dataObject->personal->org_name,
|
||||
"address1" => $this->_dataObject->personal->address1,
|
||||
"address2" => $this->_dataObject->personal->address2,
|
||||
"address3" => $this->_dataObject->personal->address3,
|
||||
"city" => $this->_dataObject->personal->city,
|
||||
"state" => $this->_dataObject->personal->state,
|
||||
"postal_code" => $this->_dataObject->personal->postal_code,
|
||||
"country" => $this->_dataObject->personal->country,
|
||||
"phone" => $this->_dataObject->personal->phone,
|
||||
"fax" => $this->_dataObject->personal->fax,
|
||||
"email" => $this->_dataObject->personal->email,
|
||||
"url" => $this->_dataObject->personal->url,
|
||||
"lang_pref" => $this->_dataObject->personal->lang_pref
|
||||
);
|
||||
return $userArray;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* Required object values:
|
||||
* data -
|
||||
*/
|
||||
|
||||
class subresGet extends openSRS_base {
|
||||
private $_dataObject;
|
||||
private $_formatHolder = "";
|
||||
public $resultFullRaw;
|
||||
public $resultRaw;
|
||||
public $resultFullFormated;
|
||||
public $resultFormated;
|
||||
|
||||
public function __construct ($formatString, $dataObject) {
|
||||
parent::__construct();
|
||||
$this->_dataObject = $dataObject;
|
||||
$this->_formatHolder = $formatString;
|
||||
$this->_validateObject ();
|
||||
}
|
||||
|
||||
public function __destruct () {
|
||||
parent::__destruct();
|
||||
}
|
||||
|
||||
// Validate the object
|
||||
private function _validateObject (){
|
||||
$allPassed = true;
|
||||
|
||||
// Command required values
|
||||
if (!isSet($this->_dataObject->data->username) || $this->_dataObject->data->username == "") {
|
||||
trigger_error ("oSRS Error - username is not defined.", E_USER_WARNING);
|
||||
$allPassed = false;
|
||||
}
|
||||
|
||||
// Run the command
|
||||
if ($allPassed) {
|
||||
// Execute the command
|
||||
$this->_processRequest ();
|
||||
} else {
|
||||
trigger_error ("oSRS Error - Incorrect call.", E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
// Post validation functions
|
||||
private function _processRequest (){
|
||||
$cmd = array(
|
||||
'protocol' => 'XCP',
|
||||
'object' => 'SUBRESELLER',
|
||||
'action' => 'GET',
|
||||
'attributes' => array (
|
||||
'username' => $this->_dataObject->data->username
|
||||
)
|
||||
);
|
||||
|
||||
$xmlCMD = $this->_opsHandler->encode($cmd); // Flip Array to XML
|
||||
$XMLresult = $this->send_cmd($xmlCMD); // Send XML
|
||||
$arrayResult = $this->_opsHandler->decode($XMLresult); // Flip XML to Array
|
||||
|
||||
// Results
|
||||
$this->resultFullRaw = $arrayResult;
|
||||
if (isSet($arrayResult['attributes'])){
|
||||
$this->resultRaw = $arrayResult['attributes'];
|
||||
} else {
|
||||
$this->resultRaw = $arrayResult;
|
||||
}
|
||||
$this->resultFullFormated = convertArray2Formated ($this->_formatHolder, $this->resultFullRaw);
|
||||
$this->resultFormated = convertArray2Formated ($this->_formatHolder, $this->resultRaw);
|
||||
}
|
||||
}
|
||||
Loaded 100 of 146 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user