From eed28805dd02aeb49be381c63521735346fbb488 Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Fri, 24 Feb 2023 13:38:35 -0600 Subject: [PATCH] Change this repo to hold the whole ddns code - planning to re-implement in react --- php/index.php | 200 ++++++++++++++++++++++++++++++ ddnsupd.sh => updaters/ddnsupd.sh | 0 ddnsurl => updaters/ddnsurl | 0 3 files changed, 200 insertions(+) create mode 100644 php/index.php rename ddnsupd.sh => updaters/ddnsupd.sh (100%) rename ddnsurl => updaters/ddnsurl (100%) diff --git a/php/index.php b/php/index.php new file mode 100644 index 0000000..ba41e10 --- /dev/null +++ b/php/index.php @@ -0,0 +1,200 @@ + 255) + return false; + } + return true; + } + + function getFormValue($varname, $defaultValue){ + $retVal=$defaultValue; + if ( isset($_POST[$varname]) ) + { + $retVal = $_POST[$varname]; + } + else if ( isset($_GET[$varname]) ) + { + $retVal = $_GET[$varname]; + } + return $retVal; + } + + $remoteip = $_SERVER['REMOTE_ADDR']; + + // retrieve parameters + $ip = getFormValue('address',$_SERVER['REMOTE_ADDR']); + if ($ip=="") {$ip=$remoteip;} + $autoupdate=getFormValue('autoupdate',0); + $subdomain = getFormValue('domain',null); + + // open log session + openlog("DDNS-Provider", LOG_PID | LOG_PERROR, LOG_LOCAL0); + + // check for given domain + if (is_null($subdomain)) { + // No Domain; display form +?> + + + + + Dynamic DNS Updater + + + + + +

Enter Dynamic DNS details

+
+
+
Subdomain-name (required):
.ddns.kawomi.com
+ +
Password (optional, sent as clear text, required to update if given)
+ +
E-Mail (optional, password recovery mail is sent to this address)
+ + + + + + + +
Manual Overwrite IP Address(optional)
<-- OR -->
AutoUpdate (only AutoAddress)
Minutes.
+ +
+Update-URL:
+
+ +
+ + + 0 and $autoupdate <= 60) { + ?> +
+ autoupdate requested, refreshing address every minutes.
+ Countdown: + + + + diff --git a/ddnsupd.sh b/updaters/ddnsupd.sh similarity index 100% rename from ddnsupd.sh rename to updaters/ddnsupd.sh diff --git a/ddnsurl b/updaters/ddnsurl similarity index 100% rename from ddnsurl rename to updaters/ddnsurl