354c05a4ddd678c49bcbba458bffa7d13482139a
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

1) <?php
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 Vorbereitung für edit/new

Bernd Wurst authored 6 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 Vorbereitung für edit/new

Bernd Wurst authored 6 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) */
13) 
14) require_once('contacts.php');
15) require_once('inc/debug.php');
Bernd Wurst removed jquery and jqueryUI...

Bernd Wurst authored 1 year ago

16) require_once('inc/javascript.php');
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

17) javascript();
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

18) 
19) require_once('session/start.php');
20) 
21) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

22) require_role([ROLE_CUSTOMER]);
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

23) $section = 'contacts_list';
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

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

Hanno authored 5 years ago

25) $new = false;
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

26) if ($_REQUEST['id'] == 'new') {
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

27)     title("Adresse anlegen");
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

28)     $new = true;
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

29) } else {
30)     title("Adresse bearbeiten");
31) }
32) 
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

33) $c = new_contact();
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 6 months ago

34) if (!$new) {
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

35)     $c = get_contact($_REQUEST['id']);
Bernd Wurst Kontakt kopieren

Bernd Wurst authored 6 years ago

36) } elseif (isset($_REQUEST['copy'])) {
37)     $c = get_contact($_REQUEST['copy']);
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

38)     $c['nic_handle'] = null;
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

39) }
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

40) $domains = domainlist_by_contact($c);
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

41) 
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

42) $readonly = '';
43) // Wenn das Handle beim NIC angemeldet ist, kann man Name und Land nicht mehr ändern
Hanno Fix coding style with php-c...

Hanno authored 5 years ago

44) if ($c['nic_handle'] != null) {
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

45)     $readonly = ' disabled="disabled" ';
46)     output('<p>Da diese Adresse als möglicher Domaininhaber bei der Domain-Regristry angemeldet ist, können Name/Firmenname und Land nicht mehr geändert werden. Legen Sie ggf. eine neue Adresse an und ändern Sie den Domain-Inhaber entsprechend.</p>');
47) }
Bernd Wurst Ermögliche das Erstellen ei...

Bernd Wurst authored 6 years ago

48) if (isset($_REQUEST['domainholder']) && $_REQUEST['domainholder'] == 1) {
49)     output('<p>Für einen Domaininhaber muss mindestens Name, vollständige Adresse, E-Mail-Adresse und Telefonnummer angegeben werden.</p>');
50) }
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

51) $odd = false;
52) $html = '<table>';
Bernd Wurst Ermögliche das Speichern de...

Bernd Wurst authored 5 years ago

53) $buttons = '<span class="buttonset" id="buttonset-salutation">
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

54)          <input type="radio" name="salutation" id="salutation-firma" value="Firma" ' . ($c['salutation'] === null ? 'checked="checked"' : '') . '/>
Bernd Wurst Ermögliche das Speichern de...

Bernd Wurst authored 5 years ago

55)          <label for="salutation-firma">Neutral</label>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

56)          <input type="radio" name="salutation" id="salutation-herr" value="Herr" ' . ($c['salutation'] === 'Herr' ? 'checked="checked"' : '') . '/>
Bernd Wurst Ermögliche das Speichern de...

Bernd Wurst authored 5 years ago

57)          <label for="salutation-herr">Herr</label>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

58)          <input type="radio" name="salutation" id="salutation-frau" value="Frau" ' . ($c['salutation'] === 'Frau' ? 'checked="checked"' : '') . '/>
Bernd Wurst Ermögliche das Speichern de...

Bernd Wurst authored 5 years ago

59)          <label for="salutation-frau">Frau</label>';
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

60) $html .= '    <tr class="' . ($odd == true ? 'odd' : 'even') . '"><td>Bevorzugte Anrede:</td><td>' . $buttons . '</td></tr>';
61) $html .= '    <tr class="' . ($odd == true ? 'odd' : 'even') . '"><td>Firmenname:</td><td><input type="text" name="firma" id="firma" value="' . filter_output_html($c['company']) . '" ' . $readonly . ' /></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

62) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

63) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td>' . ($c['company'] ? 'Ansprechpartner' : 'Name') . ':</td><td><input type="text" name="name" id="name" value="' . filter_output_html($c['name']) . '" ' . $readonly . ' /></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

64) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

65) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="adresse">Adresse:</label></td><td><textarea rows="3" name="adresse" id="adresse">' . filter_output_html($c['address']) . '</textarea></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

66) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

67) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="plz">Land / PLZ:</label></td><td><input size="2" type="text" name="land" id="land" value="' . filter_output_html($c['country']) . '" ' . $readonly . ' />-</strong><input type="text" name="plz" id="plz" value="' . filter_output_html($c['zip']) . '"></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

68) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

69) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="ort">Ort:</label></td><td><input type="text" name="ort" id="ort" value="' . filter_output_html($c['city']) . '"></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

70) $odd = !$odd;
71) 
72) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

73) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="email">E-Mail-Adresse:</label></td><td><input type="text" name="email" id="email" value="' . filter_output_html($c['email']) . '"></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

74) $odd = !$odd;
75) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

76) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="telefon">Telefonnummer:</label></td><td><input type="text" name="telefon" id="telefon" value="' . filter_output_html($c['phone']) . '"><span id="telefon_feedback"></span></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

77) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

78) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="telefon">Mobil:</label></td><td><input type="text" name="mobile" id="mobile" value="' . filter_output_html($c['mobile']) . '"><span id="mobile_feedback"></span></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

79) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

80) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="telefon">Telefax:</label></td><td><input type="text" name="telefax" id="telefax" value="' . filter_output_html($c['fax']) . '"><span id="telefax_feedback"></span></td></tr>';
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

81) $odd = !$odd;
82) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

83) if ($domains) {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

84)     $html .= '<tr class="odd" id="designated-row"><td><label for="designated"><strong>Inhaberwechsel:</strong></label></td><td><input type="checkbox" name="designated" id="designated" value="yes"><label for="designated">Die Änderung der E-Mail-Adresse bewirkt rechtlich einen Inhaberwechsel. Ich bestätige, dass mir eine explizite Zustimmung des alten und neuen Inhabers für diese Änderung vorliegt. Eine Speicherung der Änderungen ist nur mit dieser Zustimmung möglich.</label></td></tr>';
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

85) }
86) 
Hanno Böck more strict codingstyle wit...

Hanno Böck authored 1 year ago

87) $buttons = '<span class="buttonset" id="buttonset-usepgp">
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

88)          <input type="radio" name="usepgp" id="usepgp-yes" value="yes" ' . ($c['pgp_id'] ? 'checked="checked"' : '') . '/>
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

89)          <label for="usepgp-yes">PGP verwenden</label>
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

90)          <input type="radio" name="usepgp" id="usepgp-no" value="no" ' . ($c['pgp_id'] ? '' : 'checked="checked"') . '/>
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

91)          <label for="usepgp-no">kein PGP</label>';
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

92) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="buttonset-usepgp">PGP-Verschlüsselung:</label></td><td>' . $buttons . '</td></tr>';
93) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="pgpid">PGP-Key-ID:</label></td><td><input type="text" name="pgpid" id="pgpid" value="' . filter_output_html($c['pgp_id']) . '" size="40"><button id="searchpgp" type="button">Auf Keyserver suchen</button><span id="pgpid_feedback"></span></td></tr>';
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

94) $odd = !$odd;
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

95) $html .= '<tr class="' . ($odd == true ? 'odd' : 'even') . '"><td><label for="pgpkey">PGP-Key (ASCII-Armored):</label></td><td><textarea name="pgpkey" id="pgpkey">' . filter_output_html($c['pgp_key']) . '</textarea></td></tr>';
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

96) $odd = !$odd;
97) 
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

98) $html .= '<tr class="even"><td>&nbsp;</td><td><input type="submit" value="Speichern" /></td></tr>';
99) $html .= '</table>';
100) 
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

101) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

102) 
Bernd Wurst Ermögliche das Ändern eines...

Bernd Wurst authored 6 years ago

103) $back = 'list';
104) if (isset($_REQUEST['back'])) {
105)     $back = urldecode($_REQUEST['back']);
106) }
Bernd Wurst Ermögliche das Erstellen ei...

Bernd Wurst authored 6 years ago

107) $domainholder = '';
108) if (isset($_REQUEST['domainholder']) && $_REQUEST['domainholder'] == 1) {
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 8 months ago

109)     $domainholder = '&domainholder=1';
Bernd Wurst Ermögliche das Erstellen ei...

Bernd Wurst authored 6 years ago

110) }
111) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

112) output(html_form('contacts_edit', 'save', 'id=' . $_REQUEST['id'] . "&back=" . urlencode($back) . $domainholder, $html));
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

113) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

114) if ($domains) {
115)     output('<p>Folgende Domains sind von dieser Änderung betroffen:</p>
116)             <ul>');
117)     foreach ($domains as $dom) {
Hanno Böck Spaces between string conca...

Hanno Böck authored 6 months ago

118)         output('<li>' . filter_output_html($dom->fqdn) . '</li>');