<?php
	@ini_set('display_errors','0');
	error_reporting (E_ALL & ~E_NOTICE);
	header("Cache-Control: no-cache, must-revalidate");
	define('DIRCMS_MEMBER',true);
	define('DIRCMS_ROOT', str_replace("\\", '/',substr(dirname(__FILE__),0,-6)));
	include DIRCMS_ROOT.'include/common.inc.php';
	include DIRCMS_ROOT.'member/include/global.func.php';
	if(!isset($file))$file='index'; 
	$job=$job?$job:'main';
	$action=isset($action)?$action:'';
	(!preg_match('/^[0-9a-z_]+$/i',$file) || !file_exists(DIRCMS_ROOT.'member/'.$file.'.inc.php')) && fatal_error('参数有误,返回网站首页!');
	session_start();
	if(!$_userid && $file!='login')showmsg('您尚未登录,请先登录!','?file=login&action=login');
	if($_userid && $_groupid==2)showmsg('您当前的会员组为游客，无法使用会员中心!',$DIRCMS['site_url'].'member/index.php?file=login&action=login');
	$leftmenu=array();
	$parent=cache_read('parent.cache.php',DIRCMS_ROOT.'data/cache_category/');
	if($parent)foreach($parent as $_parent)
	{
		$parent['priv']=explode(',',$_parent['postpriv']);
		if(!$_parent['ispage'] && $_parent['isshow']&& (in_array($_groupid,$parent['priv']) || $_groupid==1)) // 权限检查
		{
			$leftmenu[]=$_parent;
		}
	}
	$usepriv=cache_read('usepriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$newspriv=cache_read('newspriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$productpriv=cache_read('productpriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$couponpriv=cache_read('couponpriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$newscheckpriv=cache_read('newscheckpriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$productcheckpriv=cache_read('productcheckpriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$couponcheckpriv=cache_read('couponcheckpriv.cache.php',DIRCMS_ROOT.'company/cache/');
	$templatepriv=cache_read('templatepriv.cache.php',DIRCMS_ROOT.'company/cache/');

	$module=cache_read('member_module.cache.php',DIRCMS_ROOT.'data/cache_module/');
	include DIRCMS_ROOT.'member/'.$file.'.inc.php';
?>