forked from NB-Core/lotgd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runmodule.php
61 lines (54 loc) · 1.71 KB
/
runmodule.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
<?php
// translator ready
// addnews ready
// mail ready
define("ALLOW_ANONYMOUS",true);
define("OVERRIDE_FORCED_NAV",true);
require_once("lib/http.php");
require_once("common.php");
require_once("lib/dump_item.php");
require_once("lib/modules.php");
require_once("lib/villagenav.php");
if (injectmodule(httpget('module'), (httpget('admin')?true:false))){
$info = get_module_info(httpget('module'));
if (!isset($info['allowanonymous'])){
$allowanonymous=false;
}else{
$allowanonymous = $info['allowanonymous'];
}
if (!isset($info['override_forced_nav'])){
$override_forced_nav=false;
}else{
$override_forced_nav=$info['override_forced_nav'];
}
do_forced_nav($allowanonymous,$override_forced_nav);
$starttime = getmicrotime();
$fname = $mostrecentmodule."_run";
tlschema("module-$mostrecentmodule");
$fname();
$endtime = getmicrotime();
if (($endtime - $starttime >= 1.00 && ($session['user']['superuser'] & SU_DEBUG_OUTPUT))){
//On a side note, you won't ever see this text. A normal module calls page_footer(), which ends execution here....
debug("Slow Module (".round($endtime-$starttime,2)."s): $mostrecentmodule`n");
$stats = array (
"modulename"=>$mostrecentmodule,
"date"=>date("Y-m-d H:i:s"),
"duration"=>round($endtime-$starttime,5),
);
//remember, this gets only called if you're a user with debug output triggering this!
modulehook("modules_slowmodule",$stats);
}
tlschema();
}else{
do_forced_nav(false,false);
tlschema("badnav");
page_header("Error");
if ($session['user']['loggedin']){
villagenav();
}else{
addnav("L?Return to the Login","index.php");
}
output("You are attempting to use a module which is no longer active, or has been uninstalled.");
page_footer();
}
?>