This file belongs to the Webinterface of schokokeks.org Hosting

Written 2008-2018 by schokokeks.org Hosting, namely
  Bernd Wurst <bernd@schokokeks.org>
  Hanno Böck <hanno@schokokeks.org>

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see

Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.




$section = 'dns_dyndns';

$new = true;
$dyndns = array();
if (isset($_REQUEST['id'])) {
    $dyndns = get_dyndns_account($_REQUEST['id']);
    $new = false;

$username_http = $_SESSION['userinfo']['username'];
if (isset($dyndns['handle'])) {
    $username_http .= "_{$dyndns['handle']}";

$http_update_info = '';
if (isset($dyndns['password'])) {
    $http_update_info = ' Lassen Sie das Passworteingabefeld unberührt um das bestehende Passwort zu erhalten. Entfernen Sie das bestehende Passwort um das HTTP-Update zu deaktivieren.';

$html_header .= '<script type="text/javascript">
var username = "'.$_SESSION['userinfo']['username'].'";
var handle;
var http_username;

function updateUsernameHTTP() {
handle = document.getElementById("handle").value;
http_username = username;
if (handle != "")
http_username = username + "_" + handle;

document.getElementById("username_http").firstChild.data = http_username;



if (! $new) {
    $output .= '<div style="padding: 0.5em; border: 1px solid black;"><strong>aktuelle Daten:</strong><br />
  letztes Update: '.$dyndns['lastchange'].'<br />
  aktuelle Adresse: '.$dyndns['address'].'

$form = '<p><label for="handle">Bezeichnung:</label>&#160;<input type="text" name="handle" id="handle" value="'.(isset($dyndns['handle']) ? $dyndns['handle'] : '').'" onkeyup="updateUsernameHTTP()" /></p>

<h4>Update per HTTPs</h4>
<p style="margin-left: 2em;">Geben Sie hier ein Passwort ein um das Update per HTTPs zu aktivieren.'.$http_update_info.'</p>
<p style="margin-left: 2em;">Benutzername:&#160;<strong><span id="username_http">'.$username_http.'</span></strong></p>
<p style="margin-left: 2em;"><label for="password_http">Passwort:</label>&#160;<input type="password" id="password_http" name="password_http" value="'.(isset($dyndns['password']) ? '************' : '').'" /></p>

<h4>Update per SSH</h4>
<p style="margin-left: 2em;">Kopieren Sie Ihren SSH-public-Key im OpenSSH-Format in dieses Eingabefeld um das Update per SSH zu aktivieren.</p>
<p style="margin-left: 2em; vertical-align: middle;"><label for="sshkey">SSH Public-Key:</label><br /><textarea style="height: 10em; width: 80%;" id="sshkey" name="sshkey">'.(isset($dyndns['sshkey']) ? $dyndns['sshkey'] : '').'</textarea></p>

<p style="margin-left: 2em;"><input type="submit" value="Speichern" /></p>

$output .= html_form('dyndns_edit', 'save', 'type=dyndns&action=edit&'.(isset($_REQUEST['id']) ? 'id='.$_REQUEST['id'] : ''), $form);

if (! $new) {
    $records = get_dyndns_records($_REQUEST['id']);

    $output .= '<h4>Folgende DNS-records sind mit diesem DynDNS-Account verknüpft:</h4>

    foreach ($records as $record) {
        $output .= '<li>'.$record['fqdn'].' (Typ: '.strtoupper($record['type']).' / TTL: '.$record['ttl'].' Sek.)</li>';

    $output .= '</ul>';
    output("<p>".internal_link('dyndns_hostnames', "Liste ändern...", "id={$_REQUEST['id']}")."</p>");