cf54502a10b16c985ea28db17885d377226b6145
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Bernd Wurst Copyright year update

Bernd Wurst authored 6 years ago

5) Written 2008-2018 by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
9) 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.
10) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12) http://creativecommons.org/publicdomain/zero/1.0/
13) 
14) 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.
15) */
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

16) 
17) require_once('inc/base.php');
18) require_once('inc/security.php');
19) 
bernd Erlaube *useraccounts* das...

bernd authored 13 years ago

20) require_role(ROLE_SYSTEMUSER);
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

21) 
22) require_once('dnsinclude.php');
23) 
24) $section = 'dns_dyndns';
25) 
26) 
27) $new = true;
28) $dyndns = array();
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

29) if (isset($_REQUEST['id']))
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

30) {
31)   $dyndns = get_dyndns_account($_REQUEST['id']);
32)   $new = false;
33) }
34) 
35) 
36) $username_http = $_SESSION['userinfo']['username'];
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

37) if (isset($dyndns['handle']))
38)   $username_http .= "_{$dyndns['handle']}";
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

39) 
40) $http_update_info = '';
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

41) if (isset($dyndns['password']))
42)   $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.';
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

43) 
44) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

45) $html_header .= '<script type="text/javascript">
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

46) var username = "'.$_SESSION['userinfo']['username'].'";
47) var handle;
48) var http_username;
49) 
50) function updateUsernameHTTP() {
51) handle = document.getElementById("handle").value;
52) http_username = username;
53) if (handle != "")
54) http_username = username + "_" + handle;
55) 
56) document.getElementById("username_http").firstChild.data = http_username;
57) }
58) 
59) </script>
60) ';
61) 
62) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

63) title('DynDNS-Account');
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

64) 
65) 
66) if (! $new ) 
67)   $output .= '<div style="padding: 0.5em; border: 1px solid black;"><strong>aktuelle Daten:</strong><br />
68)   letztes Update: '.$dyndns['lastchange'].'<br />
69)   aktuelle Adresse: '.$dyndns['address'].'
70)   </div>';
71) 
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

72) $form = '<p><label for="handle">Bezeichnung:</label>&#160;<input type="text" name="handle" id="handle" value="'.(isset($dyndns['handle']) ? $dyndns['handle'] : '').'" onkeyup="updateUsernameHTTP()" /></p>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

73) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

74) <h4>Update per HTTPs</h4>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

75) <p style="margin-left: 2em;">Geben Sie hier ein Passwort ein um das Update per HTTPs zu aktivieren.'.$http_update_info.'</p>
76) <p style="margin-left: 2em;">Benutzername:&#160;<strong><span id="username_http">'.$username_http.'</span></strong></p>
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

77) <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>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

78) 
79) <h4>Update per SSH</h4>
80) <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>
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

81) <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>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

82) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

83) <p style="margin-left: 2em;"><input type="submit" value="Speichern" /></p>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

84) ';
85) 
86) 
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

87) $output .= html_form('dyndns_edit', 'save', 'type=dyndns&action=edit&'.(isset($_REQUEST['id']) ? 'id='.$_REQUEST['id'] : ''), $form);
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

88) 
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

89)   
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

90) if (! $new )
91) {
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

92)   $records = get_dyndns_records($_REQUEST['id']);
93) 
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

94)   $output .= '<h4>Folgende DNS-records sind mit diesem DynDNS-Account verknüpft:</h4>
95)   
96)   <ul>';
97)   
98)   foreach ($records AS $record) {
99)     $output .= '<li>'.$record['fqdn'].' (Typ: '.strtoupper($record['type']).' / TTL: '.$record['ttl'].' Sek.)</li>';
100)   }
101)   
102)   $output .= '</ul>';
Bernd Wurst Erzeuge nicht einen DynDNS-...

Bernd Wurst authored 7 years ago

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