-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.php
68 lines (54 loc) · 2.2 KB
/
index.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
<?php
define("FANWE_REQUIRE",true);
require_once './system/mapi_init.php';
fanwe_require(APP_ROOT_PATH.'mapi/lib/redis/BaseRedisService.php');
require APP_ROOT_PATH.'system/template/template.php';
$tmpl = new AppTemplate;
$GLOBALS['tmpl']->cache_dir = APP_ROOT_PATH . 'public/runtime/app_index/tpl_caches';
$GLOBALS['tmpl']->compile_dir = APP_ROOT_PATH . 'public/runtime/app_index/tpl_compiled';
$GLOBALS['tmpl']->template_dir = APP_ROOT_PATH . 'app_index/theme/view';
$GLOBALS['tmpl']->assign("TMPL_REAL",APP_ROOT_PATH."app_index/theme/view");
$tmpl_path = get_domain().APP_ROOT."/app_index/theme";
$GLOBALS['tmpl']->assign("TMPL",$tmpl_path);
$jstmpl_path = get_domain().APP_ROOT."/app_index/";
$GLOBALS['tmpl']->assign("JSTMPL",$jstmpl_path);
fanwe_require(APP_ROOT_PATH.'app_index/lib/core/common.php');
fanwe_require(APP_ROOT_PATH.'mapi/lib/core/common.php');
filter_injection($_REQUEST);
$_REQUEST['ctl'] = filter_ma_request($_REQUEST['ctl']);
$_REQUEST['act'] = filter_ma_request($_REQUEST['act']);
$search = array("../","\n","\r","\t","\r\n","'","<",">","\"","%","\\",".","/");
$itype = str_replace($search,"",$_REQUEST['itype']);
$class = strtolower(strim($_REQUEST['ctl']))?strtolower(strim($_REQUEST['ctl'])):"index";
$class_name = $class;
$lib = $itype?$itype:'app_index';
if($lib=='lib'){
fanwe_require(APP_ROOT_PATH."mapi/lib/base.action.php");
@fanwe_require(APP_ROOT_PATH."mapi/lib/".$class.".action.php");
$class=$class.'Module';
}else{
fanwe_require(APP_ROOT_PATH."mapi/lib/base.action.php");
fanwe_require(APP_ROOT_PATH."mapi/".$lib."/base.action.php");
fanwe_require(APP_ROOT_PATH."mapi/".$lib."/".$class.".action.php");
$class=$class.'CModule';
}
$act = strtolower(strim($_REQUEST['act']))?strtolower(strim($_REQUEST['act'])):"index";
$GLOBALS['tmpl']->assign("ctl",$class_name);
$GLOBALS['tmpl']->assign("act",$act);
if(class_exists($class)){
$obj = new $class;
if(method_exists($obj, $act)){
$obj->$act();
}
else{
$error["errcode "] = 10006;
$error["errmsg "] = "接口方法不存在";
ajax_return($error);
}
}
else{
$error["errcode "] = 10005;
$error["errmsg "] = "接口不存在";
ajax_return($error);
}
?>