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

class p201edit_sxExe extends xIExecutor {
	
	public function main() {
		$tips = '';
		$user = new xUser((int)$_GET['id']);
		$groups = xGroup::getAll();
		if(isset($_POST['emailTxt'])) {
			$group = $groups[$_POST['groupTxt']];
			$user->email = $_POST['emailTxt'];
			if($_POST['passwordTxt']!='') {
				$user->setPassword($_POST['passwordTxt']);
			}
			$user->addTo('disk_ext', $_POST['diskExtTxt']);
			$user->addTo('disk_max', $group['disk_max'].'+'.$user->disk_ext);
			$user->class = $_POST['groupTxt'];
			$user->update();
			$tips = '用户已编辑完毕<br /><a href="?ac=p201">点我返回用户列表</a>';
		}
		include_once(__ROOT__.'admin/ui.p201edit.php');
	}
	
	public function onError($result) {
		
	}
	
}
