Index: ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.jsp =================================================================== diff -u -r40881 -r40885 --- ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.jsp (.../adminModifyPWDByExt.jsp) (revision 40881) +++ ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.jsp (.../adminModifyPWDByExt.jsp) (revision 40885) @@ -1,47 +1,31 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp"%> -<%@page import="com.forgon.tools.crypto.rsa.RSAEncrypt"%> -<%@page import="org.apache.commons.lang.StringUtils"%> -<%@ page import="com.forgon.tools.SpringBeanManger,com.forgon.directory.vo.LoginUserData,com.forgon.portal.action.PortalPageAction"%> ${param.isNeedUpdateResetDate eq 'true' ? '通知重置密码' : '修改密码' } <%@ include file="/common/includeExtJsAndCss.jsp"%> -<% - //登录密码的rsa公钥 - String logonRSAPublicKey = (String)application.getAttribute("logonRSAPublicKey"); - if(StringUtils.isBlank(logonRSAPublicKey)){ - logonRSAPublicKey = RSAEncrypt.ENCRYPTPUBLICKEY; - } -%> + - -
Index: ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js =================================================================== diff -u -r40883 -r40885 --- ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js (.../showModifyPWDWindowByExt.js) (revision 40883) +++ ssts-web/src/main/webapp/personalSetting/showModifyPWDWindowByExt.js (.../showModifyPWDWindowByExt.js) (revision 40885) @@ -31,7 +31,7 @@ //ZSRY-72:增加密码设置要求提示语 var msg = getModifyPwdMsg(); var hideSenCode = true; - if(msg !== '' && sstsConfig.enableTwoFactorAuthentication){ + if(msg !== '' && sstsConfig.enableTwoFactorAuthentication == 1){ hideSenCode = false; } @@ -81,8 +81,8 @@ items: [{ xtype: 'textfield', fieldLabel: '验证码', - name: 'verificationCode', - id: 'verificationCode', + name: 'smsVerificationCode', + id: 'smsVerificationCode', width: 200, msgTarget: 'side', allowBlank: true @@ -160,9 +160,9 @@ }); return false; } - if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { - var verificationCode = Ext.getCmp('verificationCode').getValue(); - var encryptedUserCode = encrypt.encrypt(verificationCode); + if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication == 1) { + var smsVerificationCode = Ext.getCmp('smsVerificationCode').getValue(); + var encryptedUserCode = encrypt.encrypt(smsVerificationCode); validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { if (res.success) { save(); Index: ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.js =================================================================== diff -u -r40882 -r40885 --- ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.js (.../adminModifyPWDByExt.js) (revision 40882) +++ ssts-web/src/main/webapp/systemmanage/adminModifyPWDByExt.js (.../adminModifyPWDByExt.js) (revision 40885) @@ -1,210 +1,134 @@ -//ZSYY-438:短信验证码 -function sendCodeByModify() { - // Encrypt with the public key... - sendAuthenticationCodeSms(encryptedUserName, function (res) { - if (res.success) { - setCodeTimeoutByModify(); - } - }) -} -var time2 = 60; -//倒计时 -function setCodeTimeoutByModify() { - var button = Ext.getCmp('senCode'); - var t = setTimeout(function () { - if (time2 > 0) { - time2--; - button.setText(time2 + ' s'); - button.setDisabled(true); - setCodeTimeoutByModify(); - } else { - clearTimeout(t); - time2 = 60; - button.setText('发送验证码'); - button.setDisabled(false); - } - }, 1000); -} - function checkSubmit() { - var newPassword = Ext.getCmp('newPassword').getValue(); - var confirmNewPassword = Ext.getCmp('confirmNewPassword').getValue(); - - if (newPassword == "") { + var newPassword = Ext.getCmp('newPassword').getValue(); + var confirmNewPassword = Ext.getCmp('confirmNewPassword').getValue(); + + if (newPassword == ""){ alert("请输入新密码!"); return false; } - var loginUserName = $Id("loginUserName").value; + var loginUserName = $Id("loginUserName").value; //暂时屏蔽验证复杂密码 - var checkPasswordResult = testPasswordReg(newPassword, loginUserName); - if (!checkPasswordResult.success) { - alert(checkPasswordResult.msg); - return false; - } - if (confirmNewPassword == "") { + var checkPasswordResult = testPasswordReg(newPassword, loginUserName); + if(!checkPasswordResult.success){ + alert(checkPasswordResult.msg); + return false; + } + if (confirmNewPassword == ""){ alert('请输入确认新密码!'); return false; } if (newPassword != confirmNewPassword) { - alert("新密码与确认新密码不一致!"); + alert("新密码与确认新密码不一致!"); return false; } return true; } -function changeUserPassword(thiz) { - if (checkSubmit()) { - var newPassword = Ext.getCmp('newPassword').getValue(); - if (isNeedUpdateResetDate == 'true') { - alertTitle = "重置"; - DWREngine.setAsync(false); - UserTableManager.resetPWDAndUpdateResetDate(paramId, newPassword, true, showTable); - DWREngine.setAsync(true); - } else { - alertTitle = "修改"; - DWREngine.setAsync(false); - UserTableManager.modifyPWD(paramId, newPassword, showTable); - DWREngine.setAsync(true); - } - } - thiz.enable(); - +function changeUserPassword(thiz){ + if(checkSubmit()){ + var newPassword = Ext.getCmp('newPassword').getValue(); + if(isNeedUpdateResetDate=='true'){ + alertTitle = "重置"; + DWREngine.setAsync(false); + UserTableManager.resetPWDAndUpdateResetDate(paramId,newPassword,true,showTable); + DWREngine.setAsync(true); + }else{ + alertTitle = "修改"; + DWREngine.setAsync(false); + UserTableManager.modifyPWD(paramId,newPassword,showTable); + DWREngine.setAsync(true); + } + } + thiz.enable(); + } function showTable(table) { - if (table) { - alert(alertTitle + "密码成功!"); - window.close(); - } else { - alert(alertTitle + "密码失败,请稍候再试!"); - } + if(table){ + alert(alertTitle+"密码成功!"); + window.close(); + }else{ + alert(alertTitle+"密码失败,请稍候再试!"); + } } -function showUserName(userName) { - Ext.getCmp('userName').setValue(userName.split(',')[0]); - Ext.getCmp('loginUserName').setValue(userName.split(',')[1]); +function showUserName(userName){ + Ext.getCmp('userName').setValue(userName.split(',')[0]); + Ext.getCmp('loginUserName').setValue(userName.split(',')[1]); } + - var formObj; -Ext.onReady(function () { +Ext.onReady(function(){ Ext.QuickTips.init(); //ZSRY-72:增加密码设置要求提示语 - var msg = getModifyPwdMsg(); - var hideSenCode = true; - if(msg !== '' && sstsConfig.enableTwoFactorAuthentication){ - hideSenCode = false; - } + var msg = getModifyPwdMsg(); formObj = new Ext.FormPanel({ - frame: true, - labelWidth: 70, - height: 230, - bodyStyle: 'padding:5px 10px 0px 10px', + frame:true, + labelWidth:70, + height:210, + bodyStyle:'padding:5px 10px 0px 10px', items: [{ - xtype: 'fieldset', + xtype:'fieldset', title: '密码修改', - height: 160, + height:140, id: 'regionSet', - items: [{ - xtype: 'textfield', - fieldLabel: '用户姓名', - id: 'userName', - name: 'userName', - readOnly: true, - cls: 'fieldReadOnlyNoRemove' - }, { - xtype: 'hidden', - id: 'loginUserName', - name: 'loginUserName' - }, { - xtype: 'textfield', - fieldLabel: '新密码', - id: 'newPassword', - name: 'newPassword', + items :[{ + xtype:'textfield', + fieldLabel :'用户姓名', + id :'userName', + name :'userName', + readOnly : true, + cls:'fieldReadOnlyNoRemove' + },{ + xtype:'hidden', + id :'loginUserName', + name :'loginUserName' + },{ + xtype:'textfield', + fieldLabel :'新密码', + id :'newPassword', + name :'newPassword', width: 200, - inputType: "password" - }, { - xtype: 'textfield', - fieldLabel: '确认密码', - id: 'confirmNewPassword', - name: 'confirmNewPassword', + inputType:"password" + },{ + xtype:'textfield', + fieldLabel :'确认密码', + id :'confirmNewPassword', + name :'confirmNewPassword', width: 200, - inputType: "password" - }, { - hidden: hideSenCode, - layout: 'column', - items: [{ - layout: 'form', - columnWidth: .75, - items: [{ - xtype: 'textfield', - fieldLabel: '验证码', - name: 'verificationCode', - id: 'verificationCode', - width: 170, - msgTarget: 'side', - allowBlank: true - }] - }, { - layout: 'form', - columnWidth: .25, - items: [{ - id: 'senCode', - xtype: 'button', - text: '发送验证码', - disabled: false, - handler: function () { - sendCodeByModify(); - } - }] - }] - }, { - items: [{ - hidden: msg == '' ? true : false, - layout: 'column', - items: [{ - id: 'showPwdMessage', - xtype: 'textarea', - width: 320, - allowBlank: true, - labelSeparator: '', - labelWidth: 0, + inputType:"password" + }, { + items:[{ + hidden:msg == ''?true:false, + layout:'column', + items:[{ + id:'showPwdMessage', + xtype:'textarea', + width : 320, + allowBlank : true, + labelSeparator:'', + labelWidth:0, anchor: '99%', - readOnly: true, - cls: 'fieldReadOnlyNoRemove', + readOnly : true, + cls : 'fieldReadOnlyNoRemove', value: msg }] }] }] }], buttons: [{ text: '确定', - handler: function () { - var that = this; - if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { - if (checkSubmit()) { - var verificationCode = Ext.getCmp('verificationCode').getValue(); - var encryptedUserCode = encrypt.encrypt(verificationCode); - validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { - if (res.success) { - that.disable(); - changeUserPassword(that); - } else { - showResult(res.message); - } - }) - } - } else { - that.disable(); - changeUserPassword(that); - } + handler: function (){ + this.disable(); + changeUserPassword(this); } - }, { + },{ text: '取消', - handler: function () { + handler:function(){ window.close(); } }] @@ -213,7 +137,7 @@ formObj.render("formDiv"); initGetUserNameById(); Ext.getCmp('newPassword').focus(); - if (msg !== '') { - Ext.getCmp('showPwdMessage').el.dom.style.color = 'red'; - } + if(msg !== ''){ + Ext.getCmp('showPwdMessage').el.dom.style.color = 'red'; + } }); Index: ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js =================================================================== diff -u -r40883 -r40885 --- ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js (.../modifyPWDByExt.js) (revision 40883) +++ ssts-web/src/main/webapp/personalSetting/modifyPWDByExt.js (.../modifyPWDByExt.js) (revision 40885) @@ -43,9 +43,9 @@ showResult('新密码与确认新密码不一致,请重新填写!'); return false; } - if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication) { - var verificationCode = Ext4.getCmp('verificationCode').getValue(); - var encryptedUserCode = encrypt.encrypt(verificationCode); + if (sstsConfig.needBeStrongPwdWhenModifyPwd && sstsConfig.enableTwoFactorAuthentication == 1) { + var smsVerificationCode = Ext4.getCmp('smsVerificationCode').getValue(); + var encryptedUserCode = encrypt.encrypt(smsVerificationCode); validateAuthenticationCode(encryptedUserName, encryptedUserCode, function (res) { if (res.success) { save(); @@ -89,7 +89,7 @@ //ZSRY-72:增加密码设置要求提示语 var msg = getModifyPwdMsg(); var hideSenCode = true; - if(msg !== '' && sstsConfig.enableTwoFactorAuthentication){ + if(msg !== '' && sstsConfig.enableTwoFactorAuthentication == 1){ hideSenCode = false; } @@ -146,8 +146,8 @@ items: [{ xtype: 'textfield', fieldLabel: '验证码', - name: 'verificationCode', - id: 'verificationCode', + name: 'smsVerificationCode', + id: 'smsVerificationCode', anchor: '95%', msgTarget: 'side', allowBlank: true