<?php
/*
 +----------------------------------------------------------------------
 | TEMMOKUMVC [ NO BEST, ONLY BETTER ]
 +----------------------------------------------------------------------
 | Copyright (c) 2018~2019 https://www.temmoku.cn All rights reserved.
 +----------------------------------------------------------------------
 | Author: 张宗强 Email:webmaster@temmoku.cn QQ:158726877 516669373 TEL:17895221001 微信:temmokumvc
 +---------------------------------------------------------------------- 
 user模块扩展控制器
 权限所需
 user 模块必须加载此控制器
 */
namespace temmoku;
use \temmoku\controller;
abstract class user extends controller{
	function __construct()
    {
    	parent :: __construct();
		hook_listen('global_user_begin');
       	$this->test_user();
       	define('USER_URL', WEBURL."/user/");
		//会员主视图位置常量
    	define('USER_VIEW', "/user/view/");
       	//将编辑器设置加载进来
       if(!C('UEDITOR_CONFIG.function')){
			$file_conf=APP_PATH."plugin/ueditor/conf/";
			load_conf($file_conf);
			C('UEDITOR_CONFIG.function',unserialize(C('ueditor|UEDITOR_CONFIG.function')));
		}
       	//模型上传插件判断入口
       	define('from_upfile_custiom_model', "user");
		hook_listen('global_user_end');
    }
    private function test_user(){
    	if(!$this->user){
    		$this->success('您还没有登陆，正在跳转到登陆页面','/login/');
		    exit;
	    }
	    if(C('MYGROUP.if_login_user')=='0'){
	    	$this->err('你的群组已经禁止登陆会员中心');
	    }
    }
}

?>
