summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com1
-rw-r--r--sca-cpp/trunk/modules/edit/htdocs/graph/graph.js10
-rw-r--r--sca-cpp/trunk/modules/edit/htdocs/login/index.html30
3 files changed, 36 insertions, 5 deletions
diff --git a/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com b/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com
new file mode 100644
index 0000000000..0d5faf04f6
--- /dev/null
+++ b/sca-cpp/trunk/modules/edit/dashboards/joe@sca-store.com
@@ -0,0 +1 @@
+(("An App that shows my Aggregated Social Profile" "myprofile" ()) ("An advanced version of the Aggregated Social Profile App" "myprofile2" ()) ("An App that shows Friends Near Me" "nearme" ()) ("An advanced version of the Friends Near Me App" "nearme2" ()) ("Sample Online Store App" "store" ()) ("Layout Variation of the Online Store App" "store2" ()) ("Another Variation of the Online Store App" "store3" ()) ("Travel Tutorial App" "travel" ()) ("An Empty Test App" "test" ()) ("Test Values and Lists" "testvalues" ()) ("Test Social Components" "testsocial" ()) ("Test URL Components" "testurl" ()) ("Test Logic Components" "testlogic" ()) ("Test Text Processing Components" "testtext" ())) \ No newline at end of file
diff --git a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
index 5e1de60c65..fdf7dde3a1 100644
--- a/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
+++ b/sca-cpp/trunk/modules/edit/htdocs/graph/graph.js
@@ -1838,10 +1838,12 @@ graph.edit = function(appname, compos, nodes, onchange, g) {
* Return the link to a component value.
*/
graph.compvaluelink = function(appname, cname) {
- var scheme = 'http';
- var domain = "sca-store.com";
- var port = '8090';
- var link = scheme + '://' + appname + '.' + domain + ':' + port + '/components/' + cname;
+ var protocol = window.location.protocol;
+ var host = window.location.hostname;
+ var port = ':' + window.location.port;
+ if (port == ':80' || port == ':443')
+ port = '';
+ var link = protocol + '//' + appname + '.' + host + port + '/components/' + cname;
return '<a href="' + link + '">' + link + '</a>';
};
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>