summaryrefslogtreecommitdiff
path: root/UI/login.js
blob: fd421e263845c5b3c4defc820b10ec28c794f181 (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. }