9086c9ad77db90633e0629e9e86a88366265ded0
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) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

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();
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

29) if (isset($_REQUEST['id'])) {
30)     $dyndns = get_dyndns_account($_REQUEST['id']);
31)     $new = false;
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

32) }
33) 
34) 
35) $username_http = $_SESSION['userinfo']['username'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

39) 
40) $http_update_info = '';
Hanno Fix coding style with php-c...

Hanno authored 5 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.';
43) }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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

bernd authored 13 years ago

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

bernd authored 15 years ago

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

bernd authored 13 years ago

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

bernd authored 15 years ago

65) 
66) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

67) if (! $new) {
68)     $output .= '<div style="padding: 0.5em; border: 1px solid black;"><strong>aktuelle Daten:</strong><br />
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

69)   letztes Update: '.$dyndns['lastchange'].'<br />
70)   aktuelle Adresse: '.$dyndns['address'].'
71)   </div>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

72) }
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

73) 
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

74) $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

75) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

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

bernd authored 15 years ago

77) <p style="margin-left: 2em;">Geben Sie hier ein Passwort ein um das Update per HTTPs zu aktivieren.'.$http_update_info.'</p>
78) <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

79) <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

80) 
81) <h4>Update per SSH</h4>
82) <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

83) <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

84) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

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

bernd authored 15 years ago

86) ';
87) 
88) 
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

89) $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

90) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

91) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

92) if (! $new) {
93)     $records = get_dyndns_records($_REQUEST['id']);
bernd Warnings eliminiert und Plu...

bernd authored 14 years ago

94) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

95)     $output .= '<h4>Folgende DNS-records sind mit diesem DynDNS-Account verknüpft:</h4>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

96)   
97)   <ul>';
Hanno remove whitespace in empty...

Hanno authored 5 years ago

98) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

99)     foreach ($records as $record) {
100)         $output .= '<li>'.$record['fqdn'].' (Typ: '.strtoupper($record['type']).' / TTL: '.$record['ttl'].' Sek.)</li>';
101)     }
Hanno remove whitespace in empty...

Hanno authored 5 years ago

102) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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