summaryrefslogtreecommitdiff
path: root/UI/login.js
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-07 06:07:42 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-07 06:07:42 +0000
commit10797430c4c1f51dd6dc0b63207c8e0c1383ae37 (patch)
treeadfa38bff12a1ec657e6d9ea9c77995b13ade3b1 /UI/login.js
parent2c60683b106fad0c3410ba30d669679955508958 (diff)
Adding login.js
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1713 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'UI/login.js')
-rw-r--r--UI/login.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/UI/login.js b/UI/login.js
new file mode 100644
index 00000000..cf261624
--- /dev/null
+++ b/UI/login.js
@@ -0,0 +1,26 @@
+// Note: we do not heed to try other interfaces since we don't support IE 6 or
+// lower. If we need to support other interfaces later, we can add them.
+// --CT
+function get_http_request_object(){
+ if (typeof XMLHttpRequest == undefined){
+ return false;
+ } else {
+ return new XMLHttpRequest();
+ }
+}
+
+function submit_form() {
+ var http = get_http_request_object();
+ var username = document.login.login.value;
+ var password = document.login.password.value;
+ http.open("get", 'login.pl?action=authenticate', false,
+ username, password);
+ http.send("");
+ alert(http.status);
+ if (http.status != 200){
+ alert("Access Denied: Bad username/Password");
+ return false;
+ }
+ document.location = document.login.action + "?action=login&company="+
+ documnet.login.company.value;
+}