e54a51c3f7fe8c9d5ab39497845b30b39848abb8
Bernd Wurst Speichern der Eingaben (unv...

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) 
11) You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
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');
19) 
20) require_once('session/start.php');
21) 
22) 
23) require_role(array(ROLE_CUSTOMER));
24) $section = 'contacts_list';
25) 
26) check_form_token('contacts_edit');
27) 
28) $new = False;
29) if ($_REQUEST['id'] == 'new') {
30)     title("Adresse anlegen");
31)     $new = True;
32) } else {
33)     title("Adresse bearbeiten");
34) }
35) 
36) $c = new_contact();
37) if (! $new) {
38)     $c = get_contact($_REQUEST['id']);
39) }
40) 
41) if ($c['nic_handle'] != NULL) {
42)     if (c['name'] != $_REQUEST['name'] || $c['company'] != $_REQUEST['firma'] || $c['country'] != $_REQUEST['land']) {
43)         system_failure('Name/Firma/Land kann bei diesem Kontakt nicht geändert werden.');
44)     }
45) }
46) 
47) 
48) $c['company'] = maybe_null($_REQUEST['firma']);
49) $c['name'] = maybe_null($_REQUEST['name']);
50) $c['address'] = maybe_null($_REQUEST['adresse']);
51) $c['country'] = maybe_null(strtoupper($_REQUEST['land']));
52) $c['zip'] = maybe_null($_REQUEST['plz']);
53) $c['city'] = maybe_null($_REQUEST['ort']);
54) $c['phone'] = maybe_null($_REQUEST['telefon']);
55) $c['mobile'] = maybe_null($_REQUEST['mobile']);
56) $c['fax'] = maybe_null($_REQUEST['telefax']);
57) 
58) // FIXME: PGP-ID/Key fehlen
59) 
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

60) // Zuerst Kontakt speichern und wenn eine Änderung der E-Mail gewünscht war,
61) // dann hinterher das Token erzeugen und senden. Weil wir für das Token die 
62) // Contact-ID brauchen und die bekommen wir bei einer Neueintragung erst nach 
63) // dem Speichern.
64) 
65) $id = save_contact($c);
66) $c['id'] = $id;
Bernd Wurst Speichern der Eingaben (unv...

Bernd Wurst authored 6 years ago

67) 
68) if ($c['email'] != $_REQUEST['email']) {
Bernd Wurst Speichern der Änderungen mö...

Bernd Wurst authored 6 years ago

69)     if (have_mailaddress($_REQUEST['email'])) {
70)         save_emailaddress($c['id'], $_REQUEST['email']);
71)     } else {
72)         send_emailchange_token($c['id'], $_REQUEST['email']);
73)     }
Bernd Wurst Speichern der Eingaben (unv...

Bernd Wurst authored 6 years ago

74) }
75) 
76)