<?php

/*
 *      【TuntronJxt v4.0】 (C)2010-2012 Tuntron Inc.
 *      
 *    	http://www.tuntron.com   QQ：1121251729  
 *		
 *      &模块入口文件&
 */
 
if (!defined('IS_RUN')) die('Forbidden');

include_once(TUNTRON_INC.'/class/base.class.php'); //加载基础类文件
include_once(TUNTRON_INC.'/class/mod.class.php');  //加载模块类文件
$_G['siteinfo'] = fileRead('dat/siteinfo.php');    //载入系统配置
//include_once(TUNTRON_INC.'/fields_check.php');   //加载参数验证文件

//判断网站是否关闭: 0为关闭，1为开启
if(!in_array($mod,array('system','login'))&&$_G['siteinfo']['cfg_if_site_open']==0) 
Note($_G['siteinfo']['cfg_site_open_reason'],'点击关闭');

//开始执行module action
if(is_file('module/'.$mod.'/'.$do.'.php')){
	
	define('SITEURL', $_G['siteinfo']['SiteUrl']);
	define('PUBURL', SITEURL.'public/');
	

	//加载模块类文件
	if(is_file(TUNTRON_INC.'/class/'.$mod.'.class.php')){
		include_once(TUNTRON_INC.'/class/'.$mod.'.class.php');
	}
	
	//判断登录
	
	if($mod!=='login'&&$mod!=='help') G_class('user') ->isLogin($_SERVER['REQUEST_URI']);
	if(intval($_CO['groupid'])>0) {
		$arrgroup = G_class('usergroup')->read($_CO['groupid']);
		//权限判断 -待完善
		$modarray = explode(',',$arrgroup['menuid']); 
		$_G['access'] = G_class('usergroup')->get_access($_CO['groupid']);
		
		if($_G['access']['member_forbidden']&&$do!=='login'&&$mod!=='login') Note('您所在用户组无权访问本系统！','>>点击退出<<',SITEURL.'?mod=login&do=login&c=out');
		
		if($arrgroup['grouptype']<>$mod&&!in_array($mod, array('login','help','group','fullFilePatch'))&&_post('action')!=='cpwd') Note('您所在用户组无权访问该页面！');

		//导航菜单显示
		$nav_menu_html = G_class('menu') ->get_menu_html($arrgroup['menuid'],$do);
		
	}
	//顶部菜单显示
	$top_menu_html = G_class('menu') ->get_menu_html('77','','top');//77为顶部菜单ID
	//底部菜单显示
	$bottom_menu_html = G_class('menu') ->get_menu_html('34','','bottom');//34为底部菜单ID

	if($_CO['cpwd']&&_post('action')!=='cpwd'&&$do!=='login'&&$mod!=='login'){$mod = 'school';$do  = 'usercpwd';}//修改初始密码
	
	include 'module/'.$mod.'/'.$do.'.php';
	
}else{
	
	header("HTTP/1.1 404 Not Found");
	header("Status: 404 Not Found");
	echo 'No MOD 404 Page！';
	exit;
}




?>