Browse code

Fix coding style with php-cs-checker, see https://cs.sensiolabs.org/

Hanno authored on 26/06/2018 13:58:19
Showing 1 changed files
... ...
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
8 8
 
9 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 10
 
11
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
11
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
12 12
 http://creativecommons.org/publicdomain/zero/1.0/
13 13
 
14 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.
... ...
@@ -23,31 +23,30 @@ require_once('su.php');
23 23
 
24 24
 require_role(ROLE_CUSTOMER);
25 25
 
26
-if (isset($_GET['uid']))
27
-{
28
-  $uid = (int) $_GET['uid'];
29
-  $token = $_GET['token'];
30
-  $cid = (int) $_SESSION['customerinfo']['customerno'];
31
-  $users = find_users_for_customer($cid);
32
-  $found = false;
33
-  foreach ($users as $u) {
34
-    if ($uid == $u['uid']) {
35
-      $found = true;
26
+if (isset($_GET['uid'])) {
27
+    $uid = (int) $_GET['uid'];
28
+    $token = $_GET['token'];
29
+    $cid = (int) $_SESSION['customerinfo']['customerno'];
30
+    $users = find_users_for_customer($cid);
31
+    $found = false;
32
+    foreach ($users as $u) {
33
+        if ($uid == $u['uid']) {
34
+            $found = true;
35
+        }
36
+    }
37
+    if (! $found) {
38
+        system_failure('Unerlaubter Useraccount');
36 39
     }
37
-  }
38
-  if (! $found) {
39
-    system_failure('Unerlaubter Useraccount');
40
-  }
41 40
 
42
-  if (!isset($_SESSION['su_customer_timestamp']) || $_SESSION['su_customer_timestamp'] < time() - 30) {
43
-    system_failure("Aus Sicherheitsgründen muss die Auswahl auf dieser Seite innerhalb von 30 Sekunden getroffen werden.");
44
-  }
41
+    if (!isset($_SESSION['su_customer_timestamp']) || $_SESSION['su_customer_timestamp'] < time() - 30) {
42
+        system_failure("Aus Sicherheitsgründen muss die Auswahl auf dieser Seite innerhalb von 30 Sekunden getroffen werden.");
43
+    }
45 44
 
46
-  if (!isset($_SESSION['su_customer_token']) || $_SESSION['su_customer_token'] != $token) {
47
-    system_failure("Ungültige Reihenfolge der Aufrufe");
48
-  }
45
+    if (!isset($_SESSION['su_customer_token']) || $_SESSION['su_customer_token'] != $token) {
46
+        system_failure("Ungültige Reihenfolge der Aufrufe");
47
+    }
49 48
 
50
-  su('u', $uid);
49
+    su('u', $uid);
51 50
 }
52 51
 
53 52
 title("Benutzer wechseln");
... ...
@@ -65,14 +64,14 @@ $users = find_users_for_customer($cid);
65 64
 output('<p>Zu Ihrem Kundenkonto gehören die folgenden Benutzer. Klicken Sie einen Benutzernamen an um zu diesem zu wechseln.</p><ul>');
66 65
 
67 66
 foreach ($users as $u) {
68
-  if ($u['uid'] == $_SESSION['userinfo']['uid']) {
69
-    output("<li>{$u['username']} - (Eigener Benutzeraccount)</li>");
70
-    continue;
71
-  }
72
-  $realname = $u['name'];
73
-  if ($realname) {
74
-    $realname = ' - '.$realname;
75
-  }
76
-  output("<li>".internal_link('', "{$u['username']}{$realname}", "uid={$u['uid']}&token={$token}")."</li>");
67
+    if ($u['uid'] == $_SESSION['userinfo']['uid']) {
68
+        output("<li>{$u['username']} - (Eigener Benutzeraccount)</li>");
69
+        continue;
70
+    }
71
+    $realname = $u['name'];
72
+    if ($realname) {
73
+        $realname = ' - '.$realname;
74
+    }
75
+    output("<li>".internal_link('', "{$u['username']}{$realname}", "uid={$u['uid']}&token={$token}")."</li>");
77 76
 }
78 77
 output('</ul>');
Browse code

Copyright year update

Bernd Wurst authored on 13/01/2018 06:07:05
Showing 1 changed files
... ...
@@ -2,7 +2,7 @@
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting
4 4
 
5
-Written 2008-2014 by schokokeks.org Hosting, namely
5
+Written 2008-2018 by schokokeks.org Hosting, namely
6 6
   Bernd Wurst <bernd@schokokeks.org>
7 7
   Hanno Böck <hanno@schokokeks.org>
8 8
 
Browse code

Zeige Menüpunkt für su_customer auch wenn das systemusers-Modul nicht da ist. Datei su_customer vergessen, ist jetzt im GIT

Bernd Wurst authored on 01/11/2015 06:34:08
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,78 @@
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/base.php');
18
+require_once('inc/security.php');
19
+require_once('inc/debug.php');
20
+
21
+require_once('session/start.php');
22
+require_once('su.php');
23
+
24
+require_role(ROLE_CUSTOMER);
25
+
26
+if (isset($_GET['uid']))
27
+{
28
+  $uid = (int) $_GET['uid'];
29
+  $token = $_GET['token'];
30
+  $cid = (int) $_SESSION['customerinfo']['customerno'];
31
+  $users = find_users_for_customer($cid);
32
+  $found = false;
33
+  foreach ($users as $u) {
34
+    if ($uid == $u['uid']) {
35
+      $found = true;
36
+    }
37
+  }
38
+  if (! $found) {
39
+    system_failure('Unerlaubter Useraccount');
40
+  }
41
+
42
+  if (!isset($_SESSION['su_customer_timestamp']) || $_SESSION['su_customer_timestamp'] < time() - 30) {
43
+    system_failure("Aus Sicherheitsgründen muss die Auswahl auf dieser Seite innerhalb von 30 Sekunden getroffen werden.");
44
+  }
45
+
46
+  if (!isset($_SESSION['su_customer_token']) || $_SESSION['su_customer_token'] != $token) {
47
+    system_failure("Ungültige Reihenfolge der Aufrufe");
48
+  }
49
+
50
+  su('u', $uid);
51
+}
52
+
53
+title("Benutzer wechseln");
54
+
55
+output('<p>Hiermit können Sie das Webinterface mit den Rechten eines beliebigen anderen Benutzers aus Ihrem Kundenaccount benutzen.</p>
56
+');
57
+
58
+$token = random_string(20);
59
+$_SESSION['su_customer_token'] = $token;
60
+$_SESSION['su_customer_timestamp'] = time();
61
+
62
+$cid = (int) $_SESSION['customerinfo']['customerno'];
63
+$users = find_users_for_customer($cid);
64
+
65
+output('<p>Zu Ihrem Kundenkonto gehören die folgenden Benutzer. Klicken Sie einen Benutzernamen an um zu diesem zu wechseln.</p><ul>');
66
+
67
+foreach ($users as $u) {
68
+  if ($u['uid'] == $_SESSION['userinfo']['uid']) {
69
+    output("<li>{$u['username']} - (Eigener Benutzeraccount)</li>");
70
+    continue;
71
+  }
72
+  $realname = $u['name'];
73
+  if ($realname) {
74
+    $realname = ' - '.$realname;
75
+  }
76
+  output("<li>".internal_link('', "{$u['username']}{$realname}", "uid={$u['uid']}&token={$token}")."</li>");
77
+}
78
+output('</ul>');