Commit 59f71633 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) refactor services_dyndns_edit.php

parent 04e95895
...@@ -32,54 +32,54 @@ require_once("services.inc") ; ...@@ -32,54 +32,54 @@ require_once("services.inc") ;
require_once("interfaces.inc"); require_once("interfaces.inc");
/* returns true if $uname is a valid dynamic DNS username */ /* returns true if $uname is a valid dynamic DNS username */
function is_dyndns_username($uname) { function is_dyndns_username($uname)
if (!is_string($uname)) {
if (!is_string($uname)) {
return false; return false;
} elseif (preg_match("/[^a-z0-9\-.@_:]/i", $uname)) {
if (preg_match("/[^a-z0-9\-.@_:]/i", $uname))
return false; return false;
else } else {
return true; return true;
}
} }
if (!isset($config['dyndnses']['dyndns'])) { if (!isset($config['dyndnses']['dyndns'])) {
$config['dyndnses']['dyndns'] = array(); $config['dyndnses']['dyndns'] = array();
} }
$a_dyndns = &$config['dyndnses']['dyndns']; $a_dyndns = &$config['dyndnses']['dyndns'];
if (is_numericint($_GET['id'])) if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($_GET['id']) && !empty($a_dyndns[$_GET['id']])) {
$id = $_GET['id']; $id = $_GET['id'];
if (isset($_POST['id']) && is_numericint($_POST['id'])) }
$id = $_POST['id']; $config_copy_fieldnames = array('username', 'password', 'host', 'mx', 'type', 'zoneid', 'ttl', 'updateurl',
'resultmatch', 'requestif', 'descr', 'interface');
if (isset($id) && isset($a_dyndns[$id])) { foreach ($config_copy_fieldnames as $fieldname) {
$pconfig['username'] = $a_dyndns[$id]['username']; if (isset($id) && isset($a_dyndns[$id][$fieldname])) {
$pconfig['password'] = $a_dyndns[$id]['password']; $pconfig[$fieldname] = $a_dyndns[$id][$fieldname];
$pconfig['host'] = $a_dyndns[$id]['host']; } else {
$pconfig['mx'] = $a_dyndns[$id]['mx']; $pconfig[$fieldname] = null;
$pconfig['type'] = $a_dyndns[$id]['type']; }
$pconfig['enable'] = !isset($a_dyndns[$id]['enable']); }
$pconfig['interface'] = $a_dyndns[$id]['interface'];
$pconfig['wildcard'] = isset($a_dyndns[$id]['wildcard']);
$pconfig['verboselog'] = isset($a_dyndns[$id]['verboselog']);
$pconfig['curl_ipresolve_v4'] = isset($a_dyndns[$id]['curl_ipresolve_v4']);
$pconfig['curl_ssl_verifypeer'] = isset($a_dyndns[$id]['curl_ssl_verifypeer']);
$pconfig['zoneid'] = $a_dyndns[$id]['zoneid'];
$pconfig['ttl'] = $a_dyndns[$id]['ttl'];
$pconfig['updateurl'] = $a_dyndns[$id]['updateurl'];
$pconfig['resultmatch'] = $a_dyndns[$id]['resultmatch'];
$pconfig['requestif'] = $a_dyndns[$id]['requestif'];
$pconfig['descr'] = $a_dyndns[$id]['descr'];
}
if ($_POST) {
unset($input_errors); if (isset($id)) {
$pconfig['enable'] = isset($a_dyndns[$id]['enable']);
} else {
$pconfig['enable'] = true;
}
$pconfig['wildcard'] = isset($id) && isset($a_dyndns[$id]['wildcard']);
$pconfig['verboselog'] = isset($id) && isset($a_dyndns[$id]['verboselog']);
$pconfig['curl_ipresolve_v4'] = isset($id) && isset($a_dyndns[$id]['curl_ipresolve_v4']);
$pconfig['curl_ssl_verifypeer'] = isset($id) && isset($a_dyndns[$id]['curl_ssl_verifypeer']);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
if (isset($_POST['id']) && !empty($a_dyndns[$_POST['id']])) {
$id = $_POST['id'];
}
$input_errors = array();
$pconfig = $_POST; $pconfig = $_POST;
if(($pconfig['type'] == "freedns" || $pconfig['type'] == "namecheap") && $pconfig['username'] == "") {
if(($pconfig['type'] == "freedns" || $pconfig['type'] == "namecheap") && $_POST['username'] == "") $pconfig['username'] = "none";
$_POST['username'] = "none"; }
/* input validation */ /* input validation */
$reqdfields = array(); $reqdfields = array();
...@@ -100,85 +100,80 @@ if ($_POST) { ...@@ -100,85 +100,80 @@ if ($_POST) {
$reqdfieldsn[] = gettext('Update URL'); $reqdfieldsn[] = gettext('Update URL');
} }
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
if (isset($_POST['host']) && in_array('host', $reqdfields)) { if (isset($pconfig['host']) && in_array('host', $reqdfields)) {
/* Namecheap can have a @. in hostname */ /* Namecheap can have a @. in hostname */
if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.') if ($pconfig['type'] == "namecheap" && substr($pconfig['host'], 0, 2) == '@.') {
$host_to_check = substr($_POST['host'], 2); $host_to_check = substr($pconfig['host'], 2);
else } else {
$host_to_check = $_POST['host']; $host_to_check = $pconfig['host'];
}
if (!is_domain($host_to_check)) if (!is_domain($host_to_check)) {
$input_errors[] = gettext("The Hostname contains invalid characters."); $input_errors[] = gettext("The Hostname contains invalid characters.");
}
unset($host_to_check);
} }
if (($_POST['mx'] && !is_domain($_POST['mx']))) if (!empty($pconfig['mx']) && !is_domain($pconfig['mx'])) {
$input_errors[] = gettext("The MX contains invalid characters."); $input_errors[] = gettext("The MX contains invalid characters.");
if ((in_array("username", $reqdfields) && $_POST['username'] && !is_dyndns_username($_POST['username'])) || ((in_array("username", $reqdfields)) && ($_POST['username'] == ""))) }
if ((in_array("username", $reqdfields) && !empty($pconfig['username']) && !is_dyndns_username($pconfig['username'])) || ((in_array("username", $reqdfields)) && ($pconfig['username'] == ""))) {
$input_errors[] = gettext("The username contains invalid characters."); $input_errors[] = gettext("The username contains invalid characters.");
}
if (!$input_errors) { if (count($input_errors) == 0) {
$dyndns = array(); $dyndns = array();
$dyndns['type'] = $_POST['type']; $dyndns['type'] = $pconfig['type'];
$dyndns['username'] = $_POST['username']; $dyndns['username'] = $pconfig['username'];
$dyndns['password'] = $_POST['password']; $dyndns['password'] = $pconfig['password'];
$dyndns['host'] = $_POST['host']; $dyndns['host'] = $pconfig['host'];
$dyndns['mx'] = $_POST['mx']; $dyndns['mx'] = $pconfig['mx'];
$dyndns['wildcard'] = $_POST['wildcard'] ? true : false; $dyndns['wildcard'] = !empty($pconfig['wildcard']);
$dyndns['verboselog'] = $_POST['verboselog'] ? true : false; $dyndns['verboselog'] = !empty($pconfig['verboselog']);
$dyndns['curl_ipresolve_v4'] = $_POST['curl_ipresolve_v4'] ? true : false; $dyndns['curl_ipresolve_v4'] = !empty($pconfig['curl_ipresolve_v4']);
$dyndns['curl_ssl_verifypeer'] = $_POST['curl_ssl_verifypeer'] ? true : false; $dyndns['curl_ssl_verifypeer'] = !empty($pconfig['curl_ssl_verifypeer']);
/* In this place enable means disabled */ $dyndns['enable'] = !empty($pconfig['enable']);
if ($_POST['enable']) $dyndns['interface'] = $pconfig['interface'];
unset($dyndns['enable']); $dyndns['zoneid'] = $pconfig['zoneid'];
else $dyndns['ttl'] = $pconfig['ttl'];
$dyndns['enable'] = true; $dyndns['updateurl'] = $pconfig['updateurl'];
$dyndns['interface'] = $_POST['interface'];
$dyndns['zoneid'] = $_POST['zoneid'];
$dyndns['ttl'] = $_POST['ttl'];
$dyndns['updateurl'] = $_POST['updateurl'];
// Trim hard-to-type but sometimes returned characters // Trim hard-to-type but sometimes returned characters
$dyndns['resultmatch'] = trim($_POST['resultmatch'], "\t\n\r"); $dyndns['resultmatch'] = trim($pconfig['resultmatch'], "\t\n\r");
($dyndns['type'] == "custom" || $dyndns['type'] == "custom-v6") ? $dyndns['requestif'] = $_POST['requestif'] : $dyndns['requestif'] = $_POST['interface']; ($dyndns['type'] == "custom" || $dyndns['type'] == "custom-v6") ? $dyndns['requestif'] = $pconfig['requestif'] : $dyndns['requestif'] = $pconfig['interface'];
$dyndns['descr'] = $_POST['descr']; $dyndns['descr'] = $pconfig['descr'];
$dyndns['force'] = isset($_POST['force']); $dyndns['force'] = isset($pconfig['force']);
if ($dyndns['username'] == "none") {
if($dyndns['username'] == "none")
$dyndns['username'] = ""; $dyndns['username'] = "";
}
if (isset($id) && $a_dyndns[$id]) if (isset($id)) {
$a_dyndns[$id] = $dyndns; $a_dyndns[$id] = $dyndns;
else { } else {
$a_dyndns[] = $dyndns; $a_dyndns[] = $dyndns;
$id = count($a_dyndns) - 1; $id = count($a_dyndns) - 1;
} }
$dyndns['id'] = $id; $dyndns['id'] = $id;
//Probably overkill, but its better to be safe
for($i = 0; $i < count($a_dyndns); $i++) { for($i = 0; $i < count($a_dyndns); $i++) {
$a_dyndns[$i]['id'] = $i; $a_dyndns[$i]['id'] = $i;
} }
write_config(); write_config();
services_dyndns_configure_client($dyndns); services_dyndns_configure_client($dyndns);
header("Location: services_dyndns.php"); header("Location: services_dyndns.php");
exit; exit;
} }
} }
include("head.inc");
legacy_html_escape_form_data($pconfig);
include("head.inc");
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function _onTypeChange(type){ function _onTypeChange(type){
...@@ -222,186 +217,172 @@ include("head.inc"); ...@@ -222,186 +217,172 @@ include("head.inc");
</script> </script>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<?php if (isset($savemsg)) print_info_box($savemsg); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form method="post" name="iform" id="iform">
<form action="services_dyndns_edit.php" method="post" name="iform" id="iform">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort"> <table class="table table-striped">
<tr> <tr>
<td colspan="2" valign="top" class="optsect_t"> <td width="22%"><strong><?=gettext("Dynamic DNS client");?></strong></td>
<table border="0" cellspacing="0" cellpadding="0" width="100%" summary="title"> <td width="78%" align="right">
<tr><td class="optsect_s"><strong><?=gettext("Dynamic DNS client");?></strong></td></tr> <small><?=gettext("full help"); ?> </small>
</table> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i></a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Disable");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Enable");?></td>
<td width="78%" class="vtable"> <td>
<input name="enable" type="checkbox" id="enable" value="<?=gettext("yes");?>" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> /> <input name="enable" type="checkbox" id="enable" value="<?=gettext("yes");?>" <?=!empty($pconfig['enable']) ? "checked=\"checked\"" : ""; ?> />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Service type");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Service type");?></td>
<td width="78%" class="vtable"> <td>
<select name="type" class="formselect" id="type" onchange="_onTypeChange(this.options[this.selectedIndex].value);"> <select name="type" class="selectpicker" id="type" onchange="_onTypeChange(this.options[this.selectedIndex].value);">
<?php <?php
$types = services_dyndns_list(); foreach (services_dyndns_list() as $value => $type):?>
foreach ($types as $value => $type) { <option value="<?=$value;?>" <?= $value == $pconfig['type'] ? 'selected="selected"' : "";?>>
?> <?=$type;?>
<option value="<?=$value;?>" <?php if ($value == $pconfig['type']) echo 'selected="selected"';?>><?=htmlspecialchars($type);?></option> </option>
<?php <?php
} endforeach;?>
?> </select>
</select></td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to monitor");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Interface to monitor");?></td>
<td width="78%" class="vtable"> <td>
<select name="interface" class="formselect" id="interface"> <select name="interface" class="selectpicker" id="interface">
<?php <?php
$iflist = get_configured_interface_with_descr(); $iflist = get_configured_interface_with_descr();
foreach ($iflist as $if => $ifdesc) { $iflist = array_merge($iflist, return_gateway_groups_array());
echo "<option value=\"{$if}\""; foreach ($iflist as $if => $ifdesc):?>
if ($pconfig['interface'] == $if) <option value="<?=$if;?>" <?=$pconfig['interface'] == $if ? "selected=\"selected\"" : "";?>>
echo "selected=\"selected\""; <?=htmlspecialchars($ifdesc);?>
echo ">{$ifdesc}</option>\n"; </option>
}
unset($iflist); <?php
$grouplist = return_gateway_groups_array(); endforeach;?>
foreach ($grouplist as $name => $group) {
echo "<option value=\"{$name}\"";
if ($pconfig['interface'] == $name)
echo "selected=\"selected\"";
echo ">GW Group {$name}</option>\n";
}
unset($grouplist);
?>
</select> </select>
</td> </td>
</tr> </tr>
<tr id="_requestiftr"> <tr id="_requestiftr">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Interface to send update from");?></td> <td><a id="help_for_requestif" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Interface to send update from");?></td>
<td width="78%" class="vtable"> <td>
<select name="requestif" class="formselect" id="requestif"> <select name="requestif" class="selectpicker" id="requestif">
<?php <?php
$iflist = get_configured_interface_with_descr(); $iflist = get_configured_interface_with_descr();
foreach ($iflist as $if => $ifdesc) { $iflist = array_merge($iflist, return_gateway_groups_array());
echo "<option value=\"{$if}\""; foreach ($iflist as $if => $ifdesc):?>
if ($pconfig['requestif'] == $if) <option value="<?=$if;?>" <?=$pconfig['requestif'] == $if ? "selected=\"selected\"" : "";?>>
echo "selected=\"selected\""; <?=htmlspecialchars($ifdesc);?>
echo ">{$ifdesc}</option>\n"; </option>
}
unset($iflist); <?php
$grouplist = return_gateway_groups_array(); endforeach;?>
foreach ($grouplist as $name => $group) {
echo "<option value=\"{$name}\"";
if ($pconfig['requestif'] == $name)
echo "selected=\"selected\"";
echo ">GW Group {$name}</option>\n";
}
unset($grouplist);
?>
</select> </select>
<br /><?= gettext("Note: This is almost always the same as the Interface to Monitor.");?> <div class="hidden" for="help_for_requestif">
<?= gettext("Note: This is almost always the same as the Interface to Monitor.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="_hostnametr"> <tr id="_hostnametr">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname");?></td> <td><a id="help_for_host" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Hostname");?></td>
<td width="78%" class="vtable"> <td>
<input name="host" type="text" class="formfld unknown" id="host" size="30" value="<?=htmlspecialchars($pconfig['host']);?>" /> <input name="host" type="text" id="host" value="<?=$pconfig['host'];?>" />
<br /> <div class="hidden" for="help_for_host">
<span class="vexpl"> <span class="text-danger"><strong><?=gettext("Note:");?><br /></strong></span>
<span class="red"><strong><?=gettext("Note:");?><br /></strong>
</span>
<?=gettext("Enter the complete host/domain name. example: myhost.dyndns.org");?><br /> <?=gettext("Enter the complete host/domain name. example: myhost.dyndns.org");?><br />
<?=gettext("For he.net tunnelbroker, enter your tunnel ID");?> <?=gettext("For he.net tunnelbroker, enter your tunnel ID");?>
</span> </div>
</td> </td>
</tr> </tr>
<tr id="_mxtr"> <tr id="_mxtr">
<td width="22%" valign="top" class="vncell"><?=gettext("MX"); ?></td> <td><a id="help_for_mx" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("MX"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="mx" type="text" class="formfld unknown" id="mx" size="30" value="<?=htmlspecialchars($pconfig['mx']);?>" /> <input name="mx" type="text" id="mx" value="<?=$pconfig['mx'];?>" />
<br /> <div class="hidden" for="help_for_mx">
<?=gettext("Note: With a dynamic DNS service you can only use a hostname, not an IP address.");?> <?=gettext("Note: With a dynamic DNS service you can only use a hostname, not an IP address.");?>
<br /> <br />
<?=gettext("Set this option only if you need a special MX record. Not". <?=gettext("Set this option only if you need a special MX record. Not"." all services support this.");?>
" all services support this.");?></td> </div>
</td>
</tr> </tr>
<tr id="_wildcardtr"> <tr id="_wildcardtr">
<td width="22%" valign="top" class="vncell"><?=gettext("Wildcards"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Wildcards"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="wildcard" type="checkbox" id="wildcard" value="yes" <?php if ($pconfig['wildcard']) echo "checked=\"checked\""; ?> /> <input name="wildcard" type="checkbox" id="wildcard" value="yes" <?=!empty($pconfig['wildcard']) ? "checked=\"checked\"" : ""; ?> />
<?=gettext("Enable ");?><?=gettext("Wildcard"); ?></td> <strong><?=gettext("Enable ");?><?=gettext("Wildcard"); ?></strong>
</td>
</tr> </tr>
<tr id="_verboselogtr"> <tr id="_verboselogtr">
<td width="22%" valign="top" class="vncell"><?=gettext("Verbose logging"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Verbose logging"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="verboselog" type="checkbox" id="verboselog" value="yes" <?php if ($pconfig['verboselog']) echo "checked=\"checked\""; ?> /> <input name="verboselog" type="checkbox" id="verboselog" value="yes" <?=!empty($pconfig['verboselog']) ? "checked=\"checked\"" : ""; ?> />
<?=gettext("Enable ");?><?=gettext("verbose logging"); ?></td> <strong><?=gettext("Enable ");?><?=gettext("verbose logging"); ?></strong>
</td>
</tr> </tr>
<tr id="_curloptions"> <tr id="_curloptions">
<td width="22%" valign="top" class="vncell"><?=gettext("CURL options"); ?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("CURL options"); ?></td>
<td width="78%" class="vtable"> <td>
<input name="curl_ipresolve_v4" type="checkbox" id="curl_ipresolve_v4" value="yes" <?php if ($pconfig['curl_ipresolve_v4']) echo "checked=\"checked\""; ?> /> <input name="curl_ipresolve_v4" type="checkbox" id="curl_ipresolve_v4" value="yes" <?=!empty($pconfig['curl_ipresolve_v4']) ? "checked=\"checked\"" : ""; ?> />
<?=gettext("Force IPv4 resolving"); ?><br /> <?=gettext("Force IPv4 resolving"); ?><br />
<input name="curl_ssl_verifypeer" type="checkbox" id="curl_ssl_verifypeer" value="yes" <?php if ($pconfig['curl_ssl_verifypeer']) echo "checked=\"checked\""; ?> /> <input name="curl_ssl_verifypeer" type="checkbox" id="curl_ssl_verifypeer" value="yes" <?=!empty($pconfig['curl_ssl_verifypeer']) ? "checked=\"checked\"" : ""; ?> />
<?=gettext("Verify SSL peer"); ?> <?=gettext("Verify SSL peer"); ?>
</td> </td>
</tr> </tr>
<tr id="_usernametr"> <tr id="_usernametr">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Username");?></td> <td><a id="help_for_username" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Username");?></td>
<td width="78%" class="vtable"> <td>
<input name="username" type="text" class="formfld user" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>" /> <input name="username" type="text" id="username" value="<?=$pconfig['username'];?>" />
<br /><?= gettext("Username is required for all types except Namecheap, FreeDNS and Custom Entries.");?> <div class="hidden" for="help_for_username">
<?= gettext("Username is required for all types except Namecheap, FreeDNS and Custom Entries.");?>
<br /><?= gettext("Route 53: Enter your Access Key ID.");?> <br /><?= gettext("Route 53: Enter your Access Key ID.");?>
<br /><?= gettext("Duck DNS: Enter your Token.");?> <br /><?= gettext("Duck DNS: Enter your Token.");?>
<br /><?= gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?> <br /><?= gettext("For Custom Entries, Username and Password represent HTTP Authentication username and passwords.");?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td> <td><a id="help_for_password" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Password");?></td>
<td width="78%" class="vtable"> <td>
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>" /> <input name="password" type="password" id="password" value="<?=$pconfig['password'];?>" />
<br /> <div class="hidden" for="help_for_password">
<?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?> <?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?>
<br /><?= gettext("Route 53: Enter your Secret Access Key.");?> <br /><?= gettext("Route 53: Enter your Secret Access Key.");?>
<br /><?= gettext("Duck DNS: Leave blank.");?> <br /><?= gettext("Duck DNS: Leave blank.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="r53_zoneid" style="display:none"> <tr id="r53_zoneid" style="display:none">
<td width="22%" valign="top" class="vncellreq"><?=gettext("Zone ID");?></td> <td><a id="help_for_zoneid" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Zone ID");?></td>
<td width="78%" class="vtable"> <td>
<input name="zoneid" type="text" class="formfld user" id="zoneid" size="20" value="<?=htmlspecialchars($pconfig['zoneid']);?>" /> <input name="zoneid" type="text" id="zoneid" value="<?=$pconfig['zoneid'];?>" />
<br /><?= gettext("Enter Zone ID that you received when you created your domain in Route 53.");?> <div class="hidden" for="help_for_zoneid">
<?= gettext("Enter Zone ID that you received when you created your domain in Route 53.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="_urltr"> <tr id="_urltr">
<td width="22%" valign="top" class="vncell"><?=gettext("Update URL");?></td> <td><a id="help_for_updateurl" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Update URL");?></td>
<td width="78%" class="vtable"> <td>
<input name="updateurl" type="text" class="formfld unknown" id="updateurl" size="60" value="<?=htmlspecialchars($pconfig['updateurl']);?>" /> <input name="updateurl" type="text" id="updateurl" value="<?=$pconfig['updateurl'];?>" />
<br /><?= gettext("This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.");?> <div class="hidden" for="help_for_updateurl">
<?= gettext("This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.");?>
<br /> <br />
<?= gettext("If you need the new IP to be included in the request, put %IP% in its place.");?> <?= gettext("If you need the new IP to be included in the request, put %IP% in its place.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="_resulttr"> <tr id="_resulttr">
<td width="22%" valign="top" class="vncell"><?=gettext("Result Match");?></td> <td><a id="help_for_resultmatch" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Result Match");?></td>
<td width="78%" class="vtable"> <td>
<textarea name="resultmatch" class="formpre" id="resultmatch" cols="65" rows="7"><?=htmlspecialchars($pconfig['resultmatch']);?></textarea> <textarea name="resultmatch" class="formpre" id="resultmatch" cols="65" rows="7"><?=$pconfig['resultmatch'];?></textarea>
<br /><?= gettext("This field is only used by Custom Dynamic DNS Entries.");?> <div class="hidden" for="help_for_resultmatch">
<?= gettext("This field is only used by Custom Dynamic DNS Entries.");?>
<br /> <br />
<?= gettext("This field should be identical to what your dynamic DNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.");?> <?= gettext("This field should be identical to what your dynamic DNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.");?>
<br /> <br />
...@@ -410,38 +391,40 @@ include("head.inc"); ...@@ -410,38 +391,40 @@ include("head.inc");
<?= gettext("If you need to include multiple possible values, separate them with a |. If your provider includes a |, escape it with \\|");?> <?= gettext("If you need to include multiple possible values, separate them with a |. If your provider includes a |, escape it with \\|");?>
<br /> <br />
<?= gettext("Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.");?> <?= gettext("Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.");?>
</div>
</td> </td>
</tr> </tr>
<tr id="r53_ttl" style="display:none"> <tr id="r53_ttl" style="display:none">
<td width="22%" valign="top" class="vncellreq"><?=gettext("TTL");?></td> <td><a id="help_for_ttl" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("TTL");?></td>
<td width="78%" class="vtable"> <td>
<input name="ttl" type="text" class="formfld user" id="ttl" size="20" value="<?=htmlspecialchars($pconfig['ttl']);?>" /> <input name="ttl" type="text" id="ttl" value="<?=$pconfig['ttl'];?>" />
<br /><?= gettext("Choose TTL for your dns record.");?> <div class="hidden" for="help_for_ttl">
<?= gettext("Choose TTL for your dns record.");?>
</div>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Description");?></td>
<td width="78%" class="vtable"> <td>
<input name="descr" type="text" class="formfld unknown" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <input name="descr" type="text" id="descr" value="<?=$pconfig['descr'];?>" />
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td>&nbsp;</td>
<td width="78%"> <td>
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" onclick="enable_change(true)" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" onclick="enable_change(true)" />
<?php if (isset($id) && $a_dyndns[$id]): ?> <?php
<input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> if (isset($id)): ?>
<input name="id" type="hidden" value="<?=$id;?>" />
<input name="force" type="submit" class="btn btn-primary" value="<?=gettext("Save & Force Update");?>" onclick="enable_change(true)" /> <input name="force" type="submit" class="btn btn-primary" value="<?=gettext("Save & Force Update");?>" onclick="enable_change(true)" />
<?php endif; ?> <?php
endif; ?>
<a href="services_dyndns.php" class="btn btn-default"><?=gettext("Cancel");?></a> <a href="services_dyndns.php" class="btn btn-default"><?=gettext("Cancel");?></a>
</td> </td>
</tr> </tr>
<tr> <tr>
<td width="22%" valign="top">&nbsp;</td> <td>&nbsp;</td>
<td width="78%"><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br /> <td><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
</strong></span><?php printf(gettext("You must configure a DNS server in %sSystem: </strong></span><?php printf(gettext("You must configure a DNS server in %sSystem:
General setup%s or allow the DNS server list to be overridden General setup%s or allow the DNS server list to be overridden
by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system_general.php">','</a>');?></span></td> by DHCP/PPP on WAN for dynamic DNS updates to work."),'<a href="system_general.php">','</a>');?></span></td>
...@@ -454,10 +437,9 @@ include("head.inc"); ...@@ -454,10 +437,9 @@ include("head.inc");
</div> </div>
</div> </div>
</section> </section>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
_onTypeChange("<?php echo $pconfig['type']; ?>"); _onTypeChange("<?=$pconfig['type']; ?>");
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment