ddns.cgi: Fix token auth for provider regfish.com.

In the past the regfish.com auth token was stored as username similar than freedns.afraid.com. We now expected
the token key stored as password, to keep compatiblity with old installations I've added some compatible code
to prevent users from various issues.
This commit is contained in:
Stefan Schantl
2014-08-01 19:56:52 +02:00
committed by Michael Tremer
parent b3f401fba4
commit 5fe185f83c

View File

@@ -187,7 +187,7 @@ if (($settings{'ACTION'} eq $Lang::tr{'add'}) || ($settings{'ACTION'} eq $Lang::
# Check if a password has been typed in.
# freedns.afraid.org does not require this field.
if (($settings{'PASSWORD'} eq '') && ($settings{'SERVICE'} ne 'freedns.afraid.org')) {
if (($settings{'PASSWORD'} eq '') && ($settings{'SERVICE'} ne 'freedns.afraid.org') && ($settings{'SERVICE'} ne 'regfish.com')) {
$errormessage = $Lang::tr{'password not set'};
}
@@ -650,8 +650,8 @@ sub GenerateDDNSConfigFile {
if ($provider ~~ ["dns.lightningwirelabs.com", "entrydns.net", "regfish.com"] && $username eq "token") {
$use_token = 1;
# Handle token auth for freedns.afraid.org.
} elsif ($provider eq "freedns.afraid.org" && $password eq "") {
# Handle token auth for freedns.afraid.org and regfish.com.
} elsif ($provider ~~ ["freedns.afraid.org", "regfish.com"] && $password eq "") {
$use_token = 1;
$password = $username;