Beispiel #1
0
function SRSdelete_cookie($cookie)
{
    $cmd = array('protocol' => "XCP", 'action' => "delete", 'object' => "cookie", 'attributes' => array('cookie' => $cookie));
    $O = new openSRS('test', 'XCP');
    $srs_result = $O->send_cmd($cmd);
    return $srs_result;
}
Beispiel #2
0
function SRSregistry_create_nameserver($cookie, $fqdn, $ip)
{
    $cmd = array('protocol' => "XCP", 'action' => "create", 'object' => "nameserver", 'cookie' => $cookie, 'attributes' => array('name' => $fqdn, 'ipaddress' => $ip));
    $O = new openSRS('test', 'XCP');
    $srs_result = $O->send_cmd($cmd);
    return $srs_result;
}
function SRSregistry_register_domain($adm_login, $adm_pass, $domain_name, $period, $contacts, $dns_servers)
{
    $owner = SRScreate_contact_array($contacts["owner"]);
    $billing = SRScreate_contact_array($contacts["billing"]);
    $admin = SRScreate_contact_array($contacts["admin"]);
    $contact_set = array('owner' => $owner, 'billing' => $billing, 'admin' => $admin);
    $nameservers = array();
    if ($dns_servers[0]["name"] != "default" && $dns_servers[1]["name"] != "default" && isHostname($dns_servers[0]["name"]) && isHostname($dns_servers[1]["name"])) {
        $nameservers[] = array("sortorder" => 1, "name" => 'ns1.domaindirect.com');
        $nameservers[] = array("sortorder" => 2, "name" => 'ns2.domaindirect.com');
    }
    $cmd = array('protocol' => 'XCP', 'action' => 'SW_REGISTER', 'object' => 'DOMAIN', 'attributes' => array('reg_domain' => $domain_name, 'domain' => $domain_name, 'period' => $period, 'reg_username' => $adm_login, 'reg_password' => $adm_pass, 'auto_renew' => '0', 'custom_tech_contact' => '0', 'link_domains' => '0', 'f_lock_domain' => '0', 'reg_type' => 'new', 'custom_nameservers' => '0', 'nameserver_list' => $nameservers, 'contact_set' => $contact_set));
    $O = new openSRS('test', 'XCP');
    $O->initAuth();
    $srs_result = $O->send_cmd($cmd);
    return $srs_result;
}
Beispiel #4
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.   
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 **************************************************************************
 *
 * vim: set expandtab tabstop=4 shiftwidth=4:
 * $Id: test.php,v 1.1 2003/11/26 05:50:08 thomas Exp $
 *
 **************************************************************************
 */
require_once 'openSRS.php';
$O = new openSRS('test', 'XCP');
$cmd = array('action' => 'lookup', 'object' => 'domain', 'attributes' => array('domain' => 'domain.com', 'affiliate_id' => '12345'));
echo "<h1>Command</h1>\n";
print_r($cmd);
$result = $O->send_cmd($cmd);
echo "<HR />";
echo "<h1>Result</h1>\n";
print_r($result);
echo "<HR />";
echo "<h1>Log</h1>\n";
$O->showlog();
echo "<HR />";
echo "<h1>OPS XML Log</h1>\n";
$O->_OPS->showlog('xml', 'raw');
echo "<HR />";
echo "<h1>OPS Raw Log</h1>\n";
Beispiel #5
0
 function register()
 {
     if ($this->registrar['osrs_user'] == 1) {
         $mode = 'live';
     } else {
         $mode = 'test';
     }
     define('OPENSRS_USERNAME', $this->registrar['osrs_user']);
     define('TEST_PRIVATE_KEY', $this->registrar['osrs_testkey']);
     define('LIVE_PRIVATE_KEY', $this->registrar['osrs_livekey']);
     $O = new openSRS();
     $cmd = array('action' => 'sw_register', 'object' => 'DOMAIN', 'attributes' => array('object' => 'DOMAIN', 'protocal' => 'XCP', 'registrant_ip' => '', 'domain' => $this->domain_name, 'affiliate_id' => '', 'auto_renew' => '0', 'ca_link_domain' => '0', 'custom_nameservers' => '1', 'custom_tech_contact' => '0', 'domain_description' => '', 'encoding_type' => '', 'flock_domain' => '', 'handle' => 'process', 'isa_trademark' => '0', 'lang_pref' => 'EN', 'legal_type' => 'CCT', 'link_domains' => '0', 'period' => $this->term, 'rant_no' => '', 'reg_domain' => '', 'reg_password' => '', 'reg_type' => 'new', 'reg_username' => $this->account['username'], 'nameserver_list' => array('0' => array('sortorder' => '1', 'name' => $this->ns1), '1' => array('sortorder' => '2', 'name' => $this->ns2)), 'tld_data' => array('forwarding_email' => $this->account['email'], 'nexus' => array('app_purpose' => '', 'category' => '', 'validator' => '')), 'contact_set' => array('admin' => array('address1' => $this->account['address1'], 'address2' => $this->account['address2'], 'address3' => '', 'city' => $this->account['city'], 'country' => 'US', 'email' => $this->account['email'], 'fax' => '', 'first_name' => $this->account['first_name'], 'last_name' => $this->account['last_name'], 'lang_pref' => 'EN', 'org_name' => $this->account['company'], 'phone' => '888-555-1212', 'postal_code' => $this->account['zip'], 'state' => $this->account['state'], 'url' => 'http://' . $this->domain_name), 'billing' => array('address1' => $this->account['address1'], 'address2' => $this->account['address2'], 'address3' => '', 'city' => $this->account['city'], 'country' => 'US', 'email' => $this->account['email'], 'fax' => '', 'first_name' => $this->account['first_name'], 'last_name' => $this->account['last_name'], 'lang_pref' => 'EN', 'org_name' => $this->account['company'], 'phone' => '888-555-1212', 'postal_code' => $this->account['zip'], 'state' => $this->account['state'], 'url' => 'http://' . $this->domain_name), 'owner' => array('address1' => $this->account['address1'], 'address2' => $this->account['address2'], 'address3' => '', 'city' => $this->account['city'], 'country' => 'US', 'email' => $this->account['email'], 'fax' => '', 'first_name' => $this->account['first_name'], 'last_name' => $this->account['last_name'], 'lang_pref' => 'EN', 'org_name' => $this->account['company'], 'phone' => '888-555-1212', 'postal_code' => $this->account['zip'], 'state' => $this->account['state'], 'url' => 'http://' . $this->domain_name))));
     # get the result
     $result = $O->send_cmd($cmd);
     # debug
     if ($this->registrar['debug'] == 1) {
         echo "<h1>Command</h1>\n";
         print_r($cmd);
         echo "<HR />";
         echo "<h1>Result</h1>\n";
         print_r($result);
         echo "<h1>Command</h1>\n";
         print_r($cmd);
         echo "<HR />";
         echo "<h1>Log</h1>\n";
         $O->showlog();
         echo "<HR />";
         echo "<h1>OPS XML Log</h1>\n";
         $O->_OPS->showlog('xml');
         echo "<HR />";
         echo "<h1>OPS Raw Log</h1>\n";
         $O->_OPS->showlog('raw');
     }
     if (@$result['is_success'] == 1) {
         return TRUE;
     } else {
         return FALSE;
     }
 }