96649f21ba18d07757afa9d98998f7a22c0d86a3
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) 
5) Written 2008-2018 by schokokeks.org Hosting, namely
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 Vorbereitung für edit/new

Bernd Wurst authored 6 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) */
16) 
17) require_once('contacts.php');
18) require_once('inc/debug.php');
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

19) require_once('inc/jquery.php');
20) javascript();
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

21) 
22) require_once('session/start.php');
23) 
24) 
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 2 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 6 years ago

32) } else {
33)     title("Adresse bearbeiten");
34) }
35) 
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

36) $c = new_contact();
Bernd Wurst Vorbereitung für edit/new

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Hanno authored 5 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

45) $readonly = '';
46) // 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

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

Bernd Wurst authored 6 years ago

48)     $readonly = ' disabled="disabled" ';
49)     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>');
50) }
Bernd Wurst Ermögliche das Erstellen ei...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 5 years ago

56) $buttons = '<span class="buttonset" id="buttonset-salutation">
57)          <input type="radio" name="salutation" id="salutation-firma" value="Firma" '.($c['salutation'] === null ? 'checked="checked"' : '').'/>
58)          <label for="salutation-firma">Neutral</label>
59)          <input type="radio" name="salutation" id="salutation-herr" value="Herr" '.($c['salutation'] === 'Herr' ? 'checked="checked"' : '').'/>
60)          <label for="salutation-herr">Herr</label>
61)          <input type="radio" name="salutation" id="salutation-frau" value="Frau" '.($c['salutation'] === 'Frau' ? 'checked="checked"' : '').'/>
62)          <label for="salutation-frau">Frau</label>';
63) $html .= '    <tr class="'.($odd == true ? 'odd' : 'even').'"><td>Bevorzugte Anrede:</td><td>'.$buttons.'</td></tr>';
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

65) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

67) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

69) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

71) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

73) $odd = !$odd;
74) 
75) 
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

77) $odd = !$odd;
78) 
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

80) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

82) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

84) $odd = !$odd;
85) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

88) }
89) 
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

90)   $buttons = '<span class="buttonset" id="buttonset-usepgp">
91)          <input type="radio" name="usepgp" id="usepgp-yes" value="yes" '.($c['pgp_id'] ? 'checked="checked"' : '').'/>
92)          <label for="usepgp-yes">PGP verwenden</label>
93)          <input type="radio" name="usepgp" id="usepgp-no" value="no" '.($c['pgp_id'] ? '' : 'checked="checked"').'/>
94)          <label for="usepgp-no">kein PGP</label>';
95)  $html .= '<tr class="'.($odd == true ? 'odd' : 'even').'"><td><label for="buttonset-usepgp">PGP-Verschlüsselung:</label></td><td>'.$buttons.'</td></tr>';
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

97) $odd = !$odd;
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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

99) $odd = !$odd;
100) 
Bernd Wurst Zeige bestehende Daten in d...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

110) $domainholder = '';
111) if (isset($_REQUEST['domainholder']) && $_REQUEST['domainholder'] == 1) {
112)     $domainholder='&domainholder=1';
113) }
114) 
115) 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

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

Bernd Wurst authored 6 years ago

117) if ($domains) {
118)     output('<p>Folgende Domains sind von dieser Änderung betroffen:</p>
119)             <ul>');
120)     foreach ($domains as $dom) {
Bernd Wurst Umstellung von filter_input...

Bernd Wurst authored 4 years ago

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