Author: prabath
Date: Fri Mar 14 03:16:24 2008
New Revision: 14810

Log:

login pages redirected to HTTPS

Modified:
   trunk/solutions/identity/modules/admin-ui/src/main/webapp/jsp/login.jsp
   trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/login.jsp

Modified: 
trunk/solutions/identity/modules/admin-ui/src/main/webapp/jsp/login.jsp
==============================================================================
--- trunk/solutions/identity/modules/admin-ui/src/main/webapp/jsp/login.jsp     
(original)
+++ trunk/solutions/identity/modules/admin-ui/src/main/webapp/jsp/login.jsp     
Fri Mar 14 03:16:24 2008
@@ -1,62 +1,83 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-"http://www.w3.org/TR/html4/strict.dtd";>
-<html>
-<head>
-<title>WSO2 Identity Solution | Management Console</title>
-<link type="text/css" rel="stylesheet" href="css/styles.css" />
-
-</head>
-<body>
-
-
-<div class="page">
-
-       <!-- START Header  -->
-       <s:include value="header.jsp" />
-       <!-- END Header -->
-
-       <!-- START Content  -->
-       <table cellpadding="0" cellspacing="0" border="0" class="middle">
-               <tr>
-                       <td class="left-menu" valign="top">
-                               <div class="menu-back">
-
-
-
-
-
-                               </div>
-                       </td>
-                       <td class="content" valign="top">
-                               <div class="breadcrumb"><a 
class="breadcrumb-link" href="#">Home</a></div>
-                               <h1 class="headding-login">Identity Solution 
Management Console - Login</h1>
-
-
-
-                               <s:form action="Login.action" theme="simple" 
method="POST">
-                               <div class="errors">
-                                       <s:actionerror />
-                                       <s:fielderror />
-                               </div>
-                               <table cellpadding="0" cellspacing="10" 
border="0" class="login-box">
-                                       <tr><td>Username</td><td><s:textfield 
name="username" label="Login name" cssClass="text-box-normal" /></td></tr>
-                                       <tr><td>Password</td><td><s:password 
name="password" label="Password" cssClass="text-box-normal" /></td></tr>
-                                       <tr><td></td><td><s:submit 
value="Login" align="left" cssClass="button" /></td></tr>
-                               </table>
-                               </s:form>
-
-                       </td>
-               </tr>
-       </table>
-       <!-- END Content -->
-</div>
-
-<!-- Include footer -->
-<s:include value="footer.jsp" />
-
-
-
-
-</body>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<[EMAIL PROTECTED] import="org.wso2.utils.ServerConfiguration"%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+"http://www.w3.org/TR/html4/strict.dtd";>
+<html>
+<head>
+<title>WSO2 Identity Solution | Management Console</title>
+<link type="text/css" rel="stylesheet" href="css/styles.css" />
+
+<%
+ServerConfiguration serverConfig = null;
+String httpsPort = null;
+serverConfig = ServerConfiguration.getInstance();
+httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");
+%>
+
+<script type="text/javascript" language="JavaScript">
+function redirectToHttps(httpsPort) {
+    var locationString = self.location.href;
+    var _tmpURL = locationString.substring(0, locationString.lastIndexOf('/'));
+    if (_tmpURL.indexOf('https') == -1) {
+        //Re-direct to https
+        var redirectUrl = "https://"; + self.location.hostname +":"+httpsPort;  
      
+        redirectUrl += "/admin/ShowMain.action";
+        window.location = redirectUrl;
+    }
+}
+</script>
+
+</head>
+<body onload="redirectToHttps('<%=httpsPort%>');">
+
+<div class="page">
+
+       <!-- START Header  -->
+       <s:include value="header.jsp" />
+       <!-- END Header -->
+
+       <!-- START Content  -->
+       <table cellpadding="0" cellspacing="0" border="0" class="middle">
+               <tr>
+                       <td class="left-menu" valign="top">
+                               <div class="menu-back">
+
+
+
+
+
+                               </div>
+                       </td>
+                       <td class="content" valign="top">
+                               <div class="breadcrumb"><a 
class="breadcrumb-link" href="#">Home</a></div>
+                               <h1 class="headding-login">Identity Solution 
Management Console - Login</h1>
+
+
+
+                               <s:form action="Login.action" theme="simple" 
method="POST">
+                               <div class="errors">
+                                       <s:actionerror />
+                                       <s:fielderror />
+                               </div>
+                               <table cellpadding="0" cellspacing="10" 
border="0" class="login-box">
+                                       <tr><td>Username</td><td><s:textfield 
name="username" label="Login name" cssClass="text-box-normal" /></td></tr>
+                                       <tr><td>Password</td><td><s:password 
name="password" label="Password" cssClass="text-box-normal" /></td></tr>
+                                       <tr><td></td><td><s:submit 
value="Login" align="left" cssClass="button" /></td></tr>
+                               </table>
+                               </s:form>
+
+                       </td>
+               </tr>
+       </table>
+       <!-- END Content -->
+</div>
+
+<!-- Include footer -->
+<s:include value="footer.jsp" />
+
+
+
+
+</body>
 </html>
\ No newline at end of file

Modified: trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/login.jsp
==============================================================================
--- trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/login.jsp      
(original)
+++ trunk/solutions/identity/modules/user-ui/src/main/webapp/jsp/login.jsp      
Fri Mar 14 03:16:24 2008
@@ -1,12 +1,35 @@
 <%@ taglib prefix="s" uri="/struts-tags"%>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
+<[EMAIL PROTECTED] import="org.wso2.utils.ServerConfiguration"%>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
 "http://www.w3.org/TR/html4/strict.dtd";>
 <html>
 <head>
 <title>WSO2 Identity Solution</title>
 <link type="text/css" rel="stylesheet" href="css/styles.css" />
+
+<%
+ServerConfiguration serverConfig = null;
+String httpsPort = null;
+serverConfig = ServerConfiguration.getInstance();
+httpsPort = serverConfig.getFirstProperty("Ports.HTTPS");
+%>
+
+<script type="text/javascript" language="JavaScript">
+function redirectToHttps(httpsPort) {
+    var locationString = self.location.href;
+    var _tmpURL = locationString.substring(0, locationString.lastIndexOf('/'));
+    if (_tmpURL.indexOf('https') == -1) {
+        //Re-direct to https
+        var redirectUrl = "https://"; + self.location.hostname +":"+httpsPort;  
      
+        redirectUrl += "/ShowLogin.action";
+        window.location = redirectUrl;
+    }
+}
+</script>
+
 </head>
-<body>
+<body onload="redirectToHttps('<%=httpsPort%>');">
 <!-- Include the header -->
 <s:include value="header.jsp" />
 

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to