forgot_pwd.php 6.5 KB

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