phpcms admin.php

來源:互聯網
上載者:User
1 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 // 如果是Administrator 群組且已經登入,則載入 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看模板是分成三欄結構:頂端是;左側的樹型結構: 以及中間的iframe

2.後台代碼

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.