<?php defined('SYSPATH') or die('No direct script access.');
class Public_Controller extends Controller{
	function __construct(){
		parent::__construct();
		define("BASEURL",Kohana::config('config.site_domain'));
		$db_cfg	=	Kohana::config('database.default');
		define("DBFIX",$db_cfg['table_prefix']);
		unset($db_cfg);
//		$this->profiler = new Profiler;
//		$this->profiler->render(TRUE);			
		//用户认证
		$auth		=	new Adminauth();
		$this->lmtpl=	new Template();
		$auth->authUser();
		//加载全局变量
		$objglobal	=	new Cfg_Model();
		$cfgList	=	$objglobal->getGlobal()->result_array(false);
		foreach ($cfgList as $tmparray) {
				@define($tmparray['global_name'],$tmparray['global_value']);
		} 
		//加载网站配置
		$baseCfg	=	$objglobal->getBaseCfg();
		foreach($baseCfg as $key=>$value){
			@define(strtoupper($key),$value);
		}
		$this->tplmodel	=	new Template_Model();
	}
	function Report($message,$url='',$status=0){
		$this->lmtpl->message		=	$message;
		$this->lmtpl->lcationurl	=	$url;
		$this->lmtpl->render($this->tplmodel->path("member_report"));
		die();
	}
}