<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
	if ($_GET['var1']==1 && !LabConfig::$cfg['separate_config']) return LabCMS::i()->error('Для суперадмина нет настройки прав');
	include_once dirname(__FILE__).'/functions.php';
	
	$module_conf=getUserGroupConf($_GET['var1']);
	if (!LabCMS::i()->no_errors) return;
	
	$mod_template="access.tpl";
	
	Tpl::i()->assign('group_info', Db::i()->selectRow("SELECT group_id, group_name FROM ?_groups WHERE group_id=?", $_GET['var1']));
	Tpl::i()->assign('modules', $module_conf);
	
	if ($_SERVER['REQUEST_METHOD']=='POST')
	{
		User::checkToken();
		updateUserGroupConf($_GET['var1'], $module_conf, $_POST);
		LabCMS::i()->reset_cache('all');
		refresh();
	}
