index.jsp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:6k
- <%@ page contentType="text/html; charset=gb2312"%>
- <%@ page import="com.gforce.currency.*,com.gforce.gfoa.*,java.util.*" %>
- <%
- OnlineUserManager.Instance();
- OnlineUserManager.AddNewSession(session);
- String strServerURL = request.getRequestURL().toString();
- if(strServerURL.indexOf("://")>-1)
- {
- strServerURL = strServerURL.substring(strServerURL.indexOf("://")+3);
- }
- if(strServerURL.indexOf(":")>-1)
- {
- strServerURL = strServerURL.substring(0,strServerURL.indexOf(":"));
- }
- if(strServerURL.indexOf("/")>-1)
- {
- strServerURL = strServerURL.substring(0,strServerURL.indexOf("/"));
- }
- //out.print(strServerURL);
- Session m_session = new Session(session);
- int intUserID = m_session.GetInt("UserID");
- String strRightPages = m_session.GetString("RightPages");
- if(intUserID<1)
- {
- Request m_request = new Request(request);
- String strUserName = m_request.GetString("username");
- String strPassword = m_request.GetString("password");
- if(strUserName.trim().length()<1 || strPassword.trim().length()<1)
- {
- %>
- <html>
- <head>
- <title><%=SystemParament.GetSystemName() + " --- 当前共有" + OnlineUserManager.getOnlineUsers().size() + "人在线"%></title>
- <link href="css/txt.jsp" rel="stylesheet" type="text/css">
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312"><meta http-equiv="pragma" content="no-cache">
- <script langage="javascript" src="/js/sethomepage.js" type="text/javascript"></script>
- <script langage="javascript" type="text/javascript">
- function checklogin()
- {
- if(document.login.username.value=="")
- {
- alert("请输入用户名!");
- document.login.username.focus();
- return false;
- }
- if(document.login.password.value=="")
- {
- alert("请输入用户密码!");
- document.login.password.focus();
- return false;
- }
- }
- </script>
- <style type="text/css">
- <!--
- .style2 {color: #999999}
- .style3 {
- color: #FFFFFF;
- font-weight: bold;
- }
- -->
- </style>
- </head>
- <body bgcolor="#CECBCE" leftmargin="0" topmargin="0" onload="document.login.username.focus();">
- <table width="100%" height="97%" border="0" align="center">
- <tr>
- <td align="center">
- <table width="770" height="429" border="0" align="center" cellspacing="0">
- <tr>
- <td height="450" background="images/main.jpg" align="left" valign="bottom" width="770">
- <!--<form name="login" method="post" action="https://<%=strServerURL%>/" onSubmit="javascript:return checklogin();">-->
- <form name="login" method="post" action="" onSubmit="javascript:return checklogin();">
- <table height="107" border="0" align="left" cellpadding="0" cellspacing="0" id="table1">
- <tr>
- <td align="right" height="26"> </td>
- <td> </td>
- <td align="left">
- <input name="username" tabindex="1" size="10" maxlength="10" style="border-width: 0px;height:15px;width:126px;">
- </td>
- <td align="center" rowspan="4">
- </td>
- </tr>
- <tr>
- <td align="right" height="26"> </td>
- <td> </td>
- <td align="left">
- <input name="password" type="password" tabindex="2" size="10" maxlength="10" style="border-width: 0px;height:15px;width:126px;"/>
- </td>
- </tr>
- <tr>
- <td width="50" height="55" rowspan="3" align="right"> </td>
- <td width="72" rowspan="2"> </td>
- <td height="28" align="center" valign="bottom">
- <img alt="" src="images/white.gif" width="0" border="0"/>
- <input name="imageField" tabindex="2" type="image" src="images/white.gif" width="133" height="21" border="0">
- </td>
- </tr>
- <tr>
- <td height="27" align="left"> </td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <%
- }
- else
- {
- boolean isLogined = false;
- intUserID = UserManager.CheckLogin(strUserName,strPassword);
- if(intUserID>0)
- isLogined = true;
- if(isLogined)
- {
- m_session.SetValue("UserID",intUserID + "");
- int intRoleID = UserManager.GetUserRoleID(intUserID);
- strRightPages = PageRight.getPageRight(intRoleID);
- m_session.SetValue("RightPages",strRightPages);
- response.sendRedirect("/");
- }
- else
- {
- %>
- <html>
- <head>
- <script language="javascript" type="text/javascript">
- alert("用户名或者密码错误,登陆失败!");
- history.back();
- </script>
- </head>
- </html>
- <%
- session.removeAttribute("UserID");
- m_session.SetValue("UserID","0");
- m_session.SetValue("RightPages","");
- }
- }
- }
- else if(strRightPages.trim().length()<1)
- {
- %>
- <html>
- <head>
- <script language="javascript" type="text/javascript">
- alert("您在此系统中没有任何权限,登陆失败");
- history.back();
- </script>
- </head>
- </html>
- <%
- session.removeAttribute("UserID");
- m_session.SetValue("UserID","0");
- m_session.SetValue("RightPages","");
- }
- else
- {
- ///response.sendRedirect(SystemParament.getParament("systembaseurl") + "/main.jsp");
- response.sendRedirect("/main.jsp");
- }
- %>