Skip to content

Commit

Permalink
Merge branch 'v1.0.49' into 'master'
Browse files Browse the repository at this point in the history
V1.0.49

See merge request !6
  • Loading branch information
AnthonySchneider-cnic committed Jul 5, 2017
2 parents c1f9cf3 + 8888a39 commit 9671c4e
Show file tree
Hide file tree
Showing 6 changed files with 240 additions and 6 deletions.
4 changes: 4 additions & 0 deletions registrars/ispapi/Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ ______________________________________________________________________________
Changelog
______________________________________________________________________________

v1.0.49 - 2017-07-05
- added DNSSEC Management functionality (Can be configured in the Registrar Module Settings)
- improvements in the DNS Management (X-HTTP)

v1.0.48 - 2017-06-22
- improvement in the TransferSync function: set expirydate to paiduntildate when failuredate > paiduntildate

Expand Down
Binary file modified registrars/ispapi/README.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions registrars/ispapi/additionaldomainfields_sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@
$additionaldomainfields[".net.cn"] = $additionaldomainfields[".cn"];
$additionaldomainfields[".org.cn"] = $additionaldomainfields[".cn"];

## ## .COM.AU DOMAIN REQUIREMENTS ##
## .COM.AU DOMAIN REQUIREMENTS ##
$additionaldomainfields[".com.au"] = array();

$additionaldomainfields[".com.au"][] = array(
Expand Down Expand Up @@ -746,7 +746,7 @@
$additionaldomainfields[".org.au"] = $additionaldomainfields[".com.au"];
$additionaldomainfields[".id.au"] = $additionaldomainfields[".com.au"];

## ## .LV DOMAIN REQUIREMENTS ##
## .LV DOMAIN REQUIREMENTS ##

$additionaldomainfields[".lv"] = array();

Expand All @@ -766,7 +766,7 @@
"Ispapi-Name" => "X-IDNUMBER"
);

## ## .PT DOMAIN REQUIREMENTS ##
## .PT DOMAIN REQUIREMENTS ##
$additionaldomainfields[".pt"] = array();

$additionaldomainfields[".pt"][] = array(
Expand Down
99 changes: 99 additions & 0 deletions registrars/ispapi/dnssec.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<h3 style="margin-bottom:25px;">DNSSEC Management</h3>

{if $successful}
<div class="alert alert-success text-center">
<p>{$LANG.changessavedsuccessfully}</p>
</div>
{/if}

{if $error}
<div class="alert alert-danger text-center">
<p>{$error}</p>
</div>
{/if}

<form method="POST" action="{$smarty.server.PHP_SELF}">
<input type="hidden" name="action" value="domaindetails">
<input type="hidden" name="id" value="{$domainid}">
<input type="hidden" name="modop" value="custom">
<input type="hidden" name="a" value="dnssec">
<input type="hidden" name="submit" value="1">

<h4>DS records</h4>
<table class="table table-striped">
<thead>
<tr>
<th style="width:100px;">Key Tag</th>
<th style="width:100px;">Algorithm</th>
<th style="width:100px;">Digest Type</th>
<th>Digest</th>
</tr>
</thead>
<tbody>
{foreach item=ds from=$secdnsds name=secdnsds}
<tr>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index}][keytag]" value="{$ds.keytag}"></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index}][alg]" value="{$ds.alg}"></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index}][digesttype]" value="{$ds.digesttype}"></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index}][digest]" value="{$ds.digest}"></td>
</tr>
{/foreach}
<tr>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index+1}][keytag]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index+1}][alg]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index+1}][digesttype]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-DS[{$smarty.foreach.secdnsds.index+1}][digest]" value=""></td>
</tr>
</tbody>
</table>

<h4>KEY records</h4>
<table class="table table-striped">
<thead>
<tr>
<th style="width:100px;">Flags</th>
<th style="width:100px;">Protocol</th>
<th style="width:100px;">Algorithm</th>
<th>Public Key</th>
</tr>
</thead>
<tbody>
{foreach item=key from=$secdnskey name=secdnskey}
<tr>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index}][flags]" value="{$key.flags}"></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index}][protocol]" value="{$key.protocol}"></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index}][alg]" value="{$key.alg}"></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index}][pubkey]" value="{$key.pubkey}"></td>
</tr>
{/foreach}
<tr>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index+1}][flags]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index+1}][protocol]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index+1}][alg]" value=""></td>
<td><input class="form-control" type="text" name="SECDNS-KEY[{$smarty.foreach.secdnskey.index+1}][pubkey]" value=""></td>
</tr>
</tbody>
</table>

<h4>MaxSigLife (optional)</h4>
<table class="table table-striped">
<tr><td><input style="width:200px;" class="form-control" type="text" name="MAXSIGLIFE" value="{$maxsiglife}"></td></tr>
</table>

<!-- <h4>Urgent (Optional)</h4>
<div class="alert alert-info">This parameter is used to ask the server operator to complete and implement the update request with high priority.<br>
The use of this flag depends on the registry operator, many TLDs will silently ignore it.</div>
<table class="table table-striped">
<tr><td>
<select name="URGENT">
<option value="0">No</option>
<option value="1">YES</option>
</select>
</td></tr>
</table> -->

<p class="text-center">
<input class="btn btn-large btn-primary" type="submit" value="{$LANG.clientareasavechanges}">
</p>

</form>
137 changes: 134 additions & 3 deletions registrars/ispapi/ispapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function ispapi_getConfigArray($params) {
"TestMode" => array( "Type" => "yesno", "Description" => "Connect to OT&amp;E (Test Environment)" ),
"ProxyServer" => array( "Type" => "text", "Description" => "Optional (HTTP(S) Proxy Server)" ),
"ConvertIDNs" => array( "Type" => "dropdown", "Options" => "API,PHP", "Default" => "API", "Description" => "Use API or PHP function (idn_to_ascii)" ),
"DNSSEC" => array( "Type" => "yesno", "Description" => "Display the DNSSEC Management functionality in the domain details" ),
);
if ( !function_exists('idn_to_ascii') ) {
$configarray["ConvertIDNs"] = array( "Type" => "dropdown", "Options" => "API", "Default" => "API", "Description" => "Use API (PHP function idn_to_ascii not available)" );
Expand Down Expand Up @@ -119,9 +120,129 @@ function ispapi_ClientAreaCustomButtonArray($params) {
if ( $data && (preg_match('/[.]sg$/i', $data["domain"])) ) {
$buttonarray[".SG Change of Registrant"] = "registrantmodification_tld";
}

if($params["DNSSEC"] == "on"){
$buttonarray["DNSSEC Management"] = "dnssec";
}

return $buttonarray;
}

function ispapi_dnssec($params) {
$origparams = $params;
if ( isset($params["original"]) ) {
$params = $params["original"];
}
$error = false;
$successful = false;
$domain = $params["sld"].".".$params["tld"];

if(isset($_POST["submit"])){

$command = array(
"COMMAND" => "ModifyDomain",
"DOMAIN" => $domain,
"SECDNS-MAXSIGLIFE" => $_POST["MAXSIGLIFE"],
//"SECDNS-URGENT" => $_POST["URGENT"]
);

//add DS records
$command["SECDNS-DS"] = array();
if(isset($_POST["SECDNS-DS"])){
foreach ($_POST["SECDNS-DS"] as $dnssecrecord) {
$everything_empty = true;
foreach($dnssecrecord as $attribute){
if(!empty($attribute))
$everything_empty = false;
}
if(!$everything_empty)
array_push($command["SECDNS-DS"], implode(" ", $dnssecrecord));
}
}

//remove DS records - bugfix
if(empty($command["SECDNS-DS"])){
unset($command["SECDNS-DS"]);
$secdnsds = array();
$command2 = array(
"COMMAND" => "StatusDomain",
"DOMAIN" => $domain
);
$response = ispapi_call($command2, ispapi_config($params));
if ( $response["CODE"] == 200 ) {
$secdnsds = (isset($response["PROPERTY"]["SECDNS-DS"])) ? $response["PROPERTY"]["SECDNS-DS"] : array();
}
$command["DELSECDNS-DS"] = array();
foreach($secdnsds as $item){
array_push($command["DELSECDNS-DS"], $item);
}
}

//add KEY records
$command["SECDNS-KEY"] = array();
if(isset($_POST["SECDNS-KEY"])){
foreach ($_POST["SECDNS-KEY"] as $dnssecrecord) {
$everything_empty = true;
foreach($dnssecrecord as $attribute){
if(!empty($attribute))
$everything_empty = false;
}
if(!$everything_empty)
array_push($command["SECDNS-KEY"], implode(" ", $dnssecrecord));
}
}

$response = ispapi_call($command, ispapi_config($params));
if ( $response["CODE"] == 200 ) {
$successful = $response["DESCRIPTION"];
}else {
$error = $response["DESCRIPTION"];
}
}

$secdnsds = array();
$secdnskey = array();
$maxsiglife = "";
$command = array(
"COMMAND" => "StatusDomain",
"DOMAIN" => $domain
);
$response = ispapi_call($command, ispapi_config($params));

if ( $response["CODE"] == 200 ) {
$maxsiglife = (isset($response["PROPERTY"]["SECDNS-MAXSIGLIFE"])) ? $response["PROPERTY"]["SECDNS-MAXSIGLIFE"][0] : "";
$secdnsds = (isset($response["PROPERTY"]["SECDNS-DS"])) ? $response["PROPERTY"]["SECDNS-DS"] : array();
$secdnskey = (isset($response["PROPERTY"]["SECDNS-KEY"])) ? $response["PROPERTY"]["SECDNS-KEY"] : array();
//delete empty KEY records
$secdnskeynew = array();
foreach($secdnskey as $k){
if(!empty($k))
$secdnskeynew[] = $k;
}
$secdnskey = $secdnskeynew;
}else{
$error = $response["DESCRIPTION"];
}

//split in different fields
$secdnsds_newformat = array();
foreach($secdnsds as $ds){
list($keytag, $alg, $digesttype, $digest) = split(" ", $ds, 4);
array_push($secdnsds_newformat, array("keytag" => $keytag, "alg" => $alg, "digesttype" => $digesttype, "digest" => $digest));
}

$secdnskey_newformat = array();
foreach($secdnskey as $key){
list($flags, $protocol, $alg, $pubkey) = split(" ", $key, 4);
array_push($secdnskey_newformat, array("flags" => $flags, "protocol" => $protocol, "alg" => $alg, "pubkey" => $pubkey));
}

return array(
'templatefile' => "dnssec",
'vars' => array('error' => $error, 'successful' => $successful, 'secdnsds' => $secdnsds_newformat, 'secdnskey' => $secdnskey_newformat, 'maxsiglife' => $maxsiglife )
);
}

function ispapi_registrantmodification_it($params) {
$origparams = $params;
if ( isset($params["original"]) ) {
Expand Down Expand Up @@ -818,9 +939,9 @@ function ispapi_GetDNS($params) {
if ( $rrtype == "X-HTTP" ) {
if ( preg_match('/^\//', $fields[0]) ) {
$domain .= array_shift($fields);
while(substr($domain, -1)=="/"){
/*while(substr($domain, -1)=="/"){
$domain = substr_replace($domain, "", -1);
}
}*/
}

$url_type = array_shift($fields);
Expand Down Expand Up @@ -1389,6 +1510,16 @@ function ispapi_RegisterDomain($params) {
"BILLINGCONTACT0" => $admin
);

//add NS Entries for .de domains to redirect to the landing page
if(strtolower($params["tld"]) == "de"){
$command["NAMESERVER0"] = "";
$command["NAMESERVER1"] = "";
$command["X-DE-NSENTRY0"] = "www.$domain IN A 144.76.201.8";
$command["X-DE-NSENTRY1"] = "$domain IN A 144.76.201.8";
unset($command["NAMESERVER2"]);
unset($command["NAMESERVER3"]);
}

if ( $params["dnsmanagement"] ) {
$command["INTERNALDNS"] = 1;
}
Expand Down Expand Up @@ -2079,5 +2210,5 @@ function ispapi_parse_response ( $response ) {
return $hash;
}

ispapi_InitModule("1.0.48");
ispapi_InitModule("1.0.49");
?>
Binary file modified registrars/ispapi/ispapi_whmcs_documentation.odt
Binary file not shown.

0 comments on commit 9671c4e

Please sign in to comment.