summaryrefslogtreecommitdiff
path: root/UI/login.js
blob: 5f5eed637e567e47e6387d8ab9387607986681d3 (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&company='
  16. + document.login.company.value, false,
  17. username, password);
  18. http.send("");
  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. }
  26. function check_auth() {
  27. var http = get_http_request_object();
  28. var username = "admin";
  29. var password = document.login.password.value;
  30. http.open("get", "login.pl?action=authenticate&company="
  31. + document.login.company.value, false,
  32. username, password
  33. );
  34. }