5fdbeb8eae2c1fad8488f89c5f41b268681c20d1
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'])) {
Hanno Böck Rechtschreibfehler, Schreib...

Hanno Böck authored 4 months ago

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

Hanno authored 5 years ago

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

bernd authored 15 years ago

41) 
42) 
Hanno Böck W3C validator warnt bei typ...

Hanno Böck authored 4 months ago

43) $html_header .= '<script>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

44) var username = "' . $_SESSION['userinfo']['username'] . '";
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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 Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

64) if (!$new) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

65)     $output .= '<div style="padding: 0.5em; border: 1px solid black;"><strong>aktuelle Daten:</strong><br />
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

66)   letztes Update: ' . $dyndns['lastchange'] . '<br />
67)   aktuelle Adresse: ' . $dyndns['address'] . '
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

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 Spaces between string conca...

Hanno Böck authored 6 months 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) 
Hanno Böck Rechtschreibfehler, Schreib...

Hanno Böck authored 4 months ago

73) <h4>Update per HTTPS</h4>
74) <p style="margin-left: 2em;">Geben Sie hier ein Passwort ein, um das Update per HTTPS zu aktivieren.' . $http_update_info . '</p>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

75) <p style="margin-left: 2em;">Benutzername:&#160;<strong><span id="username_http">' . $username_http . '</span></strong></p>
Hanno Böck autocomplete=new-password f...

Hanno Böck authored 4 months 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']) ? '************' : '') . '" autocomplete="new-password"></p>
bernd Stub für dns-Admin-Interface

bernd authored 15 years ago

77) 
78) <h4>Update per SSH</h4>
Hanno Böck Rechtschreibfehler, Schreib...

Hanno Böck authored 4 months ago

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 Spaces between string conca...

Hanno Böck authored 6 months 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) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months 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 Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

89) if (!$new) {
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

97)         $output .= '<li>' . $record['fqdn'] . ' (Typ: ' . strtoupper($record['type']) . ' / TTL: ' . $record['ttl'] . ' Sek.)</li>';
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

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>';
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

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