<?php
/*************************************************************\
+-------------------------------------------------------------+
| 通灵佛教网在线烧香程序 System                                 |
| Copyright (c) 2003-2010 Alfred China                        |
| All rights reserved.                                        |
+-------------------------------------------------------------+
\*************************************************************/
if ( !defined('NetGou_START') ) { header("Location: ../"); die("Access denied"); }

if (empty($_COOKIE['ngadmin'])) {
	ng_header_location("login.php");
}else{

	$is_admin=ng_query_first("select ngadmin, adminsion, admintype, password, aid from $sql_tbl[admins] where ngadmin = '$_COOKIE[ngadmin]' AND status = 'Y'");
	
	if($is_admin['password'] != $_COOKIE['password'])
		ng_header_location("login.php");
		
	$adminpagesion = explode(',',$is_admin['adminsion']);
	if(!in_array($pagepermission, $adminpagesion) and $pagepermission != '')
		showmsg("您无权进入该功能页面","admin.php");
}
?>