⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch_pwd.jsp

📁 This file becomes JSP that changes the password. It is operated on the Tomcat service.
💻 JSP
字号:
<%
/**
 * @(#)ChPwd.jsp
 * 									Version 1.0.0 07/04/14
 * 
 * [婡擻]
 * 僷僗儚乕僪曄峏夋柺丅
 * 
 * [曄峏棜楌]
 * 
 * Copyright (C) 2007 IB Solution,Inc.All rights reserved.
 */

/**********************************************************/
/*	Java惂屼晹											  */
/**********************************************************/
//import愰尵
%>
<%@ include file="include/sessioncheck2.jsp" %>
<%@ page contentType="text/html; charset=Windows-31J"%>
<%@ page import="java.net.*" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.log.DebugPrint" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.util.ServerProperty" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.util.CalendarTime" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.util.TextConverter" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.util.TextChecker" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.util.WebMessage" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.handler.ChPwdHandler" %>
<%@ page import="jp.co.ibsol.ibaqsfx.web.msg.ChPwdMsg" %>
<%
	request.setCharacterEncoding("Windows-31J");
	// 曄悢愰尵
		// 曄悢愰尵
	ChPwdMsg oInMsg = null;
	ChPwdMsg oOutMsg = null;
	ChPwdHandler oHandler = null;
	
	String sEvent = null;
	String sMsg = null;
	String sColor = null;
	String sHostName = null;
	String sVersion = null;
	String sUserName = null;	// 儐乕僓乕柤
	String sMacAddress = null;	// MAC傾僪儗僗
	String sX1UID = null;	// 1X儐乕僓乕ID
	String sX1PW = null;	// 1X僷僗儚乕僪
	String sX1PWN = null;	// 1X僷僗儚乕僪乮怴乯
	String sX1PWNR = null;	// 1X僷僗儚乕僪乮嵞擖椡乯
	String sAuthMd5Flg = null;	// MD5擣徹
	String sMotoIP = null;
	
	int iRet = 0;
	int iGaitoKensu = 0;
	int iTaishoPageCnt = 0;
	int iPageNo = 0;
	int iOnePageKensu = 0;
	boolean bChkFlg = false;

	int i_GaitoKensu = 0;	// 奩摉審悢
	int iClientCD = 0;	// 僋儔僀傾儞僩僐乕僪
	
	try {
		DebugPrint.println("** JSP[ch_pwd.jsp]:START **");
		/********************************************************/
		/* 弶婜愝掕張棟											*/
		/********************************************************/
		// 僿僢僟乕愝掕
		response.setHeader("Pragma", "no-chashe");
		response.setHeader("Cache-Control", "no-cache");
		response.setDateHeader("Expires", 0);
		
		// 儂僗僩柤庢摼
		try {
			InetAddress IP = InetAddress.getLocalHost();
			sHostName = IP.getHostName();
		} catch (Exception ex) {
			sHostName = "UnknownHost";
		}
		// 僶乕僕儑儞
		sVersion = (String)session.getAttribute("VERSION");
		
		// 僀儀儞僩敾掕
		sEvent = request.getParameter("event");
		DebugPrint.println("** JSP:sEvent[" + sEvent + "]");
		
		/********************************************************/
		/* 曄峏張棟
		/********************************************************/
		if (sEvent != null && sEvent.equals("Kensaku")) {
			DebugPrint.println("** JSP:僷僗儚乕僪峏怴張棟");
			// 曄峏慜僨乕僞庢摼
			iClientCD = Integer.parseInt((String)session.getAttribute("CLIENT_CD"));
			sUserName = (String)session.getAttribute("USER_NAME");
			sMacAddress = (String)session.getAttribute("MAC_ADDRESS");
			sX1UID = (String)session.getAttribute("X1_UID");
			sX1PW = (String)session.getAttribute("X1_PW");
			sAuthMd5Flg = (String)session.getAttribute("AUTH_MD5_FLG");
			
			//擖椡僠僃僢僋
			sX1PWN = request.getParameter("txtPWD");
			sX1PWNR = request.getParameter("txtPWDRE");
			
			// 擖椡昁恵僠僃僢僋
			if (TextChecker.isEmpty(sX1PWN)) {
				bChkFlg = true;
				sColor = "#FF0000";
				sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_NOTHING");
			} else {
				// 敿妏塸悢帤僠僃僢僋
				if (!TextChecker.isAlphaNumeric(sX1PWN) || sX1PWN.indexOf("\t") != -1) {
					bChkFlg = true;
					sColor = "#FF0000";
					sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_TYPE");
				} else {
					// 暥帤悢
					if (sX1PWN.length() > 20 || sX1PWN.length() < 6) {
						bChkFlg = true;
						sColor = "#FF0000";
						sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_KETA");
					}
				}
			}
			
			if(!bChkFlg)	{
				// 擖椡昁恵僠僃僢僋
				if (TextChecker.isEmpty(sX1PWNR)) {
					bChkFlg = true;
					sColor = "#FF0000";
					sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_RE_NOTHING");
				} else {
					if(sX1PWN.compareTo(sX1PWNR) != 0)	{
						bChkFlg = true;
						sColor = "#FF0000";
						sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_COMP_ERR");
					}
				}
			}

			if (!bChkFlg) {
				// 尰僷僗儚乕僪偲怴僷僗儚乕僪偵曄峏偑側偄応崌
				if (sX1PWN.equals(sX1PW)) {
					bChkFlg = true;
					sColor = "#FF0000";
					sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_NG_PWD");
				}
			}
			
			if(!bChkFlg)	{
				sMotoIP = request.getRemoteAddr();
				
				// 僆僽僕僃僋僩惗惉
				oHandler = new ChPwdHandler();
				oInMsg = new ChPwdMsg();
				
				oInMsg.setClientCD(iClientCD);
				oInMsg.setUserName(sUserName);
				oInMsg.setMACAddress(sMacAddress);
				oInMsg.setX1UID(sX1UID);
				oInMsg.setX1PW(sX1PWN);
				oInMsg.setAuthMd5Flg(sAuthMd5Flg);
				oInMsg.setRemoteIP(sMotoIP);
	
				// Handler屇傃弌偟
				oOutMsg = oHandler.updPassword(oInMsg);
				oOutMsg = oHandler.setDelFlg(oInMsg);
				oOutMsg = oHandler.delRadCheck(oInMsg);
				oOutMsg = oHandler.insRadChk(oInMsg);
				
				// 張棟寢壥敾掕
				iRet = oOutMsg.getRet();
				if (iRet != 0) {
					String sRetMsg = oOutMsg.getMsg();
					// 僙僢僔儑儞愝掕
					session.setAttribute("ErrorMsg", sRetMsg);
					// 儁乕僕揮憲
					response.sendRedirect("error.jsp");
					return;
				} else {
					DebugPrint.println("** JSP:姰椆張棟");
					// 儁乕僕揮憲
					session.setAttribute("Package_Name", ServerProperty.getString("PACKAGE_NAME"));
					session.setAttribute("Page_Name", ServerProperty.getString("PAGE_NAME_CH_PWD_FINISH"));
					response.sendRedirect("ch_pwd_finish.jsp");
					return;
				}
			}
		}
				
		/********************************************************/
		/* 弶婜張棟												*/
		/********************************************************/
		if (sEvent == null) {
			DebugPrint.println("** JSP:弶婜張棟");

			iClientCD = Integer.parseInt((String)session.getAttribute("CLIENT_CD"));
			DebugPrint.println("** JSP:iClientCD[" + iClientCD + "]");

			// 僆僽僕僃僋僩惗惉
			oHandler = new ChPwdHandler();
			oInMsg = new ChPwdMsg();
			
			oInMsg.setClientCD(iClientCD);

			// Handler屇傃弌偟
			oOutMsg = oHandler.getShokiEvent(oInMsg);
			
			// 張棟寢壥敾掕
			iRet = oOutMsg.getRet();
			if (iRet != 0) {
				String sRetMsg = oOutMsg.getMsg();
				// 僙僢僔儑儞愝掕
				session.setAttribute("ErrorMsg", sRetMsg);
				// 儁乕僕揮憲
				response.sendRedirect("error.jsp");
				return;
			}
			
			// 儊僢僙乕僕愝掕
			sColor = "#333333";
			sMsg = WebMessage.getMessage("MSGKEY_CH_PWD_FIRST");
			
			sUserName = oOutMsg.getUserName();	// 儐乕僓乕柤
			sMacAddress = oOutMsg.getMACAddress();	// MAC傾僪儗僗
			sX1UID = oOutMsg.getX1UID();	// 1X儐乕僓乕ID
			sX1PW = oOutMsg.getX1PW();	// 1X僷僗儚乕僪
			sAuthMd5Flg = oOutMsg.getAuthMd5Flg();	// MD5擣徹
			
			session.setAttribute("USER_NAME", sUserName);
			session.setAttribute("MAC_ADDRESS", sMacAddress);
			session.setAttribute("X1_UID", sX1UID);
			session.setAttribute("X1_PW", sX1PW);
			session.setAttribute("AUTH_MD5_FLG", sAuthMd5Flg);
		}
		
		/********************************************************/
		/* 儘僌傾僂僩張棟										*/
		/********************************************************/
		if ((sEvent != null) && (sEvent.equals("Logout"))) {
			DebugPrint.println("僉儍儞僙儖張棟");
			// 儁乕僕揮憲
			response.sendRedirect("logout.jsp");
			return;
		}
		
	} catch (Exception e) {
		e.printStackTrace();
	}
	
/**********************************************************/
/*	html惂屼晹											  */
/**********************************************************/
%>
<html>
 <head>
  <META http-equiv="Content-Type" content="text/html; charset=Windows-31J">
  <title>僷僗儚乕僪曄峏 - iBAQS-FX</title>
  <link href="styleall.css" rel="stylesheet" type="text/css">
  <SCRIPT LANGUAGE="JavaScript" src="js/ibaqsfx.js"></SCRIPT>
</head>
<BODY onLoad="NoFrame();document.form1.txtPWD.focus();" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" text="#333333">
<form name="form1" method="post" action="ch_pwd.jsp">
<table width="800"  height="50" border="0">
  <tr> 
  	<td width="560" height="50" background="images/backcolor_top_left.gif" class="font48"><font color="#FFFFFF" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂僷僗儚乕僪曄峏</strong></font></td>
    <td width="240" height="50" background="images/backcolor_top_right.gif" class="font36"><font color="#FFFFFF" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂iBAQS-FX</strong></font></td>
  </tr>
</table>
<table width="800" border="0" bgcolor="#efefef">
  <tr> 
    <td width="400" align="left" class="font12">愙懕抂枛丗丂<%= sHostName %></em></td>
    <TD width="400" align="right" class="font12"><p><em><%= sVersion %></em></p> </TD>
  </tr>
</table>
<TABLE cellpadding="0" cellspacing="0" border="0" width="800">
  <TR>
    <TD width="40">&nbsp;</TD>
    <TD width="760" height="20">&nbsp;</TD>
  </TR>
</TABLE>
<TABLE cellpadding="0" cellspacing="0" border="0" width="800">
  <TR>
    <TD width="40">&nbsp;</TD>
    <TD width="760" height="20" class="font12"><font color="<%= sColor %>"><%= sMsg %></font></TD>
  </TR>
</TABLE>
<TABLE cellpadding="0" cellspacing="0" border="0" width="800">
  <TR>
    <TD width="40"><p>&nbsp;</p> </TD>
    <TD width="720"><IMG src="images/line.gif" width="720" height="1" alt="line"></TD>
    <TD width="40"><p>&nbsp;</p> </TD>
  </TR>
</TABLE>
<img src="images/spaser.gif">
  <table width="800" border="0">
    <tr>
      <td width="400" class="font12"><font color="#000000" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂丂丂丂丂丂丂仭 棙梡幰柤</strong></font></td>
      <td width="400" height="25" class="font12"><%= sUserName %></td>
    </tr>
  </table>
  <table width="800" border="0">
    <tr>
      <td width="400" class="font12"><font color="#000000" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂丂丂丂丂丂丂仭 1X擣徹儐乕僓乕ID</strong></font></td>
      <td width="400" height="25" class="font12"><%= sX1UID %></td>
    </tr>
  </table>
  <table width="800" border="0">
    <tr>
      <td width="400" class="font12"><font color="#000000" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂丂丂丂丂丂丂仭 1X擣徹僷僗儚乕僪</strong></font></td>
      <td width="400" height="25" class="font12"><input name="txtPWD" type="password" size="20" maxlength="20" style="ime-mode:disabled;"></td>
    </tr>
  </table>
  <table width="800" border="0">
    <tr>
      <td width="400" class="font12"><font color="#000000" face="俵俽 俹僑僔僢僋, Osaka"><strong>丂丂丂丂丂丂丂仭 1X擣徹僷僗儚乕僪乮嵞擖椡乯</strong></font></td>
      <td width="400" height="25" class="font12"><input name="txtPWDRE" type="password" size="20" maxlength="20" style="ime-mode:disabled;"></td>
    </tr>
  </table>
<img src="images/spaser.gif">
<TABLE cellpadding="0" cellspacing="0" border="0" width="800">
  <TR>
    <TD width="40"><p>&nbsp;</p> </TD>
    <TD width="720"><IMG src="images/line.gif" width="720" height="1" alt="line"></TD>
    <TD width="40"><p>&nbsp;</p> </TD>
  </TR>
</TABLE>
<img src="images/spaser.gif">
<TABLE border="0" cellpadding="0" cellspacing="0" width="800">
  <TR>
    <TD width="40"><p>&nbsp;</p> </TD>
    <TD width="100" height="25"><A href="Javascript:window.close()" onMouseOver="status='';return true;"><IMG src="images/btn_cansel.gif" width="100" height="25" alt="僉儍儞僙儖" border="0"></A></TD>
    <TD width="520"><p>&nbsp;</p> </TD>
    <TD width="100" height="25"><a href="javascript:setEventKensaku();"><img src="images/btn_change.gif" border="0"></a></TD>
    <TD width="40"><p>&nbsp;</p> </TD>
  </TR>
</TABLE>
<img src="images/spaser.gif">
<img src="images/spaser.gif">
<TABLE cellpadding="0" cellspacing="0" border="0" width="800">
  <TR>
    <TD><IMG src="images/line.gif" width="800" height="1" alt="line"></TD>
  </TR>
</TABLE>
<input type="hidden" name="event" value="">
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -