以下这段代码限制用户必须登录才能访问页面内容, 如果修改 改为未登录一样可以浏览网页内容? 麻烦高手指点下 谢谢
- <?php
- if(!defined('IN_DISCUZ')) {
- exit('Access Denied');
- }
-
- class BaseAction
- {
-
- protected $uid;
- protected $vc_name;
- protected $confArray;
-
- function __construct()
- {
- global $_G;
- $this->uid = $_G['uid'];
- $this->confArray = array(
-
- 'ip'=>$_G['clientip'],
- 'uid'=>$this->uid,
- 'uname'=>$_G['username'],
-
- );
- }
- protected function _checkAndLogin(){
- global $_G;
- if(empty($_G['uid'])){
- showmessage(lang('plugin/zwhl_xuyuan', 'not_login'),NULL,'',array('login'=>'1'));
- }
- }
- protected function _isLogin(){
- global $_G;
- if(empty($_G['uid'])){
- return false;
- }
- return true;
- }
-
- protected function _checkFormhash(){
- global $_G;
-
- }
-
-
- }
- ?>
复制代码
|