<?php
if(!defined('R_P')) exit('Access Denied');
if(!$user_info['username']) qbase::showmsg( "请登录为会员", "default", "user.php?ac=login");
if($_POST['myFormAc'] == 'update'){
	$password = md5(trim($_POST['password']));
	$new_password = trim($_POST['new_password']);
	$verify_password = trim($_POST['verify_password']);
	if($password != $user_info['password']) qbase::showmsg("当前登录密码错误");
	if($new_password != $verify_password) qbase::showmsg("新密码和确认新密码不一致，请检查");
	$password = md5(trim($_POST['new_password']));
	qdb::query("update ".TABLEPRE."user set password = '{$password}' where uid = '{$user_info['uid']}' ");
	qbase::get_object('login')->delete_user_cache($user_info['uid']);
	if(U_C) uc_user_edit($user_info['username'], $password, $new_password, '');
	qbase::showmsg( "密码更改成功", "default", "user.php?ac=change_password");
}else{
	include qbase::template($_SET['skin']  . '/user/change_password');
}
?>