... | ... |
@@ -43,7 +43,7 @@ DEBUG($go); |
43 | 43 |
if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php"))) { |
44 | 44 |
die("illegal command"); |
45 | 45 |
} |
46 |
-list($module, $page) = explode('/', $go, 2); |
|
46 |
+[$module, $page] = explode('/', $go, 2); |
|
47 | 47 |
$page = str_replace('/', '-', $page); |
48 | 48 |
if (! in_array($module, config('modules'))) { |
49 | 49 |
die("inactive module"); |
... | ... |
@@ -38,6 +38,8 @@ if (substr($go, strlen($go) - 4) == '.php') { |
38 | 38 |
|
39 | 39 |
DEBUG($go); |
40 | 40 |
|
41 |
+// Can throw invalid open_basedir warnings, |
|
42 |
+// see https://bugs.php.net/52065 |
|
41 | 43 |
if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (! file_exists("modules/$go.php")) or (! is_file("modules/$go.php"))) { |
42 | 44 |
die("illegal command"); |
43 | 45 |
} |
... | ... |
@@ -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 |
-?> |
... | ... |
@@ -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 |
|
... | ... |
@@ -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 |
*/ |
... | ... |
@@ -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 |
|
... | ... |
@@ -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 |
|
... | ... |
@@ -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 |
|
... | ... |
@@ -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'); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1811 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
?> |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1804 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
?> |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1527 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1445 87cf0b9e-d624-0410-a070-f6ee81989793
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1376 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
} |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1276 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1253 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
/* |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1148 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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:'); |
... | ... |
@@ -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"); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1129 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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'); |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@771 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
/* |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@594 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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; |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@527 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
} |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@526 87cf0b9e-d624-0410-a070-f6ee81989793
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@509 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -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 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@362 87cf0b9e-d624-0410-a070-f6ee81989793
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 |
+?> |