-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy-portal.js
51 lines (43 loc) · 1.39 KB
/
my-portal.js
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
// Copyright (c) 2003-2009 Untangle, Inc.
// All rights reserved.
function customAuthenticate()
{
var req = false;
var e = document.getElementById("accept-agreement");
if (e) {
e.disabled = true;
}
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
if (req.overrideMimeType) {
req.overrideMimeType("text/xml");
}
} else if (window.ActiveXObject) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (exn) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (exn) {}
}
}
req.onreadystatechange = function()
{
if (req.readyState == 4) {
if ( req.responseText.indexOf( "<success/>" ) >= 0 ) {
alert( "You have been authenticated." );
window.location.href = "http://www.untangle.com";
return;
}
var e = document.getElementById("accept-agreement");
if (e) {
e.disabled = false;
}
alert( "Unable to authenticate you, please try again." );
}
};
alert( "boom" );
req.open("POST", "authenticate.php", true);
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send("username=" + escape( "test" ) + "&password=" + escape( "test" ));
};