<?php
if (!defined('USING_SYSTEM')) exit;

class p202edit_sxExe extends xIExecutor {
	
	public function main() {
		$tips = '';
		$group = new xGroup((int)$_GET['id']);
		if($group->isValid()) {
			if(isset($_POST['diskMaxTxt'])) {
				$group->disk_max = $_POST['diskMaxTxt'];
				$group->filesize_limit = $_POST['filesizeLimitTxt'];
				if($_POST['DEFAULTSHARETxt']=='1') $group->mr0 |= USR_R0_DEFAULTSHARE;
				else $group->mr0 &= ~USR_R0_DEFAULTSHARE;
				// --- 处理 ext ---
				$_POST['fileExtTxt'] = str_replace('，', ',', $_POST['fileExtTxt']);
				$fileExts = explode(',', $_POST['fileExtTxt']);
				$fileExt = '';
				foreach($fileExts as $fe) {
					if($fe!='') $fileExt.=$fe.',';
				}
				if($fileExt!='')$fileExt=substr($fileExt, 0, -1);
				$group->file_ext = $fileExt;
				$tips = '用户组已编辑完毕<br /><a href="?ac=p202">点我返回组列表</a>';
				xUser::unlockFlush();
			}
			include_once(__ROOT__.'admin/ui.p202edit.php');
		}
	}
	
	public function onError($result) {
		
	}
	
}
