PHP网络验证CMS,开源PHP网络验证 RainCms 2.2.0 20170510 不知这是Bug还是我配置的事

[PHP] 纯文本查看 复制代码<?php

namespace app\admin\controller;

use think\Session;

use think\Controller;

use think\Db;

use think\Request;

use auth;

class Base extends controller {

public function _initialize() {

$request = Request::instance();

$web_path = $request->root();

$module_name = $request->module();

$controller_name = $request->controller();

$action_name = $request->action();

$loginuid = Session('uid');

$authName = $module_name.'/'.$controller_name.'/'.$action_name;

$auth = new \auth\Auth();

$res=$auth -> check(strtolower($authName), $loginuid);

if($loginuid==1){

$res=TRUE;

}

if($controller_name == 'Login'){

$res=TRUE;

}

if($res==FALSE){

if (Request::instance()->isAjax()){

echo '没有权限!';

exit;

}else{

$this->error('没有访问权限');

exit;

}

}

if(!checkmodul('agents') && $controller_name == 'Agents'){

$this->error('您未购买代{过}{滤}理模块,请至 www.rain68.com 购买');

exit;

}

$agenttype=Db::name('agents_type')->where('id',1)->find();

if(!$agenttype){

$data = [

'id' => 1,

'name' => '普通',

'discount' => '100',

'min_score' => '0',

];

Db::name('agents_type')->insert($data);

}

$nav=new Nav();

$leftnav=$nav->leftnav();

$this -> assign('controller', $leftnav['controller']);

$this -> assign('action', $leftnav['action']);

$this -> assign('leftinfo', $leftnav['menuinfo']);

$this -> assign('levelid', $leftnav['levelid']);

$loginuser = Session::get('username');

$this -> assign('loginuser', $loginuser);

$this -> assign('loginuid', $loginuid);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值