$ifdesc) { $list[$if] = $ifdesc; } unset($iflist); $grouplist = return_gateway_groups_array(); foreach ($grouplist as $name => $group) { $list[$name] = 'GW Group ' . $name; } unset($grouplist); return($list); } $pgtitle = array(gettext("Services"), gettext("Dynamic DNS"), gettext("Dynamic DNS Clients"), gettext("Edit")); include("head.inc"); if ($input_errors) { print_input_errors($input_errors); } if ($savemsg) { print_info_box($savemsg, 'success'); } $form = new Form; $section = new Form_Section('Dynamic DNS Client'); // Confusingly the 'enable' checkbox is labelled 'Disable', but thats the way it works! // No action (hide or disable) is taken on selecting this. $section->addInput(new Form_Checkbox( 'enable', 'Disable', 'Disable this client', $pconfig['enable'] )); $section->addInput(new Form_Select( 'type', 'Service Type', $pconfig['type'], build_type_list() )); $interfacelist = build_if_list(); $section->addInput(new Form_Select( 'interface', 'Interface to monitor', $pconfig['interface'], $interfacelist )); $section->addInput(new Form_Select( 'requestif', 'Interface to send update from', $pconfig['requestif'], $interfacelist ))->setHelp('This is almost always the same as the Interface to Monitor. '); $group = new Form_Group('Hostname'); $group->add(new Form_Input( 'host', 'Hostname', 'text', $pconfig['host'] )); $group->add(new Form_Input( 'domainname', 'Domain name', 'text', $pconfig['domainname'] )); $group->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org'. '
' . 'he.net tunnelbroker: Enter the tunnel ID.' . '
' . 'GleSYS: Enter the record ID.' . '
' . 'DNSimple: Enter only the domain name.' . '
' . 'Namecheap: Enter the hostname and the domain separately, with the domain being the domain or subdomain zone being handled by Namecheap.'); $section->add($group); $section->addInput(new Form_Input( 'mx', 'MX', 'text', $pconfig['mx'] ))->setHelp('Note: With DynDNS service only a hostname can be used, not an IP address. '. 'Set this option only if a special MX record is needed. Not all services support this.'); $section->addInput(new Form_Checkbox( 'wildcard', 'Wildcards', 'Enable Wildcard', $pconfig['wildcard'] )); $section->addInput(new Form_Checkbox( 'verboselog', 'Verbose logging', 'Enable verbose logging', $pconfig['verboselog'] )); $section->addInput(new Form_Checkbox( 'curl_ipresolve_v4', 'CURL options', 'Force IPv4 resolving', $pconfig['curl_ipresolve_v4'] )); $section->addInput(new Form_Checkbox( 'curl_ssl_verifypeer', null, 'Verify SSL peer', $pconfig['curl_ssl_verifypeer'] )); $section->addInput(new Form_Input( 'username', 'Username', 'text', $pconfig['username'] ))->setHelp('Username is required for all types except Namecheap, FreeDNS and Custom Entries.' . '
' . 'Route 53: Enter the Access Key ID.' . '
' . 'GleSYS: Enter the API user.' . '
' . 'For Custom Entries, Username and Password represent HTTP Authentication username and passwords.'); $section->addPassword(new Form_Input( 'passwordfld', 'Password', 'password', $pconfig['password'] ))->setHelp('FreeDNS (freedns.afraid.org): Enter the "Authentication Token" provided by FreeDNS.' . '
' . 'Route 53: Enter the Secret Access Key.' . '
' . 'GleSYS: Enter the API key.' . '
' . 'DNSimple: Enter the API token.'); $section->addInput(new Form_Input( 'zoneid', 'Zone ID', 'text', $pconfig['zoneid'] ))->setHelp('Enter Zone ID that was received when creating the domain in Route 53.' . '
' . 'DNSimple: Enter the Record ID of record to update.'); $section->addInput(new Form_Input( 'updateurl', 'Update URL', 'text', $pconfig['updateurl'] ))->setHelp('This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.'); $section->addInput(new Form_Textarea( 'resultmatch', 'Result Match', $pconfig['resultmatch'] ))->sethelp('This field should be identical to what the DDNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.' . '
' . 'To include the new IP in the request, put %IP% in its place.' . '
' . 'To include multiple possible values, separate them with a |. If the provider includes a |, escape it with \\|)' . '
' . 'Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.'); $section->addInput(new Form_Input( 'ttl', 'TTL', 'text', $pconfig['ttl'] ))->setHelp('Choose TTL for the dns record.'); $section->addInput(new Form_Input( 'descr', 'Description', 'text', $pconfig['descr'] ))->setHelp('A description may be entered here for administrative reference (not parsed).'); if (isset($id) && $a_dyndns[$id]) { $section->addInput(new Form_Input( 'id', null, 'hidden', $id )); $form->addGlobal(new Form_Button( 'force', 'Save & Force Update', null, 'fa-refresh' ))->removeClass('btn-primary')->addClass('btn-info'); } $form->add($section); print($form); // Certain input elements are hidden/shown based on the service type in the following script ?>