array( 'Type' => 'System', 'Value' => 'OnlineNIC' ), 'Username' => array( 'Type' => 'text', 'Size' => '20', 'Description' => 'Onlinenic ID' ), 'Password' => array( 'Type' => 'password', 'Size' => '20', 'Description' => 'Password' ), 'TestMode' => array( 'Type' => 'yesno' ), 'SyncNextDueDate' => array( 'Type' => 'yesno', 'Description', 'Tick this box if you want the expiry date sync script to update the expiry and next due dates (cron must be configured)' ) );
return $configarray;
}
function onlinenic_GetNameservers($params) {
$username = $params['Username'];
$password = md5( $params['Password'] );
$testmode = $params['TestMode'];
$tld = $params['tld'];
$sld = $params['sld'];
$domain = $sld . '.' . $tld;
if ($testmode) {
$username = 135613;
$password = md5( '654123' );
}
$values = onlinenic_Login( $fp, $username, $password, $testmode );
if ($values['error']) {
return $values;
}
$domain_type = onlinenic_getDomainType( $tld );
$clTrid = substr( md5( $domain ), 0, 10 ) . mt_rand( 1000000000, 9999999999 );
$checksum = md5( $username . $password . $clTrid . 'getdomaininfo' );
$xml = '
' . $username . '
' . $domain . '
' . $domain_type . '
1.0
en
' . $clTrid . '
' . $checksum . '
';
$result = onlinenic_sendCommand( $fp, $xml );
if (!$result) {
return array( 'error' => 'Domain not found' );
}
$resultcode = onlinenic_getResultCode( $result );
onlinenic_Logout( $fp, $username, $password );
if ($resultcode != '1000') {
$msg = onlinenic_GetValue( $result, '', '' );
$error = onlinenic_GetValue( $result, '', '' );
$error = $msg . ' - ' . $error;
$errormsg = onlinenic_getResultText( $resultcode );
$values['error'] = '' . $resultcode . ' - ' . $errormsg . ': ' . $error;
} else {
$nameserver1 = onlinenic_GetValue( $result, '', '' );
$nameserver2 = onlinenic_GetValue( $result, '', '' );
$values['ns1'] = trim( $nameserver1 );
$values['ns2'] = trim( $nameserver2 );
$values['ns3'] = trim( $nameserver3 );
$values['ns4'] = trim( $nameserver4 );
$values['ns5'] = trim( $nameserver5 );
}
return $values;
}
function onlinenic_SaveNameservers($params) {
$username = $params['Username'];
$password = md5( $params['Password'] );
$testmode = $params['TestMode'];
$tld = $params['tld'];
$sld = $params['sld'];
if ($testmode) {
$username = 135613;
$password = md5( '654123' );
}
$domain = $sld . '.' . $tld;
$values = onlinenic_Login( $fp, $username, $password, $testmode );
if ($values['error']) {
return $values;
}
$domain_type = onlinenic_getDomainType( $tld );
$dns1 = $params['ns1'];
$dns2 = $params['ns2'];
$dns3 = $params['ns3'];
$dns4 = $params['ns4'];
$dns5 = $params['ns5'];
.............................................................
..................................
...............