<?php
/*
 *		Powered by YiCms 
 *
 *		mailto:yixiao@yicms.cn
 *
 */
class BaseAction extends Action {
	public function checkUser($level){
		if(empty($_SESSION['aid'])) $this->redirect('/Admin/Index/login');
		if(!empty($level) && !in_array($level,$_SESSION['levels'])) $this->error('您没有此权限!.');
	}
	public function index(){
		$this->checkUser('1_1_1');
		$data = M('Config');
		$list = $data->find();
		$list['logo'] =  C('YICMS_PUBLIC').'/'.$list['logo'];
		$this->assign('list',$list);
		$this->display();
	}
	public function checkBase(){
		$this->checkUser('1_1_2');
		unset($_POST['__hash__']);
		$data = M('Config');
		$_POST['statcode'] = stripslashes($_POST['statcode']);
		$_POST['icp'] = stripslashes($_POST['icp']);
		$_POST['copy'] = stripslashes($_POST['copy']);
		if(!$data->where('id=1')->save($_POST)) $this->error('修改失败!请重试 = =!');
		$this->success('修改成功! ^_^');
	}
}
?>