VerifyRtxLogin.jsp
8.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<%@ page import="weaver.general.Util,
weaver.general.GCONST,
java.util.Map,
java.util.HashMap,
java.util.List,
weaver.hrm.settings.RemindSettings" %>
<%@ page import="weaver.hrm.User"%>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@ page import="weaver.hrm.OnLineMonitor"%>
<%@ page import="weaver.systeminfo.template.UserTemplate"%>
<%@ page import="weaver.hrm.settings.ChgPasswdReminder" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<jsp:useBean id="verifylogin" class="weaver.login.VerifyRtxLogin" scope="page" />
<jsp:useBean id="rsExtend" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="DocCheckInOutUtil" class="weaver.docs.docs.DocCheckInOutUtil" scope="page"/>
<jsp:useBean id="PoppupRemindInfoUtil" class="weaver.workflow.msg.PoppupRemindInfoUtil" scope="page"/>
<jsp:useBean id="RtxLdaplog" class="weaver.rtx.RtxLdapLog" scope="page"/>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%
String urlfrom = Util.null2String(request.getParameter("urlfrom")) ;
String para = Util.null2String(request.getParameter("para")) ;
para = StringEscapeUtils.escapeSql(para);
String linkurltmp = para;
if(urlfrom.equals("expfile")){ //档案系统归档导出
verifylogin.setIsfromwftodoc(1);
String para1= Util.null2String(request.getParameter("para1"));
para1 = para1.replaceAll("@","&");
//System.out.println("para1==="+para1);
para = para1 + "#" + Util.null2String(request.getParameter("para2")) + "#" + Util.null2String(request.getParameter("para3"));
String requestid = "-1";
int index = para1.indexOf("requestid=");
if(index>0) requestid = para1.substring(index+10);
session.setAttribute("urlfrom_workflowtodoc_"+requestid,"true");
para = para.replace("ViewRequest.jsp","ExportRequest.jsp");
} else if(urlfrom.equals("workflowtodoc")){//针对流程存为文档
verifylogin.setIsfromwftodoc(1);
para = Util.null2String(request.getParameter("para1")) + "#" + PoppupRemindInfoUtil.decrypt(Util.null2String(request.getParameter("para2"))) + "#" + Util.null2String(request.getParameter("para3"));
String para1 = Util.null2String(request.getParameter("para1"));
String requestid = "-1";
int index = para1.indexOf("requestid=");
if(index>0) requestid = para1.substring(index+10);
session.setAttribute("urlfrom_workflowtodoc_"+requestid,"true");
}else{
para = PoppupRemindInfoUtil.decrypt(para);
}
String str[] = Util.TokenizerString2(para,"#");
String loginfile = Util.null2String(request.getParameter("loginfile")) ;
String logintype = Util.null2String(request.getParameter("logintype")) ;
/*
* QC273165
* [90]流程流转集成-解决自定义接口进了方法却没有执行的问题
* Start
*/
String loginid = "";
String userpassword = "";
if(str!=null){
int snum = str.length;
if(snum>1){
loginid = Util.null2String(str[1]);
}
if(snum>2){
userpassword = Util.null2String(str[2]);
}
}
/*
* QC273165
* [90]流程流转集成-解决自定义接口进了方法却没有执行的问题
* End
*/
if(logintype.equals("")) logintype = "1";
//解决rtx消息提醒是ldap登录验证(ldap是没有loginid和password)td13185
if(!"1".equals(session.getAttribute("istest"))){//流程测试不验证rtx
boolean rtxladptmp = RtxLdaplog.checkRtxLadp(loginid,linkurltmp);
if(rtxladptmp && !urlfrom.equals("workflowtodoc")) {
response.sendRedirect("/login/Login.jsp?logintype=1&message=19");
return;
}
}
String serial=Util.null2String(request.getParameter("serial"));
String username = Util.null2String(request.getParameter("username"));
String rnd=Util.null2String(request.getParameter("rnd"));
String loginPDA=Util.null2String(request.getParameter("loginPDA"));
session.setAttribute("loginPAD",loginPDA);
String RedirectFile = Util.null2String(str[0]);
if(RedirectFile.indexOf("/main.jsp")>-1&&"1".equals(session.getAttribute("istest"))){
session.removeAttribute("istest");
}
if (loginPDA.equals("1"))
{
RedirectFile= "/mainPDA.jsp";
}
String validatecode=Util.null2String(request.getParameter("validatecode"));
String gopage=Util.null2String(request.getParameter("gopage"));
if(gopage.length()>0){
RedirectFile = "/main.jsp?gopage="+gopage ;
}
if (loginfile.equals("")) loginfile="/login/Login.jsp?logintype="+logintype+"&gopage="+gopage;
Cookie[] ck = request.getCookies();
int ckLength = 0 ;
try {
ckLength = ck.length;
} catch (NullPointerException ex) {//流程存为文档,读不到cookie
//response.sendRedirect("/login/Login.jsp?logintype="+logintype+"&noAllowIe=yes") ;
//return ;
}
String isIE = Util.null2String(request.getParameter("isie"));
if(isIE.equals("false")){
isIE = "true";
}
session.setAttribute("browser_isie",isIE);
if (logintype.equals("2")) RedirectFile = "/portal/main.jsp" ;
if((loginid.equals("")) && !"1".equals(session.getAttribute("istest"))) response.sendRedirect(loginfile + "&message=18") ;//QC271940解决AD域用户使用流程存为文档功能
else {
ChgPasswdReminder reminder = new ChgPasswdReminder();
RemindSettings settings=reminder.getRemindSettings();
String needusb=settings.getNeedusb();
String usercheck ;
if(needusb!=null&&needusb.equals("1")&& false){//屏蔽usbkey
usercheck= verifylogin.getUserCheck(request,response,loginid,userpassword,serial,username,rnd,logintype,loginfile,validatecode);
}else{
usercheck= verifylogin.getUserCheck(request,response,loginid,userpassword,logintype,loginfile,validatecode);
}
try {
request.getSession(true).removeAttribute("validateRand");
}catch (Exception e) {
}
if(usercheck.equals("15") || usercheck.equals("16") || usercheck.equals("17")|| usercheck.equals("45")|| usercheck.equals("46")|| usercheck.equals("47")|| usercheck.equals("52")|| usercheck.equals("55"))
{
String tmploginid=(String)session.getAttribute("tmploginid");
if(tmploginid!=null&&loginid.equals(tmploginid))
session.setAttribute("tmploginid1",loginid);
else
session.removeAttribute("tmploginid");
response.sendRedirect(loginfile + "&message="+usercheck) ;
}
else if(usercheck.equals("19")){
response.sendRedirect("/system/InLicense.jsp") ;
} else if (usercheck.equals("26")) {
response.sendRedirect("/login/Login.jsp?logintype=1&message="+usercheck);
}else if(usercheck.equals("101")){
session.setAttribute("tmploginid",loginid);
session.setAttribute("tmploginid1",loginid);
if (!loginPDA.equals("1")) {
response.sendRedirect("/login/Login.jsp?logintype=1&message="+usercheck) ;
}
else
{
response.sendRedirect("/login/LoginPDA.jsp?logintype=1&message="+usercheck) ;
}
}
else {
User user = HrmUserVarify.getUser (request , response) ;
if(user == null) { response.sendRedirect(loginfile ) ; return;}
session.setAttribute("password",userpassword);
session.setAttribute("fromlogin","yes");
session.removeAttribute("tmploginid");
session.setAttribute("RtxFromLogin","true");
boolean MOREACCOUNTLANDING = GCONST.getMOREACCOUNTLANDING();
if(MOREACCOUNTLANDING){
//多帐号登陆
if (user.getUID() != 1) { //is not sysadmin
weaver.login.VerifyLogin VerifyLogin = new weaver.login.VerifyLogin();
List accounts = VerifyLogin.getAccountsById(user.getUID());
request.getSession(true).setAttribute("accounts", accounts);
}
Util.setCookie(response, "loginfileweaver", loginfile, 172800);
Util.setCookie(response, "loginidweaver", loginid, 172800);
}
DocCheckInOutUtil.docCheckInWhenVerifyLogin(user,request);
if(request.getSession(true).getAttribute("layoutStyle")!=null && request.getSession(true).getAttribute("layoutStyle").equals("1")){
session.setAttribute("istimeout","no");
%>
<SCRIPT LANGUAGE=VBS>
window.parent.returnvalue = "1"
window.parent.close
</script>
<%
}else{
if("2".equals(logintype)){
response.sendRedirect(RedirectFile) ;
return;
} else {
UserTemplate ut=new UserTemplate();
ut.getTemplateByUID(user.getUID(),user.getUserSubCompany1());
int templateId=ut.getTemplateId();
int extendTempletid=ut.getExtendtempletid();
int extendtempletvalueid=ut.getExtendtempletvalueid();
if(extendTempletid!=0){
rsExtend.executeQuery("select id,extendname,extendurl from extendHomepage where id=?",extendTempletid);
if(rsExtend.next()){
int id=Util.getIntValue(rsExtend.getString("id"));
String extendurl=Util.null2String(rsExtend.getString("extendurl"));
if(para.length()>0){
response.sendRedirect(RedirectFile);
}else{
response.sendRedirect(extendurl+"/index.jsp") ;
}
return;
}
} else {
response.sendRedirect(RedirectFile) ;
return;
}
}
}
}
}
%>