首頁  >  文章  >  CMS教程  >  ECSHOP 講解修改後台位址

ECSHOP 講解修改後台位址

coldplay.xixi
coldplay.xixi轉載
2021-03-05 10:15:163022瀏覽

ECSHOP 講解修改後台位址

    任何開源程式都有系統漏洞和不安全的特點,因為使用的使用者越來越多,加上上原始碼開放等,更容易被發現漏洞,所有修改後台管理目錄,就顯得更有必要了。廢話少說,以下就說一下如何修改ECSHOP的後台目錄。 ECSHOP 講解修改後台位址

推薦(免費):ECShop

1.修改data/config.php $admin_dir = "admin"; 

#修改成 ##$admin_dir = "新目錄名稱"; 

2.修改admin/index.php //貨號

require_once( ROOT_PATH . 'admin/includes/lib_goods.php'); 修改成

require_once(ROOT_PATH . $admin_dir.'/includes/lib_goods.php'); 

3.修改admin/database.php

require_once(ROOT_PATH . 'admin/includes/ cls_sql_dump.php'); 修改成

require_once(ROOT_PATH . $admin_dir.'/includes/cls_sql_dump.php'); 

4.修改admin/get_password.php 

#$reset_email = $ecs->url() . ' admin/get_password.php?act=reset_pwd&uid='.$admin_id.'&code='.$code; 修改成 

$reset_email = $ ecs->url() . $admin_dir.'/get_password.php?act=reset_pwd&uid='.$admin_id.'&code='.$code; 

#5.修改admin/goods.php

#require_once(ROOT_PATH . '/admin/includes/lib_goods.php'); 修改成require_once(ROOT_PATH . $admin_dir.'/includes/lib_goods.php'); 

6 .修改admin/check_file_priv.php

#$dir[] = 'admin'; 修改成

$dir [] = $admin_dir; 

#7.修改admin/includes/init.php

#if (file_exists(ROOT_PATH . 'data/config.php')) {

##include(ROOT_PATH . 'data/config.php' );

閱讀會員限時特惠7大會員特權立即嚐鮮

##} else {

include(ROOT_PATH . 'includes/config.php'); 

###############}######### #######修改成下面程式碼,並將程式碼移至「」註解之前。 ##################if (file_exists('../data/config.php')) {############## include('../data/config.php'); } else {#########

include('../includes/config.php'); } 

define('ROOT_PATH', str_replace('admin/includes/init.php', '', str_replace('\\', '/' , __文件__)));修改成

define('ROOT_PATH', str_replace($admin_dir.'/includes/init.php', '', str_replace('\\', '/', __FILE__) ));


require(ROOT_PATH . 'admin/includes/lib_main.php');修改成

require(ROOT_PATH . $admin_dir.'/includes/lib_main.php');


#require(ROOT_PATH . 'admin/includes/cls_exchange.php');修改成

require(ROOT_PATH . $admin_dir.'/includes/cls_exchange.php');

$smarty->template_dir = ROOT_PATH 。 '管理/模板';修改成

$smarty->template_dir = ROOT_PATH . $admin_dir.'/模板';

$admin_path = preg_replace('/:\d /', '', $ecs-> ;url()) 。 '行政';修改成$admin_path = preg_replace('/:\d /', '', $ecs->url()) 。 $admin_dir;

8.修改include/lib_main.php

include_once(ROOT_PATH . 'admin /includes/lib_template.php');修改成

global $admin_dir;

include_once(ROOT_PATH . $admin_dir.'/includes/lib_template.php');

##9.修改include/cls_ecshop.php

##$curr = strpos (PHP_SELF, 'admin/') !== false ?

#preg_replace('/(.*)(admin)(\/?)(.)*/i', ' \1', 目錄名(PHP_SELF)) : 目錄名(PHP_SELF);修改成

global $admin_dir;

$curr = strpos(PHP_SELF, $admin_dir.'/') !== false ? preg_replace('/(.*)('.$admin_dir.')(\/?)(.)*/i', '\1', 目錄名(PHP_SELF)) : 目錄名(PHP_SELF);

10.修改/admin/picture_batch.php 將

##include_once(ROOT_PATH . '/admin/includes/lib_goods.php');修改成

include_once(ROOT_PATH .$admin_dir.'/includes/lib_goods.php');

##11.修改quotation.php

include_once(ROOT_PATH . '管理/包括/lib_main.php');修改成

global $admin_dir;

###include_once(ROOT_PATH . $admin_dir.'/includes/lib_main.php');#### ######

以上是ECSHOP 講解修改後台位址的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除