<?php
require('path.inc.php');
$page->title =  $page->title.' - 委托信息';
$member = new Member($query);
$page->name = 'changePw';
$id = intval($_GET['id']);
$datainfo = $member->getInfo($id,'*',false);
$page->tpl->assign('datainfo', $datainfo);
$page->tpl->assign('id', $id);
if($page->action == 'update'){
try{
	$id = intval($_POST['id']);
	$passwd = md5($_POST['passwd']);
	$data = array('passwd'=>$passwd);
    	if($page->uc==1){
			//同步修改uc用户密码
			require($cfg['path']['root'].'uc_client/client.php');
			$datainfo = $member->getInfo($id,'*',false);
			uc_user_edit($datainfo['username'],'',$_POST['passwd'],'',1);
		}
	$member->updateInfo($id,$data,false,0);
	$page->goto('index.php','修改成功');
	}catch (Exception $e){
		$page->back("修改失败");
	}
	exit;
}
$page->show();
?>
