Revision 3734
Added by ben leinfelder about 16 years ago
nceas.js | ||
---|---|---|
33 | 33 |
|
34 | 34 |
|
35 | 35 |
/* loginStatus: Uses XHR request to check for current session login status */ |
36 |
function loginStatus(){ |
|
36 |
function loginStatus(servletPath, cgiPrefix){
|
|
37 | 37 |
var httpRequest = false; |
38 | 38 |
try { |
39 | 39 |
httpRequest = new XMLHttpRequest(); |
... | ... | |
61 | 61 |
var login_block = document.getElementById('login_block'); |
62 | 62 |
|
63 | 63 |
if (response.indexOf("public") > 0) { |
64 |
login_block.innerHTML = '<a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas&' +
|
|
64 |
login_block.innerHTML = '<a href="' + cgiPrefix + '/register-dataset.cgi?cfg=nceas&' +
|
|
65 | 65 |
'stage=loginform">Login</a>'; |
66 | 66 |
} |
67 | 67 |
else |
68 | 68 |
{ |
69 |
login_block.innerHTML = '<a href="@cgi-prefix@/register-dataset.cgi?cfg=nceas&' +
|
|
69 |
login_block.innerHTML = '<a href="' + cgiPrefix + '/register-dataset.cgi?cfg=nceas&' +
|
|
70 | 70 |
'stage=logout">Logout</a>'; |
71 | 71 |
} |
72 | 72 |
} |
73 | 73 |
} |
74 | 74 |
} |
75 | 75 |
|
76 |
httpRequest.open("GET", "@servlet-path@?action=getloggedinuserinfo", true);
|
|
76 |
httpRequest.open("GET", servletPath + "?action=getloggedinuserinfo", true);
|
|
77 | 77 |
httpRequest.send(null); |
78 | 78 |
} |
Also available in: Unified diff
-use jsp rather than html files so hat the server context can be looked up on the fly (as well as additional options from the MetacatUtil class).
-incorporate the use of relative paths in the XML configuration (doctype=>stylesheet mapping)
Note: still using ant tokens in the .cfg file used for perl...not sure how to convert that.