Browse code

In neues Modul ausgelagert

Bernd Wurst authored on12/01/2018 10:14:12
Showing6 changed files
... ...
@@ -12,4 +12,4 @@ RewriteEngine On
12 12
 RewriteBase /
13 13
 RewriteRule ^go/(.*)$  dispatch.php?go=$1&%{QUERY_STRING}
14 14
 RewriteRule ^init(.*)$  go/index/initialize_useraccount?token=$1&%{QUERY_STRING} [R]
15
-RewriteRule ^verify(.*)$  go/index/verify?token=$1&%{QUERY_STRING} [R]
15
+RewriteRule ^verify(.*)$  go/handles/verify?token=$1&%{QUERY_STRING} [R]
16 16
new file mode 100644
... ...
@@ -0,0 +1,41 @@
1
+<?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2014 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('inc/debug.php');
18
+require_role(array(ROLE_CUSTOMER));
19
+
20
+function get_handles() {
21
+    $cid = (int) $_SESSION['customerinfo']['customerno'];
22
+    $result = db_query("SELECT id, state, lastchange, nic_handle, company, name, address, zip, city, country, phone, mobile, fax, email, pgp_id FROM kundendaten.handles WHERE customer=? ORDER BY id", array($cid));
23
+    $ret = array();
24
+    while ($handle = $result->fetch()) {
25
+        $ret[$handle['id']] = $handle;
26
+    }
27
+    DEBUG($ret);
28
+    return $ret;
29
+}
30
+
31
+
32
+function get_kundenhandles() {
33
+    $cid = (int) $_SESSION['customerinfo']['customerno'];
34
+    $result = db_query("SELECT handle_kunde, handle_extern, handle_rechnung FROM kundendaten.kunden WHERE id=?", array($cid));
35
+    $res = $result->fetch();
36
+    $ret = array("kunde" => $res['handle_kunde'],
37
+                 "extern" => $res['handle_extern'],
38
+                 "rechnung" => $res['handle_rechnung']);
39
+    return $ret;
40
+}
41
+
0 42
similarity index 100%
1 43
rename from modules/index/include/kundendaten.php
2 44
rename to modules/handles/include/verify.php
3 45
new file mode 100644
... ...
@@ -0,0 +1,55 @@
1
+<?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2014 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('handles.php');
18
+require_once('inc/debug.php');
19
+
20
+require_once('session/start.php');
21
+
22
+
23
+require_role(array(ROLE_CUSTOMER));
24
+
25
+title("Adressen verwalten");
26
+
27
+
28
+$handles = get_handles();
29
+$kundenhandles = get_kundenhandles();
30
+
31
+output('<p>Sie haben aktuell diese Adressen gespeichert:</p>
32
+<table>
33
+<tr><th>#</th><th>Name</th><th>Adresse</th><th>E-Mail</th><th>Verwendung</th><th>Aktionen</th></tr>
34
+');
35
+foreach ($handles as $id => $handle) {
36
+    $adresse = nl2br($handle['address']."\n".$handle['country'].'-'.$handle['zip'].' '.$handle['city']);
37
+    $usage = '';
38
+    if ($id == $kundenhandles['kunde']) {
39
+        $usage .= 'Stamm-Adresse';
40
+    }
41
+    if ($id == $kundenhandles['extern']) {
42
+        $usage .= 'Ersatz-Adresse';
43
+    }
44
+    if ($id == $kundenhandles['rechnung']) {
45
+        $usage .= 'Rechnungs-Adresse';
46
+    }
47
+    
48
+    output("<tr><td>{$handle['id']}</td><td><strong>{$handle['name']}</strong></td><td>$adresse</td><td>{$handle['email']}</td><td>$usage</td><td>...</td></tr>");
49
+}
50
+output('</table>');
51
+output("<br />");
52
+
53
+
54
+
55
+?>
0 56
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+<?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting
4
+
5
+Written 2008-2014 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
+$role = $_SESSION['role'];
18
+
19
+
20
+if (($role & ROLE_CUSTOMER))
21
+{
22
+  $menu["index_handles"] = array("label" => "Adressen verwalten", "file" => "list", "weight" => 1, "submenu" => "index_index");
23
+}
24
+
25
+?>
0 26
similarity index 100%
1 27
rename from modules/index/verify.php
2 28
rename to modules/handles/verify.php