Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Added the possibility to use https:// with whoisproxy.php
Browse files Browse the repository at this point in the history
On Settings, add https:// or http:// before your domain URL to use of
them. Automatically switches to http:// if none specified.
  • Loading branch information
MikyKuroneko committed Dec 22, 2015
1 parent c944df6 commit 51adde0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions ddwhois.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,23 @@ function ddwhois_setup( array $vars, $new_tld )
$server = $components[1];
$match = $components[2];

$domain = ddwhois_get( 'domain' );

if( substr( $domain, 0, 4 ) != 'http' ){
$domain = 'http://' . $domain;
}

//TLD found; modify its settings
if( $tld == $new_tld ){
$whois_database[$whois_id] = $tld . '|http://' . ddwhois_get( 'domain' ) . $route . '/modules/addons/ddwhois/whoisproxy.php?domain=|HTTPREQUEST-DDAVAILABLE' . "\r\n";
$whois_database[$whois_id] = $tld . '|' . $domain . $route . '/modules/addons/ddwhois/whoisproxy.php?domain=|HTTPREQUEST-DDAVAILABLE' . "\r\n";

$found = true;
}
}

//TLD not found in current file; add it to the bottom
if( !$found ){
$whois_database[] = $new_tld . '|http://' . ddwhois_get( 'domain' ) . $route . '/modules/addons/ddwhois/whoisproxy.php?domain=|HTTPREQUEST-DDAVAILABLE' . "\r\n";
$whois_database[] = $new_tld . '|' . $domain . $route . '/modules/addons/ddwhois/whoisproxy.php?domain=|HTTPREQUEST-DDAVAILABLE' . "\r\n";
}

//Save the resulting file
Expand Down Expand Up @@ -439,8 +445,6 @@ function ddwhois_backup()
function ddwhois_save_settings( array $settings )
{

$settings['domain'] = str_replace( array( 'http://', 'https://' ), array( '', '' ), $settings['domain'] );

$username = ddwhois_set( 'apiUsername', trim($settings['apiuser']) );
$password = ddwhois_set( 'apiPassword', trim($settings['apipasswd']) );
$domain = ddwhois_set( 'domain', trim( $settings['domain'] ));
Expand Down
2 changes: 1 addition & 1 deletion lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'config_username' => 'API Username',
'config_password' => 'API Password',
'config_domain' => 'Access domain',
'config_domain_info' => 'This is the domain name where your WHMCS frontend is hosted, without http:// or https://.',
'config_domain_info' => 'This is the domain name where your WHMCS frontend is hosted, con http:// o https://.',
'config_ip' => 'Allowed IPs',
'config_ip_info' => 'Only requests coming from these IPs will be allowed to access the Whois proxy. Separate IPs with ;.',
'config_save' => 'Save settings',
Expand Down
2 changes: 1 addition & 1 deletion lang/spanish.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'config_username' => 'Usuario de API',
'config_password' => 'Contraseña de API',
'config_domain' => 'Dominio de acceso',
'config_domain_info' => 'Este es el dominio donde se aloja tu frontend de WHMCS, sin http:// o https://.',
'config_domain_info' => 'Este es el dominio donde se aloja tu frontend de WHMCS, con http:// o https://.',
'config_ip' => 'IPs permitidas',
'config_ip_info' => 'Sólo las peticiones provenientes de estas IPs tendrán acceso al proxy de Whois. Separa varias IPs con ;.',
'config_save' => 'Guardar cambios',
Expand Down
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.3",
"releaseDate": "2015-12-17"
"version": "0.4",
"releaseDate": "2015-12-22"
}

0 comments on commit 51adde0

Please sign in to comment.