cms.login.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. <title>CSE Invent : Identification</title>
  5. <?php pwa::printManifeste(); ?>
  6. <meta name="mobile-web-app-capable" content="yes">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="application-name" content="CSE Invent : CMS">
  9. <meta name="apple-mobile-web-app-title" content="CSE Invent : CMS">
  10. <meta name="msapplication-starturl" content="/">
  11. <meta name="msapplication-TileColor" content="#da532c">
  12. <meta name="theme-color" content="#ffffff">
  13. <link rel="icon" type="image/x-icon" href="favicon.ico">
  14. <script src="libs/js/jquery.min.js"></script>
  15. <script src="libs/bootstrap/js/bootstrap.min.js"></script>
  16. <link rel="stylesheet" href="libs/bootstrap/assets/dist/css/bootstrap.min.css">
  17. <link rel="stylesheet" href="css/login.css">
  18. </head>
  19. <body>
  20. <div class="wrapper fadeInDown">
  21. <div id="formContent">
  22. <div class="fadeIn first">
  23. <img src="img/logo.png" id="icon" alt="CSE Invent" />
  24. </div>
  25. <form method="post" action="/submit.php" id="form-authent">
  26. <input type="hidden" name="from" value="login">
  27. <input type="text" class="fadeIn second" name="email" id="email" placeholder="email" required>
  28. <input type="password" class="fadeIn third" name="password" placeholder="mot de passe" required>
  29. <input type="text" class="third" style="display:none;" name="authenticator" id="authenticator" maxlength="6" placeholder="Code Google Authenticator">
  30. <input type="button" class="fadeIn fourth" id="submit-authent" value="Se connecter">
  31. </form>
  32. <div id="formFooter"<?php if(!alert::ifError()) { echo ' style="display:none"'; } ?>>
  33. <div class="alert alert-danger" role="alert"><?php if(alert::ifError()) { echo alert::printAlert(alert::getError()); } ?></div>
  34. </div>
  35. <script>
  36. $("#submit-authent").on("click", function() {
  37. var formData = {
  38. email: $("#email").val(),
  39. from: "authenticator",
  40. };
  41. $.ajax({
  42. type: "POST",
  43. url: "submit.php",
  44. data: formData,
  45. dataType: "json",
  46. encode: true,
  47. }).done(function (data) {
  48. if(data == 1){
  49. $("#authenticator").show();
  50. $("#authenticator").prop("required", true);
  51. $('#submit-authent').attr('type', 'submit');
  52. } else {
  53. $("#form-authent").submit();
  54. }
  55. }).fail(function () {
  56. console.log(data);
  57. });
  58. });
  59. </script>
  60. </div>
  61. </div>
  62. <?php pwa::printServiceWorker(); ?>
  63. </body>
  64. </html>
  65. <?php
  66. alert::destroyAlert();
  67. ?>