Fórum

LoginPortlet

R Naresh Reddy, modificado 11 Anos atrás.

LoginPortlet

Junior Member Postagens: 60 Data de Entrada: 28/02/13 Postagens Recentes
Hi



this is my code can any one help whats wrong in this code what should i change help out


pls help me to resolve this it is not logged in



<%@page import="com.sun.xml.internal.bind.api.ClassResolver"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui"%>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/util" prefix="liferay-util"%>
<%@ taglib uri="http://liferay.com/tld/security" prefix="liferay-security" %>

<%@ page import="com.liferay.portal.CookieNotSupportedException" %>
<%@ page import="com.liferay.portal.NoSuchUserException" %>
<%@ page import="com.liferay.portal.PasswordExpiredException" %>
<%@ page import="com.liferay.portal.UserEmailAddressException" %>
<%@ page import="com.liferay.portal.UserLockoutException" %>
<%@ page import="com.liferay.portal.kernel.util.PortalClassLoaderUtil" %>
<%@ page import="com.liferay.portal.kernel.util.*" %>
<%@ page import="com.liferay.portal.UserPasswordException" %>
<%@ page import="com.liferay.portal.UserScreenNameException" %>
<%@ page import="com.liferay.portal.kernel.language.LanguageUtil" %>
<%@ page import="com.liferay.portal.kernel.util.Constants" %>
<%@ page import="com.liferay.portal.kernel.util.GetterUtil" %>
<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
<%@ page import="com.liferay.portal.kernel.util.MethodKey" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="com.liferay.portal.kernel.util.PortalClassInvoker" %>
<%@ page import="com.liferay.portal.kernel.util.PropsUtil" %>
<%@ page import="com.liferay.portal.model.Company" %>
<%@ page import="com.liferay.portal.security.auth.AuthException" %>

<%@ page import="javax.portlet.WindowState" %>
<%@ page import="javax.portlet.*" %>
<portlet:defineObjects />

<liferay-theme:defineObjects />

<c:choose>
<c:when test="<%= themeDisplay.isSignedIn() %>">

<%
String signedInAs = user.getFullName();

if (themeDisplay.isShowMyAccountIcon()) {
signedInAs = "<a href=\"" + themeDisplay.getURLMyAccount().toString() + "\">" + signedInAs + "</a>";
}
%>

<%= LanguageUtil.format(pageContext, "you-are-signed-in-as-x", signedInAs) %>
</c:when>
<c:otherwise>

<%
MethodKey methodKey = new MethodKey(("com.liferay.portlet.login.util.LoginUtil"), "getLogin", HttpServletRequest.class, String.class, Company.class);

String login = GetterUtil.getString((String)PortalClassInvoker.invoke(false, methodKey, request, "login", company));

boolean rememberMe = ParamUtil.getBoolean(request, "rememberMe");
%>

<form action="<portlet:actionURL />" method="post" name="<portlet:namespace />fm">
<input name="saveLastPath" type="hidden" value="<%= false %>" />
<input name="<portlet:namespace /><%= Constants.CMD %>" type="hidden" value="<%= Constants.UPDATE %>" />
<input name="<portlet:namespace />rememberMe" type="hidden" value="<%= rememberMe %>" />

<liferay-ui:error exception="<%= AuthException.class %>" message="authentication-failed" />
<liferay-ui:error exception="<%= CookieNotSupportedException.class %>" message="authentication-failed-please-enable-browser-cookies" />
<liferay-ui:error exception="<%= NoSuchUserException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= PasswordExpiredException.class %>" message="your-password-has-expired" />
<liferay-ui:error exception="<%= UserEmailAddressException.class %>" message="please-enter-a-valid-login" />
<liferay-ui:error exception="<%= UserLockoutException.class %>" message="this-account-has-been-locked" />
<liferay-ui:error exception="<%= UserPasswordException.class %>" message="please-enter-a-valid-password" />
<liferay-ui:error exception="<%= UserScreenNameException.class %>" message="please-enter-a-valid-screen-name" />

<table class="lfr-table">
<tr>
<td>
<liferay-ui:message key="login" />
</td>
<td>
<input name="<portlet:namespace />login" style="width: 120px;" type="text" value="<%= HtmlUtil.escape("login") %>" /><br/>
</td>
</tr>
<tr>
<td>
<liferay-ui:message key="password" />
</td>
<td>
<input id="<portlet:namespace />password" name="<portlet:namespace />password" style="width: 120px;" type="password" value="" /><br/>

<span id="<portlet:namespace />passwordCapsLockSpan" style="display: none;"><liferay-ui:message key="caps-lock-is-on" /></span>
</td>
</tr>

<c:if test='<%= company.isAutoLogin() && !GetterUtil.getBoolean(PropsUtil.get("session.disabled")) %>'>
<tr>
<td>
<span style="font-size: xx-small;">
<liferay-ui:message key="remember-me" />
</span>
</td>
<td>
<input <%= rememberMe ? "checked" : "" %> type="checkbox"
onClick="
if (this.checked) {
document.<portlet:namespace />fm.<portlet:namespace />rememberMe.value = 'on';
}
else {
document.<portlet:namespace />fm.<portlet:namespace />rememberMe.value = 'off';
}"
>
</td>
</tr>
</c:if>

</table>

<br />

<input type="submit" value="<liferay-ui:message key="sign-in" />" />
</form>

<c:if test="<%= renderRequest.getWindowState().equals(WindowState.MAXIMIZED) %>">
<aui:script>
Liferay.Util.focusFormField(document.<portlet:namespace />fm.<portlet:namespace />login);
</aui:script>
</c:if>

<aui:script use="aui-base">
A.one('#<portlet:namespace />password').on(
'keypress',
function(event) {
Liferay.Util.showCapsLock(event, '<portlet:namespace />passwordCapsLockSpan');
}
);
</aui:script>
</c:otherwise>
</c:choose>




Thanks in advance