authentication.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. session_start();
  3. $http_host = $_SERVER["HTTP_HOST"];
  4. $doc_root = $_SERVER["DOCUMENT_ROOT"] . "/";
  5. include $doc_root . "functions.php";
  6. $proto = get_protocol();
  7. $con = start_db();
  8. $server = $proto . $http_host;
  9. $pserver = substr($server, 0, strpos($http_host, ':')); // public server
  10. if (check_session($con)){
  11. header("Location: /");
  12. exit(-1);
  13. }
  14. else{
  15. ?>
  16. <!DOCTYPE html>
  17. <html>
  18. <head>
  19. <meta content="text/html; charset=windows-1252" http-equiv="content-type"/>
  20. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  21. <link rel='shortcut icon' href='<?=$pserver?>/img/logo/x2/favicon.ico'/>
  22. <title>Administration</title>
  23. <style>
  24. <?php
  25. include $doc_root . "css/ui.css";
  26. include $doc_root . "css/home.css";
  27. ?>
  28. </style>
  29. <!-- CSS for mobile version -->
  30. <style media='(max-width : 990px)'>
  31. <?php
  32. include $doc_root . "css/m/ui.css";
  33. include $doc_root . "css/m/home.css";
  34. ?>
  35. </style>
  36. <!-- Script files -->
  37. <script type='text/javascript'>
  38. <?php
  39. include $doc_root . "script/ui.js";
  40. ?>
  41. </script>
  42. </head>
  43. <body>
  44. <div class='section' id='authentication'>
  45. <h3 class='section_title'>Log In</h3>
  46. <div class='entry'>
  47. <form method='post' action='/login.php'>
  48. <table>
  49. <tr>
  50. <td>User:</td>
  51. <td><input name="user" type="text"/></td>
  52. </tr>
  53. <tr>
  54. <td>Password:</td>
  55. <td><input name="pass" type="password"/></td>
  56. </tr>
  57. <tr>
  58. <td></td><td><input type="submit" value="Entrar"/></td>
  59. </tr>
  60. </table>
  61. </form>
  62. </div>
  63. </div>
  64. </body>
  65. </html>
  66. <?php
  67. }
  68. ?>