dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

5) Written 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 1 year ago

9) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

10) 
11) 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.
12) */
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

13) 
14) require_once('inc/base.php');
15) require_once('inc/security.php');
16) 
bernd Erlaube *useraccounts* das...

bernd authored 14 years ago

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

bernd authored 15 years ago

18) 
19) require_once('dnsinclude.php');
20) 
21) $section = 'dns_dyndns';
22) 
23) 
24) $new = true;
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

25) $dyndns = [];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

29) }
30) 
31) 
32) $username_http = $_SESSION['userinfo']['username'];
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

36) 
37) $http_update_info = '';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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

bernd authored 15 years ago

41) 
42) 
bernd Benutze überall title() sta...

bernd authored 13 years ago

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

bernd authored 15 years ago

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

bernd authored 13 years ago

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

bernd authored 15 years ago

62) 
63) 
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

64) if (! $new) {
65)     $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

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

70) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

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

bernd authored 15 years ago

72) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

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

bernd authored 15 years ago

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

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

77) 
78) <h4>Update per SSH</h4>
79) <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>
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

80) <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">'.($dyndns['sshkey'] ?? '').'</textarea></p>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

81) 
bernd Einige Dummheiten repariert...

bernd authored 14 years ago

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

bernd authored 15 years ago

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

bernd authored 14 years ago

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

87) 
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

bernd authored 14 years ago

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

Hanno authored 5 years ago

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

93)   
94)   <ul>';
Hanno remove whitespace in empty...

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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

Hanno authored 5 years ago

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