Browse code

Avoid PHP error if dispatch is called without go variable

Hanno authored on13/09/2019 09:34:31
Showing1 changed files
... ...
@@ -22,6 +22,8 @@ require_once("inc/theme.php");
22 22
 
23 23
 set_exception_handler('handle_exception');
24 24
 
25
+if (!isset($_GET['go']))
26
+    die("No command");
25 27
 $go = $_GET['go'];
26 28
 
27 29
 /*
Browse code

Default exception handler with warning mail to admin

Hanno authored on05/01/2019 17:16:27
Showing1 changed files
... ...
@@ -20,6 +20,7 @@ require_once('inc/debug.php');
20 20
 require_once("inc/base.php");
21 21
 require_once("inc/theme.php");
22 22
 
23
+set_exception_handler('handle_exception');
23 24
 
24 25
 $go = $_GET['go'];
25 26
 
Browse code

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

Hanno authored on26/06/2018 13:58:19
Showing1 changed files
... ...
@@ -9,7 +9,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely
9 9
 
10 10
 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.
11 11
 
12
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
12
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see
13 13
 https://creativecommons.org/publicdomain/zero/1.0/
14 14
 
15 15
 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.
... ...
@@ -28,21 +28,19 @@ $go = $_GET['go'];
28 28
 */
29 29
 
30 30
 // filenames can end with .php
31
-if ( substr( $go, strlen( $go ) - 4 ) == '.php' ) {
32
-  $go = substr( $go, 0, strlen($go) - 4);
31
+if (substr($go, strlen($go) - 4) == '.php') {
32
+    $go = substr($go, 0, strlen($go) - 4);
33 33
 }
34 34
 
35 35
 DEBUG($go);
36 36
 
37
-if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php")))
38
-{
39
-  die("illegal command");
37
+if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php"))) {
38
+    die("illegal command");
40 39
 }
41 40
 list($module, $page) = explode('/', $go, 2);
42 41
 $page = str_replace('/', '-', $page);
43
-if (! in_array($module, config('modules')))
44
-{
45
-  die("inactive module");
42
+if (! in_array($module, config('modules'))) {
43
+    die("inactive module");
46 44
 }
47 45
 
48 46
 
... ...
@@ -64,7 +62,7 @@ $output = "";
64 62
 $html_header = "";
65 63
 require_once("inc/base.php");
66 64
 /* setup module include path */
67
-ini_set('include_path',ini_get('include_path').':./modules/'.$module.'/include:');
65
+ini_set('include_path', ini_get('include_path').':./modules/'.$module.'/include:');
68 66
 
69 67
 /* Look where we are (but let the module override) */
70 68
 $section = str_replace("/", "_", $go);
... ...
@@ -72,12 +70,9 @@ $section = str_replace("/", "_", $go);
72 70
 /* Let the module work */
73 71
 include("modules/".$go.".php");
74 72
 
75
-if ($output)
76
-{
77
-  if (!isset($title)) {
78
-    $title = '';
79
-  }
80
-  show_page($module, $page);
73
+if ($output) {
74
+    if (!isset($title)) {
75
+        $title = '';
76
+    }
77
+    show_page($module, $page);
81 78
 }
82
-
83
-?>
Browse code

Copyright year update

Bernd Wurst authored on13/01/2018 06:07:05
Showing1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting.
4 4
 Please see https://source.schokokeks.org for the newest source files.
5 5
 
6
-Written 2008-2014 by schokokeks.org Hosting, namely
6
+Written 2008-2018 by schokokeks.org Hosting, namely
7 7
   Bernd Wurst <bernd@schokokeks.org>
8 8
   Hanno Böck <hanno@schokokeks.org>
9 9
 
Browse code

URLs von http nach https

Hanno Böck authored on20/09/2016 15:12:53
Showing1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <?php
2 2
 /*
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting.
4
-Please see http://source.schokokeks.org for the newest source files.
4
+Please see https://source.schokokeks.org for the newest source files.
5 5
 
6 6
 Written 2008-2014 by schokokeks.org Hosting, namely
7 7
   Bernd Wurst <bernd@schokokeks.org>
... ...
@@ -10,7 +10,7 @@ Written 2008-2014 by schokokeks.org Hosting, namely
10 10
 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.
11 11
 
12 12
 You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
13
-http://creativecommons.org/publicdomain/zero/1.0/
13
+https://creativecommons.org/publicdomain/zero/1.0/
14 14
 
15 15
 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.
16 16
 */
Browse code

Lizenzinfos in eigenes Modul ausgelagert und Copyright auf 2014 angepasst

Bernd Wurst authored on08/02/2014 05:45:07
Showing1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting.
4 4
 Please see http://source.schokokeks.org for the newest source files.
5 5
 
6
-Written 2008-2013 by schokokeks.org Hosting, namely
6
+Written 2008-2014 by schokokeks.org Hosting, namely
7 7
   Bernd Wurst <bernd@schokokeks.org>
8 8
   Hanno Böck <hanno@schokokeks.org>
9 9
 
Browse code

Umstellung auf PDO-Datenbankverbindung

Bernd Wurst authored on01/02/2014 18:38:23
Showing1 changed files
... ...
@@ -17,7 +17,6 @@ Nevertheless, in case you use a significant part of this code, we ask (but not r
17 17
 
18 18
 require_once('config.php');
19 19
 require_once('inc/debug.php');
20
-require_once('inc/db_connect.php');
21 20
 require_once("inc/base.php");
22 21
 require_once("inc/theme.php");
23 22
 
Browse code

Updated copyright notice (2012 => 2013)

Bernd Wurst authored on19/01/2013 10:49:50
Showing1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 This file belongs to the Webinterface of schokokeks.org Hosting.
4 4
 Please see http://source.schokokeks.org for the newest source files.
5 5
 
6
-Written 2008-2012 by schokokeks.org Hosting, namely
6
+Written 2008-2013 by schokokeks.org Hosting, namely
7 7
   Bernd Wurst <bernd@schokokeks.org>
8 8
   Hanno Böck <hanno@schokokeks.org>
9 9
 
Browse code

Added license tags for CC0, README and COPYING

Bernd Wurst authored on11/03/2012 15:40:04
Showing1 changed files
... ...
@@ -1,4 +1,19 @@
1 1
 <?php
2
+/*
3
+This file belongs to the Webinterface of schokokeks.org Hosting.
4
+Please see http://source.schokokeks.org for the newest source files.
5
+
6
+Written 2008-2012 by schokokeks.org Hosting, namely
7
+  Bernd Wurst <bernd@schokokeks.org>
8
+  Hanno Böck <hanno@schokokeks.org>
9
+
10
+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.
11
+
12
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see 
13
+http://creativecommons.org/publicdomain/zero/1.0/
14
+
15
+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.
16
+*/
2 17
 
3 18
 require_once('config.php');
4 19
 require_once('inc/debug.php');
Browse code

Umstellung auf Theme-Support (Frei nach phptemplate)

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1811 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on18/09/2010 13:35:10
Showing1 changed files
... ...
@@ -4,6 +4,7 @@ require_once('config.php');
4 4
 require_once('inc/debug.php');
5 5
 require_once('inc/db_connect.php');
6 6
 require_once("inc/base.php");
7
+require_once("inc/theme.php");
7 8
 
8 9
 
9 10
 $go = $_GET['go'];
... ...
@@ -23,11 +24,11 @@ if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists
23 24
 {
24 25
   die("illegal command");
25 26
 }
26
-$tmp = explode('/', $go, 2);
27
-$module = $tmp[0];
27
+list($module, $page) = explode('/', $go, 2);
28
+$page = str_replace('/', '-', $page);
28 29
 if (! in_array($module, config('modules')))
29 30
 {
30
-  die("illegal command");
31
+  die("inactive module");
31 32
 }
32 33
 
33 34
 
... ...
@@ -57,12 +58,12 @@ $section = str_replace("/", "_", $go);
57 58
 /* Let the module work */
58 59
 include("modules/".$go.".php");
59 60
 
60
-//$title = '';
61 61
 if ($output)
62 62
 {
63
-  include('inc/top.php');
64
-  print $output;
65
-  include('inc/bottom.php');
63
+  if (!isset($title)) {
64
+    $title = '';
65
+  }
66
+  show_page($module, $page);
66 67
 }
67 68
 
68 69
 ?>
Browse code

Gebe nichts aus, wenn $output leer ist

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1804 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on06/09/2010 04:40:09
Showing1 changed files
... ...
@@ -57,11 +57,12 @@ $section = str_replace("/", "_", $go);
57 57
 /* Let the module work */
58 58
 include("modules/".$go.".php");
59 59
 
60
-$title = '';
61
-
62
-include('inc/top.php');
63
-print $output;
64
-include('inc/bottom.php');
65
-
60
+//$title = '';
61
+if ($output)
62
+{
63
+  include('inc/top.php');
64
+  print $output;
65
+  include('inc/bottom.php');
66
+}
66 67
 
67 68
 ?>
Browse code

config() liest die Datenbank bei Bedarf selbst aus

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1527 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on05/12/2009 16:28:20
Showing1 changed files
... ...
@@ -5,18 +5,6 @@ require_once('inc/debug.php');
5 5
 require_once('inc/db_connect.php');
6 6
 require_once("inc/base.php");
7 7
 
8
-/*
9
- read configuration from database
10
-*/
11
-
12
-$options = db_query( "SELECT `key`, value FROM misc.config" );
13
-
14
-while( $object = mysql_fetch_assoc( $options ) ) {
15
-//	echo "1";
16
-//	echo $object['key'];
17
-	$config[$object['key']]=$object['value'];
18
-}
19
-//print_r($config);
20 8
 
21 9
 $go = $_GET['go'];
22 10
 
Browse code

neue Bilder, mehr SSL-Zertifikate-Verwaltung

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1445 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on29/08/2009 17:08:03
Showing1 changed files
... ...
@@ -69,6 +69,7 @@ $section = str_replace("/", "_", $go);
69 69
 /* Let the module work */
70 70
 include("modules/".$go.".php");
71 71
 
72
+$title = '';
72 73
 
73 74
 include('inc/top.php');
74 75
 print $output;
Browse code

Mehr config-optionen und config via Wrapper-Funktion benutzen

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1376 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on23/05/2009 15:24:52
Showing1 changed files
... ...
@@ -37,7 +37,7 @@ if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists
37 37
 }
38 38
 $tmp = explode('/', $go, 2);
39 39
 $module = $tmp[0];
40
-if (! in_array($module, $config['modules']))
40
+if (! in_array($module, config('modules')))
41 41
 {
42 42
   die("illegal command");
43 43
 }
Browse code

Webapp-Installer, erste Version die funktioniert

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1276 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on28/02/2009 12:14:27
Showing1 changed files
... ...
@@ -61,7 +61,7 @@ $output = "";
61 61
 $html_header = "";
62 62
 require_once("inc/base.php");
63 63
 /* setup module include path */
64
-ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
64
+ini_set('include_path',ini_get('include_path').':./modules/'.$module.'/include:');
65 65
 
66 66
 /* Look where we are (but let the module override) */
67 67
 $section = str_replace("/", "_", $go);
Browse code

database config options

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1253 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on23/02/2009 16:15:54
Showing1 changed files
... ...
@@ -2,6 +2,22 @@
2 2
 
3 3
 require_once('config.php');
4 4
 require_once('inc/debug.php');
5
+require_once('inc/db_connect.php');
6
+require_once("inc/base.php");
7
+
8
+/*
9
+ read configuration from database
10
+*/
11
+
12
+$options = db_query( "SELECT `key`, value FROM misc.config" );
13
+
14
+while( $object = mysql_fetch_assoc( $options ) ) {
15
+//	echo "1";
16
+//	echo $object['key'];
17
+	$config[$object['key']]=$object['value'];
18
+}
19
+//print_r($config);
20
+
5 21
 $go = $_GET['go'];
6 22
 
7 23
 /*
Browse code

Allow Header entries and AJAX

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1148 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on18/09/2008 15:24:23
Showing1 changed files
... ...
@@ -42,6 +42,7 @@ $prefix = $prefix.str_repeat("../", $count);
42 42
 require_once('session/start.php');
43 43
 
44 44
 $output = "";
45
+$html_header = "";
45 46
 require_once("inc/base.php");
46 47
 /* setup module include path */
47 48
 ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
Browse code

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1135 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on13/08/2008 10:05:40
Showing1 changed files
... ...
@@ -47,7 +47,7 @@ require_once("inc/base.php");
47 47
 ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
48 48
 
49 49
 /* Look where we are (but let the module override) */
50
-$section = str_replace("/", "_", str_replace(".php", "", $go));
50
+$section = str_replace("/", "_", $go);
51 51
 
52 52
 /* Let the module work */
53 53
 include("modules/".$go.".php");
Browse code

eliminate .php extensions for URLs

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1129 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on08/08/2008 19:32:53
Showing1 changed files
... ...
@@ -8,7 +8,14 @@ $go = $_GET['go'];
8 8
  sanitize $go
9 9
 */
10 10
 
11
-if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go")) or (! is_file("modules/$go")))
11
+// filenames can end with .php
12
+if ( substr( $go, strlen( $go ) - 4 ) == '.php' ) {
13
+  $go = substr( $go, 0, strlen($go) - 4);
14
+}
15
+
16
+DEBUG($go);
17
+
18
+if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php")))
12 19
 {
13 20
   die("illegal command");
14 21
 }
... ...
@@ -43,7 +50,7 @@ ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/incl
43 50
 $section = str_replace("/", "_", str_replace(".php", "", $go));
44 51
 
45 52
 /* Let the module work */
46
-include("modules/".$go);
53
+include("modules/".$go.".php");
47 54
 
48 55
 
49 56
 include('inc/top.php');
Browse code

Inaktive module können nicht mehr benutzt werden. Fixed bug #353

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@771 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on09/11/2007 11:00:41
Showing1 changed files
... ...
@@ -12,6 +12,12 @@ if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists
12 12
 {
13 13
   die("illegal command");
14 14
 }
15
+$tmp = explode('/', $go, 2);
16
+$module = $tmp[0];
17
+if (! in_array($module, $config['modules']))
18
+{
19
+  die("illegal command");
20
+}
15 21
 
16 22
 
17 23
 /*
Browse code

Die Module können überschreiben, welcher Menüeintrag aktiv sein soll

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@594 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on08/08/2007 13:00:55
Showing1 changed files
... ...
@@ -15,7 +15,7 @@ if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists
15 15
 
16 16
 
17 17
 /*
18
- contruct prefix
18
+ construct prefix
19 19
 */
20 20
 
21 21
 global $prefix;
... ...
@@ -33,10 +33,12 @@ require_once("inc/base.php");
33 33
 /* setup module include path */
34 34
 ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
35 35
 
36
+/* Look where we are (but let the module override) */
37
+$section = str_replace("/", "_", str_replace(".php", "", $go));
38
+
36 39
 /* Let the module work */
37 40
 include("modules/".$go);
38 41
 
39
-$section = str_replace("/", "_", str_replace(".php", "", $go));
40 42
 
41 43
 include('inc/top.php');
42 44
 print $output;
Browse code

aufgerufenes Modul muss eine Datei sein.

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@527 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on01/07/2007 17:27:44
Showing1 changed files
... ...
@@ -8,7 +8,7 @@ $go = $_GET['go'];
8 8
  sanitize $go
9 9
 */
10 10
 
11
-if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go")))
11
+if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go")) or (! is_file("modules/$go")))
12 12
 {
13 13
   die("illegal command");
14 14
 }
Browse code

Menü-Includes sinnvoller / Debug-Modus über config abschaltbar

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@526 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on01/07/2007 16:21:48
Showing1 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 <?php
2 2
 
3
+require_once('config.php');
3 4
 require_once('inc/debug.php');
4 5
 $go = $_GET['go'];
5 6
 
Browse code

Logging aktiviert

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@509 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on17/06/2007 08:58:53
Showing1 changed files
... ...
@@ -28,7 +28,7 @@ $prefix = $prefix.str_repeat("../", $count);
28 28
 require_once('session/start.php');
29 29
 
30 30
 $output = "";
31
-include("inc/base.php");
31
+require_once("inc/base.php");
32 32
 /* setup module include path */
33 33
 ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
34 34
 
Browse code

webinterface => /webinterface

git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@362 87cf0b9e-d624-0410-a070-f6ee81989793

bernd authored on27/03/2007 07:40:51
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,45 @@
1
+<?php
2
+
3
+require_once('inc/debug.php');
4
+$go = $_GET['go'];
5
+
6
+/*
7
+ sanitize $go
8
+*/
9
+
10
+if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go")))
11
+{
12
+  die("illegal command");
13
+}
14
+
15
+
16
+/*
17
+ contruct prefix
18
+*/
19
+
20
+global $prefix;
21
+$prefix = "../";
22
+$count = 0;
23
+str_replace("/", "x", $go, $count);
24
+
25
+$prefix = $prefix.str_repeat("../", $count);
26
+
27
+
28
+require_once('session/start.php');
29
+
30
+$output = "";
31
+include("inc/base.php");
32
+/* setup module include path */
33
+ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
34
+
35
+/* Let the module work */
36
+include("modules/".$go);
37
+
38
+$section = str_replace("/", "_", str_replace(".php", "", $go));
39
+
40
+include('inc/top.php');
41
+print $output;
42
+include('inc/bottom.php');
43
+
44
+
45
+?>