-
Notifications
You must be signed in to change notification settings - Fork 347
/
Modules.php
69 lines (57 loc) · 1.2 KB
/
Modules.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Modules
*
* Warehouse header
* Get requested program / modname, if allowed
* Warehouse footer
*
* @package RosarioSIS
*/
require_once 'Warehouse.php';
// If no modname found, go back to index.
if ( empty( $_REQUEST['modname'] ) )
{
header( 'Location: index.php' );
exit();
}
$modname = $_REQUEST['modname'];
if ( ! isset( $_REQUEST['modfunc'] ) )
{
$_REQUEST['modfunc'] = false;
}
$_ROSARIO['page'] = 'modules';
// Output Header HTML.
Warehouse( 'header' );
// Performance: up to 10% faster compared to loading Menu.php.
if ( AllowUse() )
{
// Force search_modfunc to list.
if ( Preferences( 'SEARCH' ) !== 'Y' )
{
$_REQUEST['search_modfunc'] = 'list';
}
elseif ( ! isset( $_REQUEST['search_modfunc'] ) )
{
$_REQUEST['search_modfunc'] = '';
}
if ( substr( $modname, -4, 4 ) !== '.php'
|| strpos( $modname, '..' ) !== false
/*|| ! is_file( 'modules/' . $modname )*/ )
{
require_once 'ProgramFunctions/HackingLog.fnc.php';
HackingLog();
}
else
{
require_once 'modules/' . $modname;
}
}
// Not allowed, hacking attempt?
elseif ( User( 'USERNAME' ) )
{
require_once 'ProgramFunctions/HackingLog.fnc.php';
HackingLog();
}
// Output Footer HTML.
Warehouse( 'footer' );