resetCodeTemplate.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  6. <title>ArozOS - Reset Password</title>
  7. <link rel="stylesheet" href="script/semantic/semantic.css">
  8. <link rel="stylesheet" href="script/ao.css">
  9. <script type="application/javascript" src="script/jquery.min.js"></script>
  10. <script type="application/javascript" src="script/semantic/semantic.js"></script>
  11. <style>
  12. </style>
  13. </head>
  14. <body>
  15. <br><br><br>
  16. <div class="ui container" align="center">
  17. <div class="ui basic segment" style="max-width:400px;" align="left">
  18. <div class="imageRight" align="center">
  19. <img class="ui small image" src="data:image/png;base64, {{vendor_logo}}"></img>
  20. </div>
  21. <div class="ui divider"></div>
  22. <div class="ui text container">
  23. <p>Reset your account password on {{host_name}}</p>
  24. </div>
  25. <div class="ui divider"></div>
  26. <form class="ui form" onsubmit="handleFormSubmit(event, this);">
  27. <div class="field">
  28. <label>Username</label>
  29. <input type="text" name="username" placeholder="Username">
  30. </div>
  31. <div class="field">
  32. <label>Password Reset Key</label>
  33. <input type="text" name="resetkey" placeholder="Password Reset Key">
  34. <small>Please seek for administrator assistant to obtain a Password Reset Key</small>
  35. </div>
  36. <button id="submitbtn" class="ui blue button" type="submit">Continue</button>
  37. </form>
  38. <div id="errmsg" class="ui red inverted segment" style="display:none;">
  39. <i class="remove icon"></i> <span id="errtext">Internal Server Error</span>
  40. </div>
  41. <div class="ui divider"></div>
  42. <p>Back to <a href="../index.html">Login</a></p>
  43. </div>
  44. </div>
  45. <script>
  46. function handleFormSubmit(event, object){
  47. event.preventDefault();
  48. var username = object.username.value;
  49. var rkey = object.resetkey.value;
  50. $.ajax({
  51. url: "system/reset/validateResetKey",
  52. data: {username: username, rkey: rkey},
  53. method: "POST",
  54. success: function(data){
  55. if (data.error !== undefined){
  56. $("#errtext").text(data.error);
  57. $("#errmsg").show();
  58. }else{
  59. //OK
  60. $("#errmsg").hide();
  61. //Put the key and username to get paramters
  62. window.location.href = location.protocol + '//' + location.host + location.pathname + "?acc=" + encodeURIComponent(username) + "&rkey=" + rkey
  63. }
  64. }
  65. });
  66. }
  67. </script>
  68. </body>
  69. </html>