织梦后台判断管理员权限

作者:夏雨芭蕉时间:2016-05-10 13:39:34 浏览量:

检查adminychh->index_body.php里面的第一行引用

require(dirname(__FILE__).'/config.php');

如是这样,说明是5.7版本

adminychh->admin->zyz.php

<?php
require('../config.php');
echo $cuserLogin->getUserID();exit;
?>

同时修改adminychh->config.php

//检验用户登录状态
$cuserLogin = new userLogin();
if($cuserLogin->getUserID()==-1)
{
     $zyz= strpos(urlencode($dedeNowurl),'%2Fadmin%2Fzyz.php'); // 查找/admin/zyz.php是否存在
     if($zyz>0)header("location: ../login.php?gotopage=".urlencode($dedeNowurl));
    else header("location:login.php?gotopage=".urlencode($dedeNowurl));
    exit();
}


Copyright © 2016 Allister All Rights Reserved