chengkun
2025-04-30 6ab292fb7415be124651e312ec4f21c594568f17
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
70
71
72
73
74
75
76
77
<?php
 
 
 
include(dirname(dirname(__FILE__)) . "/global.php");
//伪静态操作end
//model方法
//action方法
 
$DirNameList    =   explode('\\', dirname(__FILE__));
$ModuleName     =   end($DirNameList);
 
if ($_GET['c'] && !preg_match("/^[0-9a-zA-Z\_]*$/", $_GET['c'])) {
    $_GET['c']  =   'index';
}
 
$model  =   $_GET['c'];
$action =   $_GET['act'];
 
if ($model == "") $model = "index";
if ($action == "") $action = "index";
 
$usertype   =   $_COOKIE['usertype'];
if ($usertype == 1) {
 
    $type   =   "user";
} else if ($usertype == 2) {
 
    $type   =   "com";
} elseif ($usertype == 3) {
 
    $type   =   "lietou";
} elseif ($usertype == 4) {
 
    $type   =   "train";
} else {
 
    if ($_COOKIE['uid']) {
 
        header('Location: ' . Url('register', array('c' => 'ident')));
        die;
    } else {
 
        header('Location: '.Url('login'));die;
    }
}
 
if ($_GET['c'] == "subject_add" && $usertype != "4") {
 
    header('Location: ' . Url('login'));
    die;
}
 
require(APP_PATH . 'app/public/common.php');
if ($_GET['m'] == 'ajax') {
 
    require('ajax.class.php');
    $model  =   $_GET['m'];
    $action =   $_GET['c'];
} else {
 
    require($type . "/" . $type . '.class.php');
    require($type . "/model/" . $model . '.class.php');
}
 
$conclass   =   $model.'_controller';
$actfunc    =   $action.'_action';
 
$views      =   new $conclass($phpyun, $db, $db_config["def"], "member");
if (!method_exists($views, $actfunc)) {
 
    $views->DoException();
}
$views->obj =   $views->MODEL('userinfo');
$views->$actfunc();
 
?>