forgot_pwd.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. #忘记
  3. require_once '../path.php';
  4. require_once "../public/load_lang.php";
  5. require_once "../public/function.php";
  6. ?>
  7. <!DOCTYPE html>
  8. <html>
  9. <head>
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <link type="text/css" rel="stylesheet" href="../studio/css/font.css"/>
  13. <link type="text/css" rel="stylesheet" href="../studio/css/style.css"/>
  14. <link type="text/css" rel="stylesheet" href="../studio/css/color_day.css" id="colorchange" />
  15. <title>wikipali reset password</title>
  16. <script src="../public/js/comm.js"></script>
  17. <script src="../studio/js/jquery-3.3.1.min.js"></script>
  18. <script src="../studio/js/fixedsticky.js"></script>
  19. <style>
  20. #login_body{
  21. display: flex;
  22. padding: 2em;
  23. margin: auto;
  24. }
  25. #login_left {
  26. padding-right: 12em;
  27. padding-top: 5em;
  28. }
  29. .title{
  30. font-size: 150%;
  31. margin-top: 1em;
  32. margin-bottom: 0.5em;
  33. }
  34. #login_form{
  35. padding: 2em 0 1em 0;
  36. }
  37. #tool_bar {
  38. padding: 1em;
  39. display: flex;
  40. justify-content: space-between;
  41. }
  42. #login_shortcut {
  43. display: flex;
  44. flex-direction: column;
  45. padding: 2em 0;
  46. }
  47. #login_shortcut button{
  48. height:3em;
  49. }
  50. #button_area{
  51. text-align: right;
  52. padding: 1em 0;
  53. }
  54. .form_help{
  55. font-weight: 400;
  56. color: var(--bookx);
  57. }
  58. .login_form input{
  59. margin-top:2em;
  60. padding:0.5em 0.5em;
  61. }
  62. .login_form select{
  63. margin-top:2em;
  64. padding:0.5em 0.5em;
  65. }
  66. .login_form input[type="submit"]{
  67. margin-top:2em;
  68. padding:0.1em 0.5em;
  69. }
  70. .form_error{
  71. color:var(--error-text);
  72. }
  73. #login_form_div{
  74. width:30em;
  75. }
  76. #ucenter_body {
  77. display: flex;
  78. flex-direction: column;
  79. margin: 0;
  80. padding: 0;
  81. background-color: var(--tool-bg-color3);
  82. color: var(--btn-color);
  83. }
  84. .icon_big {
  85. height: 2em;
  86. width: 2em;
  87. fill: var(--btn-color);
  88. transition: all 0.2s ease;
  89. }
  90. .form_field_name{
  91. position: absolute;
  92. margin-left: 7px;
  93. margin-top: 2em;
  94. color: var(--btn-border-line-color);
  95. -webkit-transition-duration: 0.4s;
  96. -moz-transition-duration: 0.4s;
  97. transition-duration: 0.4s;
  98. transform: translateY(0.5em);
  99. }
  100. .viewswitch_on {
  101. position: absolute;
  102. margin-left: 7px;
  103. margin-top: 1.5em;
  104. color: var(--bookx);
  105. -webkit-transition-duration: 0.4s;
  106. -moz-transition-duration: 0.4s;
  107. transition-duration: 0.4s;
  108. transform: translateY(-15px);
  109. }
  110. </style>
  111. <script>
  112. function login_init(){
  113. $("input").focus(function(){
  114. let name = $(this).attr("name");
  115. var objNave = document.getElementById("tip_"+name);
  116. objNave.className = "viewswitch_on";
  117. });
  118. $(".form_field_name").click(function(){
  119. let id = $(this).attr("id");
  120. var objNave = document.getElementById(id);
  121. objNave.className = "viewswitch_on";
  122. let arrId=id.split("_");
  123. document.getElementById('input_'+arrId[1]).focus();
  124. });
  125. }
  126. </script>
  127. <link type="text/css" rel="stylesheet" href="mobile.css" media="screen and (max-width:800px)">
  128. </head>
  129. <body id="ucenter_body" onload="login_init()">
  130. <div id="tool_bar">
  131. <div>
  132. </div>
  133. <div>
  134. <?php
  135. require_once '../lang/lang.php';
  136. ?>
  137. </div>
  138. </div>
  139. <div id="login_body" >
  140. <div id="login_left">
  141. <div >
  142. <svg style="height: 8em;width: 25em;">
  143. <use xlink:href="../public/images/svg/wikipali_login_page.svg#logo_login"></use>
  144. </svg>
  145. </div>
  146. <div style=" padding: 1em 0 0 3.5em;font-weight: 400;">
  147. <?php echo $_local->gui->pali_literature_platform; ?>
  148. <ul style="padding-left: 1.2em;">
  149. <li><?php echo $_local->gui->online_dict_db; ?></li>
  150. <li><?php echo $_local->gui->user_data_share; ?></li>
  151. <li><?php echo $_local->gui->cooperate_edit; ?></li>
  152. </ul>
  153. </div>
  154. </div>
  155. <div id="login_right">
  156. <div id = "login_form_div" class="fun_block" >
  157. <div class="title">
  158. 忘记密码?
  159. </div>
  160. <div class="login_new">
  161. <span class="form_help"><?php echo $_local->gui->have_account; ?> ?</span><a href="index.php?language=<?php echo $currLanguage; ?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $_local->gui->login; //登入账户 ?></a>
  162. </div>
  163. <div class="login_form" style=" padding: 3em 0 3em 0;">
  164. <div id="message" class="form_help">
  165. 我们将向您的注册邮箱发送电子邮件。里面包含了重置密码链接。点击链接后按照提示操作,重置账户密码。
  166. </div>
  167. <div id="form_div">
  168. <form action="../api/user.php" method="get">
  169. <div>
  170. <div>
  171. <span id='tip_email' class='form_field_name'><?php echo $_local->gui->email_address; ?></span>
  172. <input id="form_email" type="input" name="email" value="" />
  173. </div>
  174. <div id="error_email" class="form_error"> </div>
  175. <div class="form_help"></div>
  176. </div>
  177. <input type="hidden" name="_method" value="reset_email" />
  178. </form>
  179. <div id="button_area">
  180. <button id="send" onclick="submit()" style="background-color: var(--link-hover-color);border-color: var(--link-hover-color);" >
  181. <?php echo $_local->gui->continue; ?>
  182. </button>
  183. </div>
  184. </div>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <script>
  190. login_init();
  191. function submit(){
  192. $("#message").text("正在发送...");
  193. $(this).text("正在发送...");
  194. $(this).prop("disabled",true);
  195. $.getJSON(
  196. "../api/user.php",
  197. {
  198. _method:"reset_email",
  199. email:$("#form_email").val()
  200. }
  201. ).done(function (data) {
  202. $("#message").text(data.message);
  203. if(data.ok){
  204. $("#message").removeClass("form_error");
  205. $("#form_div").hide();
  206. }else{
  207. $("#message").addClass("form_error");
  208. //发送失败enable发送按钮
  209. $(this).prop("disabled",false);
  210. $(this).text("再次发送");
  211. }
  212. }).fail(function(jqXHR, textStatus, errorThrown){
  213. $("#message").addClass("form_error");
  214. switch (textStatus) {
  215. case "timeout":
  216. $("#message").text(gLocal.gui["error_net_timeout"]);
  217. //发送失败enable发送按钮
  218. $(this).prop("disabled",false);
  219. $(this).text("再次发送");
  220. break;
  221. case "error":
  222. $("#message").text(gLocal.gui["error_net_"+jqXHR.status]);
  223. switch (jqXHR.status) {
  224. case 404:
  225. break;
  226. case 500:
  227. break;
  228. default:
  229. break;
  230. }
  231. break;
  232. case "abort":
  233. $("#message").text(gLocal.gui["error_net_abort"]);
  234. break;
  235. case "parsererror":
  236. $("#message").text(gLocal.gui["error_net_parsererror"]);
  237. console.log("delete-parsererror",jqXHR.responseText);
  238. break;
  239. default:
  240. break;
  241. }
  242. });
  243. }
  244. </script>
  245. </body>
  246. </html>