login.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 Civetweb project,
  5. http://code.google.com/p/civetweb -->
  6. <head>
  7. <title>Civetweb 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>Civetweb chat server login</h2>
  30. <div style="max-width: 30em;">
  31. Username and password can be any non-empty strings.
  32. </div>
  33. <br/>
  34. <form>
  35. <input type="text" name="user"></input><br/>
  36. <input type="text" name="password"></input><br/>
  37. <input type="submit" value="Login"></input>
  38. </form>
  39. </center>
  40. </body>
  41. </html>