Author: tyrell
Date: Fri Jan 4 05:24:05 2008
New Revision: 11846
Log:
Fixing MASHUP-478
Modified:
trunk/mashup/java/modules/www/js/mashup-main.js
trunk/mashup/java/modules/www/js/utils.js
trunk/mashup/java/modules/www/mashup.jsp
trunk/mashup/java/modules/www/signin.jsp
trunk/mashup/java/modules/www/user.jsp
Modified: trunk/mashup/java/modules/www/js/mashup-main.js
==============================================================================
--- trunk/mashup/java/modules/www/js/mashup-main.js (original)
+++ trunk/mashup/java/modules/www/js/mashup-main.js Fri Jan 4 05:24:05 2008
@@ -25,7 +25,7 @@
wso2.mashup = {
- init : function(isAdminConsole) {
+ init : function(isSecure) {
if (WSO2.MashupUtils.getCookieValue("userName")) {
//User is already logged in
@@ -36,24 +36,21 @@
} else {
wso2.wsf.Util.initURLs();
- /*Only for protocol determination*/
- var _tmpURL = locationString.substring(0,
locationString.lastIndexOf('/'));
- if (_tmpURL.indexOf('https') == -1) {
-
- //Re-direct to https
- window.location =
- "https" + URL.substring(URL.indexOf('://'),
URL.lastIndexOf(':') + 1) +
- HTTPS_PORT;
+ if (isSecure) {
+ /*Only for protocol determination*/
+ var _tmpURL = locationString.substring(0,
locationString.lastIndexOf('/'));
+ if (_tmpURL.indexOf('https') == -1) {
+
+ //Re-direct to https
+ window.location =
+ "https" + URL.substring(URL.indexOf('://'),
URL.lastIndexOf(':') + 1) +
+ HTTPS_PORT;
+ }
}
+
//Initializing the helper function for XSLT transformations
inherited from WSO2 AdminUI
wso2.wsf.XSLTHelper.init();
-
- /*if (isAdminConsole) {
- //Displaying the login container
- document.getElementById("logincontainer").style.display =
"block";
- }*/
-
}
},
Modified: trunk/mashup/java/modules/www/js/utils.js
==============================================================================
--- trunk/mashup/java/modules/www/js/utils.js (original)
+++ trunk/mashup/java/modules/www/js/utils.js Fri Jan 4 05:24:05 2008
@@ -44,7 +44,7 @@
}
}
} catch(ex) {
- isCustomUiAvailable(serviceLocation,
callback);
+ isCustomUiAvailable(serviceLocation,
callback);
}
}
}
@@ -52,7 +52,7 @@
xmlHttpRequest4ui.send(null);
}
} catch(ex) {
- isCustomUiAvailable(serviceLocation, callback);
+ isCustomUiAvailable(serviceLocation, callback);
}
}
}
@@ -83,4 +83,32 @@
}
return request;
+}
+
+function redirectToHttps(bounceback) {
+ /*Only for protocol determination*/
+ wso2.wsf.Util.initURLs();
+ var locationString = self.location.href;
+ var _tmpURL = locationString.substring(0, locationString.lastIndexOf('/'));
+ if (_tmpURL.indexOf('https') == -1) {
+
+ //Re-direct to https
+ window.location =
+ "https" + URL.substring(URL.indexOf('://'), URL.lastIndexOf(':') + 1) +
+ HTTPS_PORT + '/' + bounceback;
+ }
+}
+
+function redirectToHttp(bounceback) {
+ /*Only for protocol determination*/
+ wso2.wsf.Util.initURLs();
+ var locationString = self.location.href;
+ var _tmpURL = locationString.substring(0, locationString.lastIndexOf('/'));
+ if (_tmpURL.indexOf('http') == -1) {
+
+ //Re-direct to https
+ window.location =
+ "http" + URL.substring(URL.indexOf('://'), URL.lastIndexOf(':') + 1) +
+ HTTPS_PORT + '/' + bounceback;
+ }
}
\ No newline at end of file
Modified: trunk/mashup/java/modules/www/mashup.jsp
==============================================================================
--- trunk/mashup/java/modules/www/mashup.jsp (original)
+++ trunk/mashup/java/modules/www/mashup.jsp Fri Jan 4 05:24:05 2008
@@ -223,7 +223,7 @@
</head>
-<body onload="wso2.mashup.init(true);">
+<body onload="wso2.mashup.init(false);">
<!-- Wrapping div required to capture document events for YUI dialogs -->
<div id="doc3">
Modified: trunk/mashup/java/modules/www/signin.jsp
==============================================================================
--- trunk/mashup/java/modules/www/signin.jsp (original)
+++ trunk/mashup/java/modules/www/signin.jsp Fri Jan 4 05:24:05 2008
@@ -15,7 +15,7 @@
--%>
<%@ page errorPage="error.jsp" %>
<%@ page import="com.sun.syndication.feed.synd.SyndContent"
-%>
+ %>
<%@ page import="com.sun.syndication.feed.synd.SyndContentImpl" %>
<%@ page import="com.sun.syndication.feed.synd.SyndEntry" %>
<%@ page import="com.sun.syndication.feed.synd.SyndEntryImpl" %>
@@ -52,7 +52,7 @@
<%@ page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<%
- Registry registry = RegistryUtils.getRegistry(request);
+ Registry registry = RegistryUtils.getRegistry(request);
// required by header.jsp
String thisPage = "signin.jsp";
@@ -105,9 +105,12 @@
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="js/prototype.js"
type="text/javascript"></script>
<script language="javascript" src="js/common.js"
type="text/javascript"></script>
+ <script language="javascript" src="js/utils.js"
type="text/javascript"></script>
+ <script type="text/javascript"
src="../wsasadmin/global_params.js"></script>
+ <script type="text/javascript" src="../wsasadmin/js/main.js"></script>
</head>
-<body>
+<body onload="redirectToHttps('<%=thisPage%>');">
<div id="page">
<%@ include file="header.jsp" %>
@@ -120,7 +123,8 @@
<input type="hidden" name="firsttime" value="false"/>
<input type="hidden" name="bounceback"
value="<%=bounceback%>"/>
<br/>
- <table width="600" border="0" align="right"
cellpadding="3" cellspacing="0" class="box">
+ <table width="600" border="0" align="right"
cellpadding="3" cellspacing="0"
+ class="box">
<tr>
<th align="center">Sign-in to
Mashups.WSO2.org</th>
<th align="center">Use info card to enter
Mashups.WSO2.org</th>
@@ -128,24 +132,30 @@
<tr>
<td align="center" height="175">
<% if (!success) { %>
- <div class="error">Invalid user or
password. Please try again.</div>
+ <div class="error">Invalid user or
password. Please try again.
+ </div>
<% } %>
- <label style="margin-right:20px;
"><strong>User Name:</strong></label><input
+ <label style="margin-right:20px;
"><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>
+ value="<% if (!success)
out.println(nameProvided); %>"
+ id="userName"/>
+ <script type="text/javascript">
+ Field.focus('userName');
+ </script>
<br/><br/>
<label style="margin-right:31px;
"><strong>Password:</strong></label><input
type="password" name="password"
id="password"/>
<br/><br/><br/>
- <div style="width:100%; text-align:center
"><input type="submit" id="signin"
-
value="Sign In"/></div>
+ <div style="width:100%; text-align:center
"><input type="submit"
+
id="signin"
+
value="Sign In"/>
+ </div>
</td>
<td align="center" height="175">
- <a
href="infocard.jsp?bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>"><img
src="images/infocard_92x64.png" border="0"></a>
+ <a
href="infocard.jsp?bounceback=<%=URLEncoder.encode(bounceback,"UTF-8")%>"><img
+ src="images/infocard_92x64.png"
border="0"></a>
<br/>
Signup using your personal or managed
infocard.
</td>
Modified: trunk/mashup/java/modules/www/user.jsp
==============================================================================
--- trunk/mashup/java/modules/www/user.jsp (original)
+++ trunk/mashup/java/modules/www/user.jsp Fri Jan 4 05:24:05 2008
@@ -165,7 +165,7 @@
</head>
-<body onload="wso2.mashup.init(true);">
+<body onload="wso2.mashup.init(false);">
<!-- Wrapping div required to capture document events for YUI dialogs -->
<div id="doc3">
<div id="page">
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev