login.html 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" dir="ltr">
  4. <!-- This file is part of the Mongoose project,
  5. http://code.google.com/p/mongoose -->
  6. <head>
  7. <title>Mongoose chat: login</title>
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  9. <!--
  10. Note that this page is self-sufficient, it does not load any other
  11. CSS or Javascript file. This is done so because only this page is
  12. allowed for non-authorized users. If we want to load other files
  13. from the frontend, we need to change backend code to allow those
  14. for non-authorized users. See chat.c :: must_authorize() function.
  15. -->
  16. </head>
  17. <script>
  18. window.onload = function() {
  19. // Set correct action for the login form. We assume that the SSL port
  20. // is the next one to insecure one.
  21. var httpsPort = location.protocol.match(/https/) ? location.port :
  22. parseInt(location.port) + 1;
  23. document.forms[0].action = 'https://' + location.hostname + ':' +
  24. httpsPort + '/authorize';
  25. };
  26. </script>
  27. <body>
  28. <center>
  29. <h2>Mongoose chat server login</h2>
  30. <div style="max-width: 30em;">
  31. Username can be any string that consists of English letters only.
  32. The password must be the same as username. Example:
  33. username "joe", password "joe". Or, username "Bob", password "Bob".
  34. </div>
  35. <br/>
  36. <form>
  37. <input type="text" name="user"></input><br/>
  38. <input type="text" name="password"></input><br/>
  39. <input type="submit" value="Login"></input>
  40. </form>
  41. </center>
  42. </body>
  43. </html>