[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1713] trunk/UI/login.js



Revision: 1713
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1713&view=rev
Author:   einhverfr
Date:     2007-10-06 23:07:42 -0700 (Sat, 06 Oct 2007)

Log Message:
-----------
Adding login.js

Added Paths:
-----------
    trunk/UI/login.js

Added: trunk/UI/login.js
===================================================================
--- trunk/UI/login.js	                        (rev 0)
+++ trunk/UI/login.js	2007-10-07 06:07:42 UTC (rev 1713)
@@ -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;
+}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.