summaryrefslogtreecommitdiff
path: root/UI/login.js
blob: cf261624ada2784177684803389fe0718ce7e9f2 (plain)
  1. // Note: we do not heed to try other interfaces since we don't support IE 6 or
  2. // lower. If we need to support other interfaces later, we can add them.
  3. // --CT
  4. function get_http_request_object(){
  5. if (typeof XMLHttpRequest == undefined){
  6. return false;
  7. } else {
  8. return new XMLHttpRequest();
  9. }
  10. }
  11. function submit_form() {
  12. var http = get_http_request_object();
  13. var username = document.login.login.value;
  14. var password = document.login.password.value;
  15. http.open("get", 'login.pl?action=authenticate', false,
  16. username, password);
  17. http.send("");
  18. alert(http.status);
  19. if (http.status != 200){
  20. alert("Access Denied: Bad username/Password");
  21. return false;
  22. }
  23. document.location = document.login.action + "?action=login&company="+
  24. documnet.login.company.value;
  25. }