summaryrefslogtreecommitdiff
path: root/UI/login.js
blob: aa2af97c737887d2d59544a643590f77e705ff59 (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. alert(http.status);
  20. if (http.status != 200){
  21. alert("Access Denied: Bad username/Password");
  22. return false;
  23. }
  24. document.location = document.login.action + "?action=login&company="+
  25. documnet.login.company.value;
  26. }
  27. function check_auth() {
  28. var http = get_http_request_object();
  29. var username = "admin";
  30. var password = document.login.password.value;
  31. http.open("get", "login.pl?action=authenticate&company="
  32. + document.login.company.value, false,
  33. username, password
  34. );
  35. }