$repassword) { printerror("NotRepassword","history.go(-1)"); } if(strlen($password)<6) { printerror("LessPassword","history.go(-1)"); } $user_r=$empire->fetch1("select userid,password,salt,salt2 from {$dbtbpre}enewsuser where username='".$username."' limit 1"); if(!$user_r['userid']) { printerror("OldPasswordFail","history.go(-1)"); } $ch_oldpassword=DoEmpireCMSAdminPassword($oldpassword,$user_r['salt'],$user_r['salt2']); if($user_r['password']!=$ch_oldpassword) { printerror("OldPasswordFail","history.go(-1)"); } $salt=make_password(8); $salt2=make_password(20); $password=DoEmpireCMSAdminPassword($password,$salt,$salt2); $a=",password='$password',salt='$salt',salt2='$salt2'"; } //风格 if($gr['dochadminstyle']) { $a.=",styleid='$styleid'"; } $sql=$empire->query("update {$dbtbpre}enewsuser set truename='$truename',email='$email'".$a." where username='$username'"); //安全提问 $equestion=(int)$_POST['equestion']; $eanswer=$_POST['eanswer']; $uadd=''; if($equestion) { if($equestion!=$_POST['oldequestion']&&!$eanswer) { printerror('EmptyEAnswer',''); } if($eanswer) { $eanswer=ReturnHLoginQuestionStr($userid,$username,$equestion,$eanswer); $uadd=",eanswer='$eanswer'"; } } else { $uadd=",eanswer=''"; } $empire->query("update {$dbtbpre}enewsuseradd set equestion='$equestion'".$uadd." where userid='$userid'"); if($sql) { //操作日志 insert_dolog(""); //改变风格 if($styleid!=$oldstyleid) { $styler=$empire->fetch1("select path from {$dbtbpre}enewsadminstyle where styleid='$styleid'"); if($styler['path']) { $set=esetcookie("loginadminstyleid",$styler['path'],0,1); } printerror("EditPasswordSuccessLogin","../index.php"); //echo"Edit password success!"; exit(); } else { printerror("EditPasswordSuccess","EditPassword.php".hReturnEcmsHashStrHref2(1)); } } else {printerror("DbError","history.go(-1)");} } $gr=$empire->fetch1("select dochadminstyle from {$dbtbpre}enewsgroup where groupid='$loginlevel'"); $enews=$_POST['enews']; if(empty($enews)) {$enews=$_GET['enews'];} if($enews) { hCheckEcmsRHash(); } //修改密码 if($enews=="EditPassword") { $oldpassword=$_POST['oldpassword']; $password=$_POST['password']; $repassword=$_POST['repassword']; $styleid=(int)$_POST['styleid']; $oldstyleid=(int)$_POST['oldstyleid']; EditPassword($logininid,$loginin,$oldpassword,$password,$repassword,$styleid,$oldstyleid,$_POST); } $r=$empire->fetch1("select userid,styleid,truename,email from {$dbtbpre}enewsuser where userid='$logininid'"); $addur=$empire->fetch1("select equestion from {$dbtbpre}enewsuseradd where userid='$r[userid]'"); if($gr['dochadminstyle']) { //后台样式 $stylesql=$empire->query("select styleid,stylename,path from {$dbtbpre}enewsadminstyle order by styleid"); $style=""; while($styler=$empire->fetch($stylesql)) { if($r[styleid]==$styler[styleid]) {$sselect=" selected";} else {$sselect="";} $style.=""; } } db_close(); $empire=null; ?>
位置:修改个人资料 |