<?
(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
aheader();
if(!submitcheck('bmemberdetail')){
	$submitstr = '';
	tabheader('修改我的密码','memberdetail',"?entry=password_cp",2,1,1);
	trbasic('输入新密码','minfosnew[password]','','password');
	trbasic('重输新密码','minfosnew[passwordr]','','password');
	$submitstr .= makesubmitstr('minfosnew[password]',1,0,3,15);
	$submitstr .= makesubmitstr('minfosnew[passwordr]',1,0,3,15);
	tabfooter('bmemberdetail');
	check_submit_func($submitstr);
}else{
	if(empty($minfosnew['password']) || (strlen($minfosnew['password']) > 15) || $minfosnew['password'] != addslashes($minfosnew['password'])){
		amessage('memberpwdillegal', M_REFERER);
	}
	if($minfosnew['password'] != $minfosnew['passwordr']) amessage('两次输入的密码不一样，请重新输入！', M_REFERER);
	$curuser->updatefield('password',md5(md5($minfosnew['password'])),'main');
	$curuser->updatedb();
	adminlog('修改新密码');
	amessage('密码修改成功，请重新登录！',M_REFERER);
}
?>
