3ef995c2108fe77d22c0b556fb9717cb848bc48f
bernd webinterface => /webinterface

bernd authored 18 years ago

1) <?php
Hanno Böck Add newlines before comment...

Hanno Böck authored 1 year ago

2) 
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

3) /*
4) This file belongs to the Webinterface of schokokeks.org Hosting.
Hanno Böck URLs von http nach https

Hanno Böck authored 9 years ago

5) Please see https://source.schokokeks.org for the newest source files.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

6) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

7) Written by schokokeks.org Hosting, namely
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

8)   Bernd Wurst <bernd@schokokeks.org>
9)   Hanno Böck <hanno@schokokeks.org>
10) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 3 years ago

11) This code is published under a 0BSD license.
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 13 years ago

12) 
13) 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.
14) */
bernd webinterface => /webinterface

bernd authored 18 years ago

15) 
bernd Menü-Includes sinnvoller /...

bernd authored 18 years ago

16) require_once('config.php');
bernd webinterface => /webinterface

bernd authored 18 years ago

17) require_once('inc/debug.php');
bernd database config options

bernd authored 17 years ago

18) require_once("inc/base.php");
bernd Umstellung auf Theme-Suppor...

bernd authored 15 years ago

19) require_once("inc/theme.php");
bernd database config options

bernd authored 17 years ago

20) 
Hanno Default exception handler w...

Hanno authored 7 years ago

21) set_exception_handler('handle_exception');
bernd database config options

bernd authored 17 years ago

22) 
Hanno Böck avoid PHP warnings when arg...

Hanno Böck authored 6 years ago

23) if (!isset($_GET['go']) || !is_string($_GET['go'])) {
Hanno Avoid PHP error if dispatch...

Hanno authored 6 years ago

24)     die("No command");
Hanno Fix codingstyle

Hanno authored 6 years ago

25) }
bernd webinterface => /webinterface

bernd authored 18 years ago

26) $go = $_GET['go'];
27) 
28) /*
29)  sanitize $go
30) */
31) 
bernd eliminate .php extensions f...

bernd authored 17 years ago

32) // filenames can end with .php
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

33) if (substr($go, strlen($go) - 4) == '.php') {
34)     $go = substr($go, 0, strlen($go) - 4);
bernd eliminate .php extensions f...

bernd authored 17 years ago

35) }
36) 
37) DEBUG($go);
38) 
Hanno Böck add note about PHP bug that...

Hanno Böck authored 6 years ago

39) // Can throw invalid open_basedir warnings,
40) // see https://bugs.php.net/52065
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

41) if (strstr($go, "..") or strstr($go, "./") or strstr($go, ":") or (!file_exists("modules/$go.php")) or (!is_file("modules/$go.php"))) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

42)     die("illegal command");
bernd webinterface => /webinterface

bernd authored 18 years ago

43) }
Hanno Böck Codingstyle PSR12 + array s...

Hanno Böck authored 4 years ago

44) [$module, $page] = explode('/', $go, 2);
bernd Umstellung auf Theme-Suppor...

bernd authored 15 years ago

45) $page = str_replace('/', '-', $page);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 2 years ago

46) if (!in_array($module, config('modules'))) {
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

47)     die("inactive module");
bernd Inaktive module können nich...

bernd authored 18 years ago

48) }
bernd webinterface => /webinterface

bernd authored 18 years ago

49) 
50) 
51) /*
bernd Die Module können überschre...

bernd authored 18 years ago

52)  construct prefix
bernd webinterface => /webinterface

bernd authored 18 years ago

53) */
54) 
55) global $prefix;
56) $prefix = "../";
57) $count = 0;
58) str_replace("/", "x", $go, $count);
59) 
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

60) $prefix = $prefix . str_repeat("../", $count);
bernd webinterface => /webinterface

bernd authored 18 years ago

61) 
62) 
63) require_once('session/start.php');
64) 
65) $output = "";
bernd Allow Header entries and AJAX

bernd authored 17 years ago

66) $html_header = "";
bernd Logging aktiviert

bernd authored 18 years ago

67) require_once("inc/base.php");
bernd webinterface => /webinterface

bernd authored 18 years ago

68) /* setup module include path */
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

69) ini_set('include_path', ini_get('include_path') . ':./modules/' . $module . '/include:');
bernd webinterface => /webinterface

bernd authored 18 years ago

70) 
bernd Die Module können überschre...

bernd authored 18 years ago

71) /* Look where we are (but let the module override) */
bernd git-svn-id: https://svn.sch...

bernd authored 17 years ago

72) $section = str_replace("/", "_", $go);
bernd Die Module können überschre...

bernd authored 18 years ago

73) 
bernd webinterface => /webinterface

bernd authored 18 years ago

74) /* Let the module work */
Hanno Böck Spaces between string conca...

Hanno Böck authored 2 years ago

75) include("modules/" . $go . ".php");
bernd webinterface => /webinterface

bernd authored 18 years ago

76) 
Hanno Fix coding style with php-c...

Hanno authored 7 years ago

77) if ($output) {
78)     if (!isset($title)) {
79)         $title = '';
80)     }
81)     show_page($module, $page);