1
+ <?php
2
+
3
+ /**
4
+ * [Discuz!] (C)2001-2099 Comsenz Inc.
5
+ * This is NOT a freeware, use is subject to license terms
6
+ *
7
+ * $Id: admin.php 34285 2013-12-13 03:39:35Z hypowang $
8
+ */
9
+
10
+ define ('IN_ADMINCP ' , TRUE );
11
+ define ('NOROBOT ' , TRUE );
12
+ define ('ADMINSCRIPT ' , basename (__FILE__ ));
13
+ define ('CURSCRIPT ' , 'admin ' );
14
+ define ('HOOKTYPE ' , 'hookscript ' );
15
+ define ('APPTYPEID ' , 0 );
16
+
17
+
18
+ require './source/class/class_core.php ' ;
19
+ require './source/function/function_misc.php ' ;
20
+ require './source/function/function_forum.php ' ;
21
+ require './source/function/function_admincp.php ' ;
22
+ require './source/function/function_cache.php ' ;
23
+
24
+ $ discuz = C::app ();
25
+ $ discuz ->init ();
26
+
27
+ $ admincp = new discuz_admincp ();
28
+ $ admincp ->core = & $ discuz ;
29
+ $ admincp ->init ();
30
+
31
+
32
+ $ admincp_actions_founder = array ('templates ' , 'db ' , 'founder ' , 'postsplit ' , 'threadsplit ' , 'cloudaddons ' , 'upgrade ' , 'patch ' , 'optimizer ' );
33
+ $ admincp_actions_normal = array ('index ' , 'setting ' , 'members ' , 'admingroup ' , 'usergroups ' , 'usertag ' ,
34
+ 'forums ' , 'threadtypes ' , 'threads ' , 'moderate ' , 'attach ' , 'smilies ' , 'recyclebin ' , 'recyclebinpost ' , 'prune ' , 'grid ' ,
35
+ 'styles ' , 'addons ' , 'plugins ' , 'tasks ' , 'magics ' , 'medals ' , 'google ' , 'announce ' , 'faq ' , 'ec ' ,
36
+ 'tradelog ' , 'jswizard ' , 'project ' , 'counter ' , 'misc ' , 'adv ' , 'logs ' , 'tools ' , 'portalperm ' , 'blogrecyclebin ' ,
37
+ 'checktools ' , 'search ' , 'article ' , 'block ' , 'blockstyle ' , 'blockxml ' , 'portalcategory ' , 'blogcategory ' , 'albumcategory ' , 'topic ' , 'credits ' ,
38
+ 'doing ' , 'group ' , 'blog ' , 'feed ' , 'album ' , 'pic ' , 'comment ' , 'share ' , 'click ' , 'specialuser ' , 'postsplit ' , 'threadsplit ' , 'report ' ,
39
+ 'district ' , 'diytemplate ' , 'verify ' , 'nav ' , 'domain ' , 'postcomment ' , 'tag ' , 'connect ' , 'card ' , 'portalpermission ' , 'collection ' , 'membersplit ' , 'makehtml ' );
40
+
41
+ $ action = preg_replace ('/[^\[A-Za-z0-9_\]]/ ' , '' , getgpc ('action ' ));
42
+ $ operation = preg_replace ('/[^\[A-Za-z0-9_\]]/ ' , '' , getgpc ('operation ' ));
43
+ $ do = preg_replace ('/[^\[A-Za-z0-9_\]]/ ' , '' , getgpc ('do ' ));
44
+ $ frames = preg_replace ('/[^\[A-Za-z0-9_\]]/ ' , '' , getgpc ('frames ' ));
45
+ lang ('admincp ' );
46
+ $ lang = & $ _G ['lang ' ]['admincp ' ];
47
+ $ page = max (1 , intval (getgpc ('page ' )));
48
+ $ isfounder = $ admincp ->isfounder ;
49
+
50
+ if (empty ($ action ) || $ frames != null ) {
51
+ $ admincp ->show_admincp_main ();
52
+ } elseif ($ action == 'logout ' ) {
53
+ $ admincp ->do_admin_logout ();
54
+ dheader ("Location: ./index.php " );
55
+ } elseif (in_array ($ action , $ admincp_actions_normal ) || ($ admincp ->isfounder && in_array ($ action , $ admincp_actions_founder ))) {
56
+ if ($ admincp ->allow ($ action , $ operation , $ do ) || $ action == 'index ' ) {
57
+ require $ admincp ->admincpfile ($ action );
58
+ } else {
59
+ cpheader ();
60
+ cpmsg ('action_noaccess ' , '' , 'error ' );
61
+ }
62
+ } else {
63
+ cpheader ();
64
+ cpmsg ('action_noaccess ' , '' , 'error ' );
65
+ }
66
+ ?>
0 commit comments