summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/js/htdocs/util.js
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-11-21 08:47:12 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-11-21 08:47:12 +0000
commit57ff384203570508e81cdf5dfaa0cb96478e7654 (patch)
treebaa71ee27ee1354cb633cd578c9d36fb15485124 /sca-cpp/trunk/modules/js/htdocs/util.js
parent5a4e8af02b6fc5fefc5f7a2a95cc1e735759c40a (diff)
Improvements to the auth implementation. Refactor logout page, handle auth redirects in XHR responses and allow auth to work off an OpenID AX attribute or OAuth resource attribute.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1204401 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/js/htdocs/util.js')
-rw-r--r--sca-cpp/trunk/modules/js/htdocs/util.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/js/htdocs/util.js b/sca-cpp/trunk/modules/js/htdocs/util.js
index 86e17c4f60..60c8a0c8e6 100644
--- a/sca-cpp/trunk/modules/js/htdocs/util.js
+++ b/sca-cpp/trunk/modules/js/htdocs/util.js
@@ -315,8 +315,15 @@ function properties(o) {
* Convert a host name to a domain name.
*/
function domainname(host) {
+ var ds = host.indexOf('//');
+ if (ds != -1)
+ return domainname(host.substring(ds + 2));
+ var s = host.indexOf('/');
+ if (s != -1)
+ return domainname(host.substring(0, s));
var h = reverse(host.split('.'));
- return reverse(mklist(car(h), cadr(h))).join('.');
+ var d = (!isNil(cddr(h)) && caddr(h) == 'www')? mklist(car(h), cadr(h), caddr(h)) : mklist(car(h), cadr(h));
+ return reverse(d).join('.');
}
/**