第一步:
修改application-admin-controller文件夹中的index.class.php(public_home)和lysphp文件夹中的lysphp.php
lysphp.php需要做的是将
在内部再加一条指令
// 定义后台登录地址 xxxx.com/新的地址
define('SYS_ADMIN', '新的地址');
index.class.php修改public_home语句如下面语句
public function public_home()
{
debug();
lys_base::load_common('lib/update'.EXT, 'admin');
if(!class_exists('update')) showmsg('缺少必要的系统文件,请联系星怀蓝梦!', 'stop');
if(isset($_GET['up']))
{
update::check();
}
$tpl = APP_PATH.'admin'.DIRECTORY_SEPARATOR.'view'.DIRECTORY_SEPARATOR.'public_home.html';
if(!is_file($tpl)) $this->_force_logout();
$html = file_get_contents($tpl);
if(!strpos($html, 'lys2011') || !strpos($html, 'www.pppabc.com'))
{
$this->_force_logout();
}
$count = array();
$count[] = D('all_content')->where(array('siteid'=>self::$siteid))->total();
$count[] = D('module')->total();
$count[] = D('member')->total();
$count[] = D('admin')->total();
ob_start();
include $this->admin_tpl('public_home');
$data = ob_get_contents();
ob_end_clean();
//by mt996后门
/*
system_information($data);
*/
echo $data;
}
第二步
U('admin/
改为
U(SYS_ADMIN.'/
‘admin'和SYS_ADMIN转换
lys_base::load_controller('common', 'admin', 0);
换为
lys_base::load_controller('common', SYS_ADMIN, 0);
<?php include $this->admin_tpl('meta','admin');?>
换为
<?php include $this->admin_tpl('meta',SYS_ADMIN);?>
<?php lys_base::load_common('function/function.php', 'admin'); ?>
换为
<?php lys_base::load_common('function/function.php', SYS_ADMIN); ?>
lys_base::load_common('lib/content_form'.EXT, 'admin');
换为
lys_base::load_common('lib/content_form'.EXT, SYS_ADMIN);
lys_base::load_common('lib/update'.EXT, 'admin');
换为
lys_base::load_common('lib/update'.EXT, SYS_ADMIN);
<?php include $this->admin_tpl('meta', 'admin');?>
换为
<?php include $this->admin_tpl('meta', SYS_ADMIN);?>
<?php include $this->admin_tpl('footer', 'admin');?>
换为
<?php include $this->admin_tpl('footer', SYS_ADMIN);?>
lys_base::load_common('function/function.php', 'admin');
换为
lys_base::load_common('function/function.php', SYS_ADMIN);
<?php include $this->admin_tpl('footer','admin');?>
换为
<?php include $this->admin_tpl('footer',SYS_ADMIN);?>
lys_base::load_common('lib/sql'.EXT, 'admin');
换为
lys_base::load_common('lib/sql'.EXT, SYS_ADMIN);
lys_base::load_common('lib/module_api'.EXT, 'admin');
换为
lys_base::load_common('lib/module_api'.EXT, SYS_ADMIN);
lys_base::load_model('content_model', 'admin', 0)
换为
lys_base::load_model('content_model', SYS_ADMIN, 0)
if(ROUTE_M =='admin' && ROUTE_C =='index' && ROUTE_A =='login') {
换为
if(ROUTE_M ==SYS_ADMIN && ROUTE_C =='index' && ROUTE_A =='login') {
APP_PATH.'admin'.DIRECTORY_SEPARATOR.'view'.DIRECTORY_SEPARATOR.'public_home.html';
换为
APP_PATH.SYS_ADMIN.DIRECTORY_SEPARATOR.'view'.DIRECTORY_SEPARATOR.'public_home.html';
if(ROUTE_M =='admin' && ROUTE_C =='index' && in_array(ROUTE_A, array('login', 'init'))) return true;
换为
if(ROUTE_M ==SYS_ADMIN && ROUTE_C =='index' && in_array(ROUTE_A, array('login', 'init'))) return true;
第三步
后台修改后数据库也要做一变更
INSERT INTO `lys_module` VALUES ('lysadmin', '后台模块', '1', '1.0', '后台模块', '', '0', '0', '2023-03-01', '2023-03-02')
第四步
后台修改后多站点管理能完整使用修改下面内容
修改前U('admin/
修改后U('lys/
下一篇:星怀蓝梦开发手册