phpcms admin.php
1 php
2 define( ' IN_ADMIN ' , TRUE);
3 // 全局函数
4 require dirname(__FILE__). ' /include/admin/global.func.php ' ;
5 /**/ /*加载站点配置.主要是
6 获取用户信息,$_userid,$_groupid
7 define('CACHE_MODEL_PATH', PHPCMS_ROOT.'data/cache_model/'); //模型缓存存储路径,以后加载数据用
8 set_include_path(PHPCMS_ROOT.'include/');,
9 extract($_REQUEST))
10*/
11 require dirname(__FILE__). ' /include/common.inc.php ' ;
12 // 然后开始加载通用类:日志类(include/log.class.php),表单类,角色权限类,缓存函数,版本号,多国语言。
13 require ' log.class.php ' ;
14 require ' form.class.php ' ;
15 require ' priv_role.class.php ' ;
16 require_once ' cache.func.php ' ;
17 require_once ' version.inc.php ' ;
18 require PHPCMS_ROOT. ' languages/ ' .LANG. ' /phpcms_admin.lang.php ' ;
19 if ( ! isset($file)) $file = ' index ' ;
20 // 如果模块下的文件$file不以字母,数字,下划线,中划线开始,则返回错误;这里的 $mod,$file,$action 都是url地址参数,
21 // 例如: http://localhost/phpcms/admin.php?mod=phpcms &file=admin&action=add
22 preg_match( " /^[0-9A-Za-z_-]+$/ " , $file) or showmessage( ' Invalid Request. ' );
23 $action = isset($action) ? $action : '' ;
24 $catid = isset($catid) ? intval($catid) : 0 ;
25 $specialid = isset($specialid) ? intval($specialid) : 0 ;
26 if ( ! isset($forward) && str_exists(HTTP_REFERER, ' ? ' )) $forward = HTTP_REFERER;
27 session_start();
28 // 如果是管理员组且已经登录,则加载 data/cache_model/admin_role_1.php文件,中的角色并检测模块权限
29 if ($_userid && $_groupid == 1 && $_SESSION[ ' is_admin ' ] == 1 )
30 {
31 $ROLE = cache_read('role.php');
32 $GROUP = cache_read('member_group.php');
33 $POS = cache_read('position.php');
34 $STATUS = cache_read('status.php');
35 $_roleid = cache_read('admin_role_'.$_userid.'.php');
36 if(!$_roleid) showmessage('您没有任何角色权限!');
37 $priv_role = new priv_role();
38 if(!$priv_role->module()) showmessage('您没有操作权限!');
39}
40 elseif($file != ' login ' )
41 {
42 showmessage('请登录!', '?mod=phpcms&file=login&forward='.urlencode(URL),1,1);
43}
44 $log = new log();
45 // 如果设置为记录日志,则记录登录信息。
46 if (ADMIN_LOG && $file != ' database ' && ! in_array($action, array( ' get_menu_list ' , ' menu_pos ' )))
47 {
48 $log->set('admin', 0);
49 $log->add();
50}
51 // url地址?mod=phpcms默认都是这个phpcms,否则要加载admin/admin.inc.php
52 if ($mod != ' phpcms ' && ! @include PHPCMS_ROOT.$M[ ' path ' ]. ' admin/admin.inc.php ' ) showmessage( ' The file ./ ' .$M[ ' path ' ]. ' admin.inc.php is not exists! ' );
53 // 加载admin/index.inc.php文件;
54 // 主要是:首先加载menu.class.php类并获取菜单信息。然后加载admin/templates/index.tpl.php模板
55 if ( ! @include PHPCMS_ROOT.(isset($M[ ' path ' ]) ? $M[ ' path ' ] : '' ). ' admin/ ' .$file. ' .inc.php ' ) showmessage( " The file ./{$M['path']}admin/{$file}.inc.php is not exists! " );
56 ?>
57
1.后台模板
从firebug看模板是分成三栏结构:顶端是
2.后台代码

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...

Article discusses late static binding (LSB) in PHP, introduced in PHP 5.3, allowing runtime resolution of static method calls for more flexible inheritance.Main issue: LSB vs. traditional polymorphism; LSB's practical applications and potential perfo

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

Article discusses essential security features in frameworks to protect against vulnerabilities, including input validation, authentication, and regular updates.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...
