-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
50 lines (45 loc) · 2.08 KB
/
login.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>EpiCollect Server - Login</title>
<script type="text/javascript" src="/static/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/static/jquery-ui-1.7.2.min.js"></script>
<script>
function getRequestParameter ( parameterName ) {
var queryString = window.location.search.substring(1);
var parameterName = parameterName + "=";
if ( queryString.length > 0 ) {
begin = queryString.indexOf ( parameterName );
if ( begin != -1 ) {
begin += parameterName.length;
end = queryString.indexOf ( "&" , begin );
if ( end == -1 ) {
end = queryString.length
}
return unescape ( queryString.substring ( begin, end ) );
}
}
return "";
}
$(function() {
var firstTime=getRequestParameter("firstTime");
if (firstTime!="true") {
alert("Infinite redirection detected, bailing out.");
window.top.location="/";
}
else {
var projectKey = getRequestParameter("projectKey");
var projectName = getRequestParameter("projectName");
var timeMillis = new Date().getTime();
var ticket = ""+timeMillis+timeMillis*Math.random();
var iframeText='<iframe id="frame" style="width:100%;height:100%;border:0px;" src="/ecLogin?destination='+ getRequestParameter("destination")+'&ticket='+ticket+'&projectKey='+projectKey+'&projectName='+projectName+'></iframe>';
$("#myframe").append(iframeText);
}
});
</script>
</head>
<body style="position:absolute;top:0;left:0;right:0;bottom:0;">
<div id="myframe" style="height:100%;width:100%;"></div>
</body>
</html>