summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/edit/htdocs/login/index.html
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-02-27 07:34:28 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-02-27 07:34:28 +0000
commitc9df0701735739979fc674bb8f08f76c591cf8e0 (patch)
tree9c64157039d8ac271de4ecdcd46b466a85f760ec /sca-cpp/trunk/modules/edit/htdocs/login/index.html
parent60646adbdaea14ad20182cfa9e2a4b71573201f4 (diff)
Fixes to make the edit module work with HTTPS.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1074997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/edit/htdocs/login/index.html')
-rw-r--r--sca-cpp/trunk/modules/edit/htdocs/login/index.html30
1 files changed, 29 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/edit/htdocs/login/index.html b/sca-cpp/trunk/modules/edit/htdocs/login/index.html
index 095ed80521..816046be82 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/login/index.html
+++ b/sca-cpp/trunk/modules/edit/htdocs/login/index.html
@@ -29,9 +29,37 @@
<br/>
<script type="text/javascript">
+function queryParams() {
+ qp = new Array();
+ qs = window.location.search.substring(1).split('&');
+ for (i = 0; i < qs.length; i++) {
+ e = qs[i].indexOf('=');
+ if (e > 0)
+ qp[qs[i].substring(0, e)] = unescape(qs[i].substring(e + 1));
+ }
+ return qp;
+}
+
+function oauthReferrer() {
+ r = queryParams()['openauth_referrer'];
+ if (typeof(r) == 'undefined')
+ return r;
+ s = r.indexOf('//');
+ if (s > 0)
+ r = r.substring(s + 2);
+ s = r.indexOf('/');
+ if (s > 0)
+ r = r.substring(s);
+ return r;
+}
+
+if (typeof(oauthReferrer()) == 'undefined') {
+ document.location = '/';
+}
+
function submitFormSignin() {
document.cookie = 'TuscanyOpenAuth=;expires=' + new Date(1970,01,01).toGMTString() + ';path=/;secure=TRUE';
- document.formSignin.httpd_location.value = '/';
+ document.formSignin.httpd_location.value = oauthReferrer();
document.formSignin.submit();
}
</script>