Speichern der Eingaben (unvollständig)
Bernd Wurst

Bernd Wurst commited on 2018-01-24 10:34:58
Zeige 1 geänderte Dateien mit 73 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,73 @@
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
+
60
+
61
+if ($c['email'] != $_REQUEST['email']) {
62
+   
63
+}
64
+
65
+// e-mail-Adresse geändert?
66
+// -> token generieren / senden
67
+// ...
68
+// speichern
69
+
70
+
71
+
72
+
73
+
0 74