-
Notifications
You must be signed in to change notification settings - Fork 7
/
admin.php
66 lines (56 loc) · 2.48 KB
/
admin.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
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: admin.php 29236 2012-03-30 05:34:47Z chenmengshu $
*/
define('IN_ADMINCP', TRUE);
define('NOROBOT', TRUE);
define('ADMINSCRIPT', basename(__FILE__));
define('CURSCRIPT', 'admin');
define('HOOKTYPE', 'hookscript');
define('APPTYPEID', 0);
require './source/class/class_core.php';
require './source/function/function_misc.php';
require './source/function/function_forum.php';
require './source/function/function_admincp.php';
require './source/function/function_cache.php';
$discuz = C::app();
$discuz->init();
$admincp = new discuz_admincp();
$admincp->core = & $discuz;
$admincp->init();
$admincp_actions_founder = array('templates', 'db', 'founder', 'postsplit', 'threadsplit', 'cloudaddons', 'upgrade', 'patch');
$admincp_actions_normal = array('index', 'setting', 'members', 'admingroup', 'usergroups', 'usertag',
'forums', 'threadtypes', 'threads', 'moderate', 'attach', 'smilies', 'recyclebin', 'recyclebinpost', 'prune',
'styles', 'addons', 'plugins', 'tasks', 'magics', 'medals', 'google', 'announce', 'faq', 'ec',
'tradelog', 'jswizard', 'project', 'counter', 'misc', 'adv', 'logs', 'tools', 'portalperm',
'checktools', 'search', 'article', 'block', 'blockstyle', 'blockxml', 'portalcategory', 'blogcategory', 'albumcategory', 'topic', 'credits',
'doing', 'group', 'blog', 'feed', 'album', 'pic', 'comment', 'share', 'click', 'specialuser', 'postsplit', 'threadsplit', 'report',
'district', 'diytemplate', 'verify', 'nav', 'domain', 'postcomment', 'tag', 'connect', 'card', 'portalpermission', 'collection', 'membersplit');
$action = dhtmlspecialchars(getgpc('action'));
$operation = dhtmlspecialchars(getgpc('operation'));
$do = dhtmlspecialchars(getgpc('do'));
$frames = dhtmlspecialchars(getgpc('frames'));
lang('admincp');
$lang = & $_G['lang']['admincp'];
$page = max(1, intval(getgpc('page')));
$isfounder = $admincp->isfounder;
if(empty($action) || $frames != null) {
$admincp->show_admincp_main();
} elseif($action == 'logout') {
$admincp->do_admin_logout();
dheader("Location: ./index.php");
} elseif(in_array($action, $admincp_actions_normal) || ($admincp->isfounder && in_array($action, $admincp_actions_founder))) {
if($admincp->allow($action, $operation, $do) || $action == 'index') {
require $admincp->admincpfile($action);
} else {
cpheader();
cpmsg('action_noaccess', '', 'error');
}
} else {
cpheader();
cpmsg('action_noaccess', '', 'error');
}
?>