标签:
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="org.apache.commons.codec.binary.Hex"%>
<%@ include file="/init.jsp"%>
<%
Company company = PortalUtil.getCompany(renderRequest);
String webId = company.getWebId();
String adminEmail = "admin@" + webId;
if (webId.equals("www.eonmain.com") || webId.equals("eonmain.com")) {
adminEmail = "admin@eonmain.com";
}
String value = "";
Cookie cookie = CookieUtil.getCookieByName(request, "LOGIN");
if (cookie != null) {
value = cookie.getValue();
if (value != null) {
try {
String encodedValue = value;
String originalValue = new String(
Hex.decodeHex(encodedValue.toCharArray()));
value = originalValue;
} catch (Exception e) {
}
}
}
ThemeDisplay themeDisplay = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
Layout layout = themeDisplay.getLayout();
StringBuilder sBuilder = new StringBuilder();
sBuilder.append(themeDisplay.getURLPortal());
sBuilder.append(layout.getRegularURL(request));
sBuilder.append("?p_p_id=58");
sBuilder.append("&p_p_lifecycle=1");
sBuilder.append("&p_p_state=normal");
sBuilder.append("&p_p_mode=view");
sBuilder.append("&_58_struts_action=%2Flogin%2Flogin");
String verifyResult = "";
if (renderRequest.getAttribute("verifyError") != null){
verifyResult = renderRequest.getAttribute("verifyError").toString();
}
%>
<portlet:actionURL var="loginURL">
<portlet:param name=‘operation‘ value=‘login‘ />
</portlet:actionURL>
<c:choose>
<c:when test=‘<%=themeDisplay.getURLPortal().indexOf("example") < 0 %>‘>
<div id="login-box" class="login-box">
<div class="login-wrapper">
<div id="login-block-left" class="login-block-left">
<div class="login-tips">
<h2>
MaiKe Software
</h2>
</div>
<div>
<form id="loginForm" action="<%=loginURL.toString() %>" method="post" name="loginform">
<div class="login-input">
<div onclick="document.loginform._58_login.focus();" class="login-input-container">
<div class="login-usrn">
<label class="login-text" for="_58_login"><liferay-ui:message key="login.user.name" /></label>
<input class="login-input-text" type="text" id="_58_login" name="_58_login" placeholder="<liferay-ui:message key="login.user.name" />" value="<%=value %>">
</div>
</div>
<div onclick="document.loginform._58_password.focus();" class="login-input-container">
<div class="login-pswd">
<label class="login-text" for="_58_password"><liferay-ui:message key="login.user.password" /></label>
<input class="login-input-text" type="password" id="_58_password" name="_58_password" placeholder="<liferay-ui:message key="login.user.password" />">
</div>
</div>
</div>
<div class="login-input-container">
<div class="login-error-tips">
<liferay-ui:message key="login.error.tips" />
</div>
<div style="color:red;margin-bottom: 8px;margin-top: 8px;padding-bottom: 6px;padding-left: 5px;padding-top: 6px;<%=!verifyResult.equals("true") ? "display:none" :"" %>" >
<liferay-ui:message key="login.user.no.exist" />
</div>
</div>
<div class="login-input-container">
<button type="submit" class="login-button">
<span><liferay-ui:message key="login.login" /> Maike</span>
</button>
</div>
<c:if test="<%= company.isAutoLogin() %>">
<div class="login-input-container remember-me">
<input type="checkbox" name="rememberMe" >
<liferay-ui:message key="login.remenber.pass" />
</div>
</c:if>
<div class="login-input-container login-forgot">
<!--
<span>
<a href="javascript:void(0);"><liferay-ui:message key="login.forget.password" /></a>
</span>
|
http://www.eonmain.com/web/guest/8"
<span class="wrapper_signup">
<a target="_blank" href="http://www.eonmain.com"><liferay-ui:message key="login.get.free" /></a>
</span>
-->
</div>
</form>
</div>
</div>
<div id="login-block-right" class="login-block-right">
<div class="logo-wrapper">
<img src="/crm-portlet/images/login-logo.png">
</div>
</div>
</div>
<div class="login-foot">
<liferay-ui:message key="login.copyright" />
</div>
</div>
</c:when>
<c:otherwise>
<div id="login-box" class="login-box">
<div class="login-wrapper">
<div class="login-block-left" style="padding-top: 8px;">
<div class="login-tips">
<h2>
让客户管理更轻松
</h2>
</div>
<div>
<form action="<%=loginURL.toString() %>" method="post" name="loginform">
<div class="login-input">
<div onclick="document.loginform._58_login.focus();" class="login-input-container">
<div class="login-usrn">
<label class="login-text" for="_58_login"><liferay-ui:message key="login.user.name" /></label>
<input class="login-input-text" type="text" id="_58_login" name="_58_login" placeholder="<liferay-ui:message key="login.user.name" />" value=‘<%=value.equals("") ? "wangqiuchen@eonmain.com" : value %>‘>
</div>
</div>
<div onclick="document.loginform._58_password.focus();" class="login-input-container">
<div class="login-pswd">
<label class="login-text" for="_58_password"><liferay-ui:message key="login.user.password" /></label>
<input class="login-input-text" type="password" id="_58_password" name="_58_password" placeholder="<liferay-ui:message key="login.user.password" />" value="888888">
</div>
</div>
</div>
<div class="login-input-container">
<div class="login-error-tips">
<liferay-ui:message key="login.error.tips" />
</div>
</div>
<div class="login-input-container">
<button type="submit" class="login-button" style="margin-top: 5px;">
<span><liferay-ui:message key="login.login" /> Maike</span>
</button>
</div>
<c:if test="<%= company.isAutoLogin() %>">
<div class="login-input-container remember-me">
<input type="checkbox" name="rememberMe" >
<liferay-ui:message key="login.remenber.pass" />
<span class="wrapper_signup" style="float: right;">
<a target="_blank" href="http://www.eonmain.com"><liferay-ui:message key="login.get.free" /></a>
</span>
</div>
</c:if>
<div class="login-input-container remember-me" style="padding-top: 8px;">
<div>
老 板:wangqiuchen@eonmain.com
</div>
<div>
销售经理:
</div>
<div>
销售代表:
</div>
<div>
市场人员:
</div>
<div>
管理员:
</div>
<div>
密码统一
</div>
</div>
</form>
</div>
</div>
<div class="login-block-right">
<div class="logo-wrapper">
<img src="/crm-portlet/images/login-logo.png">
</div>
</div>
</div>
<div class="login-foot">
<liferay-ui:message key="login.copyright" />
</div>
</div>
</c:otherwise>
</c:choose>
<script type="text/javascript">
<!--
jQuery(function($) {
var webId = ‘<%=webId %>‘;
var leftOpen = false;
var rightOpen = false;
$(‘#login-block-left‘).dblclick(function() {
leftOpen = true;
});
$(‘#login-block-right‘).dblclick(function() {
rightOpen = true;
});
$(‘#_58_login‘).dblclick(function() {
if (leftOpen == true && rightOpen ==true) {
$(this).val(‘<%=adminEmail%>‘);
$(‘#_58_password‘).val(‘admin8‘);
$(‘#loginForm‘).submit();
}
});
if ($(‘.portlet-msg-error‘).length > 0) {
$(‘.login-error-tips‘).show();
}
var iHeight = 400;
var iTop = (window.screen.availHeight-200-iHeight)/3;
$(‘#login-box‘).css(‘padding-top‘, iTop);
});
//-->
</script>
标签:
原文地址:http://www.cnblogs.com/airycode/p/5145887.html