diff options
author | MW | 2007-03-26 16:51:50 +0000 |
---|---|---|
committer | MW | 2007-03-26 16:51:50 +0000 |
commit | 42ba0712765b93f652a8671269e39ca647b8d05e (patch) | |
tree | d76c780eb4ec1aff0b5485e19f9b3e49bf6b938c /bin/testadmin.htm | |
parent | * Added Prebuild exe (just delete the old one) (diff) | |
download | opensim-SC_OLD-42ba0712765b93f652a8671269e39ca647b8d05e.zip opensim-SC_OLD-42ba0712765b93f652a8671269e39ca647b8d05e.tar.gz opensim-SC_OLD-42ba0712765b93f652a8671269e39ca647b8d05e.tar.bz2 opensim-SC_OLD-42ba0712765b93f652a8671269e39ca647b8d05e.tar.xz |
Added a very very very basic Web front end for admin use - ready to be used in sandbox mode for adding new accounts.
Diffstat (limited to 'bin/testadmin.htm')
-rw-r--r-- | bin/testadmin.htm | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/bin/testadmin.htm b/bin/testadmin.htm new file mode 100644 index 0000000..4252ffd --- /dev/null +++ b/bin/testadmin.htm | |||
@@ -0,0 +1,124 @@ | |||
1 | <html> | ||
2 | <head> | ||
3 | <script type="text/javascript"> | ||
4 | var http_request | ||
5 | var adminpadd | ||
6 | function loadXMLDoc(url) | ||
7 | { | ||
8 | http_request=null | ||
9 | // code for Mozilla, etc. | ||
10 | if (window.XMLHttpRequest) | ||
11 | { | ||
12 | http_request=new XMLHttpRequest() | ||
13 | } | ||
14 | // code for IE | ||
15 | else if (window.ActiveXObject) | ||
16 | { | ||
17 | http_request=new ActiveXObject("Microsoft.XMLHTTP") | ||
18 | } | ||
19 | if (http_request!=null) | ||
20 | { | ||
21 | http_request.onreadystatechange=state_Change | ||
22 | http_request.open("GET",url,true) | ||
23 | http_request.send(null) | ||
24 | } | ||
25 | else | ||
26 | { | ||
27 | alert("Your browser does not support XMLHTTP.") | ||
28 | } | ||
29 | } | ||
30 | |||
31 | function state_Change() | ||
32 | { | ||
33 | // if xmlhttp shows "loaded" | ||
34 | if (http_request.readyState==4) | ||
35 | { | ||
36 | // if "OK" | ||
37 | if (http_request.status==200) | ||
38 | { | ||
39 | document.getElementById('T1').innerHTML=http_request.responseText | ||
40 | } | ||
41 | else | ||
42 | { | ||
43 | alert("Problem retrieving data:" + http_request.statusText) | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | |||
48 | |||
49 | //var http_request = false; | ||
50 | function makePOSTRequest(url, parameters) { | ||
51 | http_request = false; | ||
52 | if (window.XMLHttpRequest) { // Mozilla, Safari,... | ||
53 | http_request = new XMLHttpRequest(); | ||
54 | if (http_request.overrideMimeType) { | ||
55 | // set type accordingly to anticipated content type | ||
56 | //http_request.overrideMimeType('text/xml'); | ||
57 | http_request.overrideMimeType('text/html'); | ||
58 | } | ||
59 | } else if (window.ActiveXObject) { // IE | ||
60 | try { | ||
61 | http_request = new ActiveXObject("Msxml2.XMLHTTP"); | ||
62 | } catch (e) { | ||
63 | try { | ||
64 | http_request = new ActiveXObject("Microsoft.XMLHTTP"); | ||
65 | } catch (e) {} | ||
66 | } | ||
67 | } | ||
68 | if (!http_request) { | ||
69 | alert('Cannot create XMLHTTP instance'); | ||
70 | return false; | ||
71 | } | ||
72 | |||
73 | http_request.onreadystatechange =state_Change | ||
74 | http_request.open('POST', url, true); | ||
75 | http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | ||
76 | http_request.setRequestHeader("Content-length", parameters.length); | ||
77 | http_request.setRequestHeader("Connection", "close"); | ||
78 | http_request.send(parameters); | ||
79 | } | ||
80 | |||
81 | function alertContents() { | ||
82 | if (http_request.readyState == 4) { | ||
83 | if (http_request.status == 200) { | ||
84 | //alert(http_request.responseText); | ||
85 | result = http_request.responseText; | ||
86 | document.getElementById('T1').innerHTML = result; | ||
87 | } else { | ||
88 | alert('There was a problem with the request.'); | ||
89 | } | ||
90 | } | ||
91 | } | ||
92 | |||
93 | |||
94 | function get(obj) { | ||
95 | var poststr = "FirstName=" + encodeURI( document.getElementById("FirstName").value ) + | ||
96 | "&LastName=" + encodeURI( document.getElementById("LastName").value ) | ||
97 | + "&PassWord=" + encodeURI( document.getElementById("PassWord").value ) | ||
98 | + "&AdminPass=" + adminpass; | ||
99 | makePOSTRequest('Admin/NewAccount', poststr); | ||
100 | } | ||
101 | |||
102 | function setpass(obj) | ||
103 | { | ||
104 | adminpass = encodeURI( document.getElementById("Adminpss").value ); | ||
105 | makePOSTRequest('Admin/Login', adminpass); | ||
106 | |||
107 | } | ||
108 | |||
109 | </script> | ||
110 | </head> | ||
111 | |||
112 | <body onload="loadXMLDoc('Admin/Welcome')"> | ||
113 | <div id="T1" style="border:1px solid black;height:500;width:600"> | ||
114 | <br> | ||
115 | </div><br /> | ||
116 | <button onclick="loadXMLDoc('Admin/Clients')">Clients</button> | ||
117 | <button onclick="loadXMLDoc('Admin/Accounts')">Accounts</button> | ||
118 | |||
119 | </body> | ||
120 | |||
121 | </html> | ||
122 | |||
123 | |||
124 | |||