Author: tyrell
Date: Sun Mar 2 20:57:25 2008
New Revision: 14421
Log:
Fixing the sign in issue when 'remember me' is not set.
Modified:
trunk/mashup/java/modules/www/signin.jsp
Modified: trunk/mashup/java/modules/www/signin.jsp
==============================================================================
--- trunk/mashup/java/modules/www/signin.jsp (original)
+++ trunk/mashup/java/modules/www/signin.jsp Sun Mar 2 20:57:25 2008
@@ -123,7 +123,8 @@
}
int expireIn = 60 * 60 * 24 * numDays;
int longerExpDays = 60 * 60 * 24 * 365 * 2; //2
years
- if((rememberMeForever.equalsIgnoreCase("true")) &&
(numDays <= longerExpDays)){
+ if ((rememberMeForever.equalsIgnoreCase("true")) &&
+ (numDays <= longerExpDays)) {
expireIn = longerExpDays;
}
@@ -146,9 +147,10 @@
passwordCookie.setSecure(true);
response.addCookie(passwordCookie);
}
-
- response.sendRedirect(bounceback);
}
+
+ response.sendRedirect(bounceback);
+
} else {
success = false;
}
@@ -206,113 +208,113 @@
<body onload="redirectToHttps('<%=thisPage%>');">
<div id="page">
- <%@ include file="header.jsp" %>
- <div id="search"></div>
- <div id="content">
- <table width="100%" height="400" border="0" cellspacing="0"
cellpadding="5">
- <tr>
- <td valign="top">
- <form id="Login" onsubmit="return true;" method="post">
- <input type="hidden" name="firsttime" value="false"/>
- <input type="hidden" name="bounceback"
value="<%=bounceback%>"/>
- <input type="hidden" id="rememberme" name="rememberme"
value="false"/>
- <input type="hidden" id="remembermeforever"
name="remembermeforever"
- value="false"/>
- <br/>
- <table width="675" border="0" cellpadding="3"
cellspacing="0"
- class="box" align="center">
- <tr>
- <th>Sign-in to <%=
bundle.getString("main.title")%>
- </th>
- <th width="50%">Use InfoCard to enter <%=
bundle
- .getString("main.title")%>
- </th>
- </tr>
- <tr>
- <td height="175">
- <% if (!success) { %>
- <div class="error">Invalid user or
password. Please try again.
- </div>
- <% } %>
- <label style="margin-right:2px;
"><strong>User
- Name:</strong></label><input
- type="text" name="userName"
- value="<% if (!success)
out.println(nameProvided); %>"
- id="userName"/>
- <script type="text/javascript">
- Field.focus('userName');
- </script>
- <br/><br/>
- <label style="margin-right:10px;
"><strong>Password:</strong></label><input
- type="password" name="password"
id="password"/>
- <br/><br/>
-
- <div style="width:100%;"><input
- type="checkbox" id="chkRemember"
- onclick="setRememberMe();"><label
- style="text-align: left; ">
- Remember me on this
computer</label><br><br></div>
- <%
- ServerConfiguration serverConfig =
-
ServerConfiguration.getInstance();
- String rememberPeriod =
serverConfig.getFirstProperty(
-
MashupConstants.SESSION_MANAGEMENT + "." +
-
MashupConstants.REMEMBER_ME_PERIOD);
- int numDays = 0;
- int longerExpDays = 60 * 60 * 24 * 365
* 2; //2 years
- try {
- numDays =
Integer.parseInt(rememberPeriod);
- } catch (NumberFormatException e) {
- }
- if
((MashupUtils.isFromLocalHost(request)) &&
- (numDays <= longerExpDays)) {
- %>
- <div style="width:100%;"><input
- type="checkbox"
id="chkRememberForever"
-
onclick="setRememberMeForever();"><label
- style="text-align: left; ">
- If you chose to remember your login
information, it will be
- stored for <%=numDays%> days. However,
since you are signing
- in from local host, you can choose to
remember your login
- indefinetely by checking this box.
</label><br><br></div>
- <%
- }
- %>
- <div><input
- type="submit"
- id="signin"
- value="Sign In"/>
- </div>
- </td>
- <td height="175">
- <a
href="infocard.jsp?bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>"><img
- src="images/infocard_92x64.png"
border="0"></a>
- <br/><br/>
- Sign In using your personal or managed
InfoCard.
- <br/>
- <br/>
- <a
href="http://wso2.org/projects/solutions/identity"
- target="_blank"><img
src="images/powered_identity.gif"
- border="0"></a>
- </td>
- </tr>
- <tr>
- <td>
- <a
href="reset_password.jsp?firstcall=true&bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>">Forgot
- Password?</a>
- </td>
- </tr>
- </table>
+<%@ include file="header.jsp" %>
+<div id="search"></div>
+<div id="content">
+<table width="100%" height="400" border="0" cellspacing="0" cellpadding="5">
+<tr>
+ <td valign="top">
+ <form id="Login" onsubmit="return true;" method="post">
+ <input type="hidden" name="firsttime" value="false"/>
+ <input type="hidden" name="bounceback" value="<%=bounceback%>"/>
+ <input type="hidden" id="rememberme" name="rememberme"
value="false"/>
+ <input type="hidden" id="remembermeforever"
name="remembermeforever"
+ value="false"/>
+ <br/>
+ <table width="675" border="0" cellpadding="3" cellspacing="0"
+ class="box" align="center">
+ <tr>
+ <th>Sign-in to <%= bundle.getString("main.title")%>
+ </th>
+ <th width="50%">Use InfoCard to enter <%= bundle
+ .getString("main.title")%>
+ </th>
+ </tr>
+ <tr>
+ <td height="175">
+ <% if (!success) { %>
+ <div class="error">Invalid user or password. Please
try again.
+ </div>
+ <% } %>
+ <label style="margin-right:2px; "><strong>User
+ Name:</strong></label><input
+ type="text" name="userName"
+ value="<% if (!success) out.println(nameProvided);
%>"
+ id="userName"/>
+ <script type="text/javascript">
+ Field.focus('userName');
+ </script>
+ <br/><br/>
+ <label style="margin-right:10px;
"><strong>Password:</strong></label><input
+ type="password" name="password" id="password"/>
+ <br/><br/>
+
+ <div style="width:100%;"><input
+ type="checkbox" id="chkRemember"
+ onclick="setRememberMe();"><label
+ style="text-align: left; ">
+ Remember me on this computer</label><br><br></div>
+ <%
+ ServerConfiguration serverConfig =
+ ServerConfiguration.getInstance();
+ String rememberPeriod =
serverConfig.getFirstProperty(
+ MashupConstants.SESSION_MANAGEMENT + "." +
+
MashupConstants.REMEMBER_ME_PERIOD);
+ int numDays = 0;
+ int longerExpDays = 60 * 60 * 24 * 365 * 2; //2
years
+ try {
+ numDays = Integer.parseInt(rememberPeriod);
+ } catch (NumberFormatException e) {
+ }
+ if ((MashupUtils.isFromLocalHost(request)) &&
+ (numDays <= longerExpDays)) {
+ %>
+ <div style="width:100%;"><input
+ type="checkbox" id="chkRememberForever"
+ onclick="setRememberMeForever();"><label
+ style="text-align: left; ">
+ If you chose to remember your login information,
it will be
+ stored for <%=numDays%> days. However, since you
are signing
+ in from local host, you can choose to remember
your login
+ indefinetely by checking this box.
</label><br><br></div>
+ <%
+ }
+ %>
+ <div><input
+ type="submit"
+ id="signin"
+ value="Sign In"/>
+ </div>
+ </td>
+ <td height="175">
+ <a
href="infocard.jsp?bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>"><img
+ src="images/infocard_92x64.png" border="0"></a>
+ <br/><br/>
+ Sign In using your personal or managed InfoCard.
<br/>
<br/>
- </form>
-
-
- </td>
- </tr>
- </table>
- </div>
- <%@ include file="footer.jsp" %>
+ <a href="http://wso2.org/projects/solutions/identity"
+ target="_blank"><img
src="images/powered_identity.gif"
+ border="0"></a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a
href="reset_password.jsp?firstcall=true&bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>">Forgot
+ Password?</a>
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <br/>
+ </form>
+
+
+ </td>
+</tr>
+</table>
+</div>
+<%@ include file="footer.jsp" %>
</div>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev