6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
bernd webinterface => /webinterface

bernd authored 17 years ago

1) <?php
2) 
bernd Menü-Includes sinnvoller /...

bernd authored 16 years ago

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

bernd authored 17 years ago

4) require_once('inc/debug.php');
5) $go = $_GET['go'];
6) 
7) /*
8)  sanitize $go
9) */
10) 
bernd eliminate .php extensions f...

bernd authored 15 years ago

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")))
bernd webinterface => /webinterface

bernd authored 17 years ago

19) {
20)   die("illegal command");
21) }
bernd Inaktive module können nich...

bernd authored 16 years ago

22) $tmp = explode('/', $go, 2);
23) $module = $tmp[0];
24) if (! in_array($module, $config['modules']))
25) {
26)   die("illegal command");
27) }
bernd webinterface => /webinterface

bernd authored 17 years ago

28) 
29) 
30) /*
bernd Die Module können überschre...

bernd authored 16 years ago

31)  construct prefix
bernd webinterface => /webinterface

bernd authored 17 years ago

32) */
33) 
34) global $prefix;
35) $prefix = "../";
36) $count = 0;
37) str_replace("/", "x", $go, $count);
38) 
39) $prefix = $prefix.str_repeat("../", $count);
40) 
41) 
42) require_once('session/start.php');
43) 
44) $output = "";
bernd Logging aktiviert

bernd authored 16 years ago

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

bernd authored 17 years ago

46) /* setup module include path */
47) ini_set('include_path',ini_get('include_path').':./modules/'.dirname($go).'/include:');
48) 
bernd Die Module können überschre...

bernd authored 16 years ago

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

bernd authored 15 years ago

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

bernd authored 16 years ago

51) 
bernd webinterface => /webinterface

bernd authored 17 years ago

52) /* Let the module work */
bernd eliminate .php extensions f...

bernd authored 15 years ago

53) include("modules/".$go.".php");