summaryrefslogtreecommitdiff
path: root/login.html
blob: 627308eef13ac43768b95c1ddfe4b78903127533 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
	<head>
		<title>Ostsee - Verborgene Fracht - Login</title>
	</head>
	<style type="text/css">
		html,body
		{
			width:100%;
			height:100%;
			margin:0px;
			padding:0px;
			overflow:hidden;
		}

		body
		{
			position:absolute;
			background:#474747;
			vertical-align:middle;
		}

		form.login
		{
			position:relative;
			top:50%;
			display:block;
			margin:auto auto;
			width:12em;
			text-align:right;
			font-family:Arial, Helvetica Neue, Helvetica, sans-serif;
			font-weight:bold;
			transform: translateY(-50%);
		}

		form.login label
		{
			color:#fff;
			text-align:center;
			font-size:x-small;
			text-transform:uppercase;
			display:block;
			font-weight:normal;
			line-height:1.75em;
		}

		form.login :active,
		form.login :focus
		{
			outline:0px;
		}

		form.login input
		{
			border:4px solid #fff;
			border-radius:6px;
			background:#fff;
			width:100%;
			margin:0px;
			font-size:inherit;
			text-align:center;
		}

		form.login button
		{
			clear:both;
			display:block;
			float:right;
			background:#fff;
			border:0px;
			position:relative;
			top:-1em;
			margin-top:-5px;
			font-size:inherit;
			background:transparent;
			color:#474747;
			text-align:right;
		}
	</style>
<body onload="document.getElementById('password').focus()">
	<form action="/" class="login">
		<input type="hidden" name="username" id="username" value="login" />
		<label>Passwort <?php echo $_SERVER['PHP_AUTH_USER'].$_SERVER['REMOTE_USER'] ?><br/>
			<input type="password" id="password" /></label>
		<button type="submit" />&gt;</button>
		<br style="clear:both" />
	</form>
</body>
</html>

<script type="text/javascript">
//~ ajax-main-functions --------------------------------------------- ~
function createHTTPObject()
{
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5) try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
  try {
  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E){
  xmlhttp = false;
  }
  } @else xmlhttp = false; @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
    {
      try { xmlhttp = new XMLHttpRequest(); }
      catch (e) { xmlhttp = false; }
    }
    return xmlhttp;
}

function formSubmit(e)
{
	var form     = e.target;
	var username = document.getElementById("username");
	var password = document.getElementById("password");
	var http     = createHTTPObject();
  /* console.log("username: " + username.value + " password: " + password.value); */
	http.open("get", "index.html", false, username.value, password.value);
	http.send("");
	if (http.status == 200) /* content got delivered, we are clear to pass (password was right) */
	{ window.location = "http://ostsee.halbtotal.de/index.html"; return false; }
	else if (http.status == 401) /* 401=authorization required when password was wrong */
	{ password.value = ''; return false; }
	else /* other errors lead to the default login page */
	{ return false; }
}

for(var i in document.forms)
{ document.forms[i].onsubmit=formSubmit; }
</script>
<!-- vim: set ts=2 sw=2 :smartindent -->

..