/**
* 验证用户是否已经在从站登录,已经登录则返回true;否则返回false
* @param (ServletRequest)req
* @param (String)logFlag
* @return boolean
* @author w47626
* @add date 2005-11-11
*/
private boolean isUserLogin(HttpServletRequest request, String logFlag) {
HttpSession session = null;
UserInfoBean uiBean = null;
String uid = null;
boolean isuserlogin = false;
session = request.getSession(false);
if (session != null) {
uiBean =(UserInfoBean) session.getAttribute(LoginConstants.LOGIN_USERINFO);
uid = getAttributeValue(request,LoginConstants.LOGIN_USER_ID,logFlag);
logger.info("LOGIN_USERINFO uid "+uid);
if ((uiBean != null)
&& (uiBean.getUid() != null)
&& (uiBean.getUid().equalsIgnoreCase(uid))) {
isuserlogin = true;
}
}
return isuserlogin;
}
/**
* 从本地cookie中取出加密的信息并解密
* @param (HttpServletRequest)request
* @param (String)logFlag
* @param (String)attributename需要从cookie中取出的cookiename
* @return String
* @author w47626
* @add date 2005-11-11
*/
private String getAttributeValue(
HttpServletRequest request,
String attributename,
String logFlag) {
String attribute = null;
EncryptionDelegate encryptionDelegate = null;
try {
encryptionDelegate = new EncryptionDelegate();
attribute = getCookieValue(request, attributename);
if (attribute != null) {
attribute =
encryptionDelegate.decryptWithDES(
attribute,
com
.huawei
.it
.support
.encryption
.util
.DESEncryptionFactory
.DES);
//返回明文
} else {
throw new Exception(
"AuthFilter Error: Can't get 'uid' from cookie while the LoginSign of uniportal website is '"
+ logFlag
+ "' !");
}
} catch (Exception ex) {
logger.info("INTRANET_Common getUserInfo Exception !");
ex.printStackTrace();
}
return attribute;
}
* 验证用户是否已经在从站登录,已经登录则返回true;否则返回false
* @param (ServletRequest)req
* @param (String)logFlag
* @return boolean
* @author w47626
* @add date 2005-11-11
*/
private boolean isUserLogin(HttpServletRequest request, String logFlag) {
HttpSession session = null;
UserInfoBean uiBean = null;
String uid = null;
boolean isuserlogin = false;
session = request.getSession(false);
if (session != null) {
uiBean =(UserInfoBean) session.getAttribute(LoginConstants.LOGIN_USERINFO);
uid = getAttributeValue(request,LoginConstants.LOGIN_USER_ID,logFlag);
logger.info("LOGIN_USERINFO uid "+uid);
if ((uiBean != null)
&& (uiBean.getUid() != null)
&& (uiBean.getUid().equalsIgnoreCase(uid))) {
isuserlogin = true;
}
}
return isuserlogin;
}
/**
* 从本地cookie中取出加密的信息并解密
* @param (HttpServletRequest)request
* @param (String)logFlag
* @param (String)attributename需要从cookie中取出的cookiename
* @return String
* @author w47626
* @add date 2005-11-11
*/
private String getAttributeValue(
HttpServletRequest request,
String attributename,
String logFlag) {
String attribute = null;
EncryptionDelegate encryptionDelegate = null;
try {
encryptionDelegate = new EncryptionDelegate();
attribute = getCookieValue(request, attributename);
if (attribute != null) {
attribute =
encryptionDelegate.decryptWithDES(
attribute,
com
.huawei
.it
.support
.encryption
.util
.DESEncryptionFactory
.DES);
//返回明文
} else {
throw new Exception(
"AuthFilter Error: Can't get 'uid' from cookie while the LoginSign of uniportal website is '"
+ logFlag
+ "' !");
}
} catch (Exception ex) {
logger.info("INTRANET_Common getUserInfo Exception !");
ex.printStackTrace();
}
return attribute;
}