Example #1
0
 * 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";
$O->_OPS->showlog('raw');
Example #2
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;
     }
 }