Reminder.template.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <?php
  2. /**
  3. * Simple Machines Forum (SMF)
  4. *
  5. * @package SMF
  6. * @author Simple Machines http://www.simplemachines.org
  7. * @copyright 2014 Simple Machines and individual contributors
  8. * @license http://www.simplemachines.org/about/smf/license.php BSD
  9. *
  10. * @version 2.1 Alpha 1
  11. */
  12. function template_main()
  13. {
  14. global $context, $txt, $scripturl;
  15. echo '
  16. <br>
  17. <form action="', $scripturl, '?action=reminder;sa=picktype" method="post" accept-charset="', $context['character_set'], '">
  18. <div class="tborder login">
  19. <div class="cat_bar">
  20. <h3 class="catbg">', $txt['authentication_reminder'], '</h3>
  21. </div>
  22. <div class="roundframe">
  23. <p class="smalltext centertext">', $txt['password_reminder_desc'], '</p>
  24. <dl>
  25. <dt>', $txt['user_email'], ':</dt>
  26. <dd><input type="text" name="user" size="30" class="input_text"></dd>
  27. </dl>
  28. <input type="submit" value="', $txt['reminder_continue'], '" class="button_submit">
  29. <br class="clear">
  30. </div>
  31. </div>
  32. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  33. <input type="hidden" name="', $context['remind_token_var'], '" value="', $context['remind_token'], '">
  34. </form>';
  35. }
  36. function template_reminder_pick()
  37. {
  38. global $context, $txt, $scripturl;
  39. echo '
  40. <br>
  41. <form action="', $scripturl, '?action=reminder;sa=picktype" method="post" accept-charset="', $context['character_set'], '">
  42. <div class="tborder login">
  43. <div class="cat_bar">
  44. <h3 class="catbg">', $txt['authentication_reminder'], '</h3>
  45. </div>
  46. <div class="roundframe">
  47. <p><strong>', $txt['authentication_options'], ':</strong></p>
  48. <p>
  49. <input type="radio" name="reminder_type" id="reminder_type_email" value="email" checked class="input_radio"></dt>
  50. <label for="reminder_type_email">', $txt['authentication_' . $context['account_type'] . '_email'], '</label></dd>
  51. </p>
  52. <p>
  53. <input type="radio" name="reminder_type" id="reminder_type_secret" value="secret" class="input_radio">
  54. <label for="reminder_type_secret">', $txt['authentication_' . $context['account_type'] . '_secret'], '</label>
  55. </p>
  56. <div class="flow_auto">
  57. <input type="submit" value="', $txt['reminder_continue'], '" class="button_submit">
  58. <input type="hidden" name="uid" value="', $context['current_member']['id'], '">
  59. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  60. <input type="hidden" name="', $context['remind_token_var'], '" value="', $context['remind_token'], '">
  61. </div>
  62. </div>
  63. </div>
  64. </form>';
  65. }
  66. function template_sent()
  67. {
  68. global $context;
  69. echo '
  70. <br>
  71. <div class="tborder login" id="reminder_sent">
  72. <div class="cat_bar">
  73. <h3 class="catbg">' . $context['page_title'] . '</h3>
  74. </div>
  75. <p class="information">' . $context['description'] . '</p>
  76. </div>';
  77. }
  78. function template_set_password()
  79. {
  80. global $context, $settings, $txt, $scripturl, $modSettings;
  81. echo '
  82. <br>
  83. <form action="', $scripturl, '?action=reminder;sa=setpassword2" name="reminder_form" id="reminder_form" method="post" accept-charset="', $context['character_set'], '">
  84. <div class="tborder login">
  85. <div class="cat_bar">
  86. <h3 class="catbg">', $context['page_title'], '</h3>
  87. </div>
  88. <div class="roundframe">
  89. <dl>
  90. <dt>', $txt['choose_pass'], ': </dt>
  91. <dd>
  92. <input type="password" name="passwrd1" id="smf_autov_pwmain" size="22" class="input_password">
  93. <span id="smf_autov_pwmain_div" style="display: none;">
  94. <span id="smf_autov_pwmain_img" class="field_icons invalid"></span>
  95. </span>
  96. </dd>
  97. <dt>', $txt['verify_pass'], ': </dt>
  98. <dd>
  99. <input type="password" name="passwrd2" id="smf_autov_pwverify" size="22" class="input_password">
  100. <span id="smf_autov_pwverify_div" style="display: none;">
  101. <span id="smf_autov_pwverify_img" class="field_icons invalid"></span>
  102. </span>
  103. </dd>
  104. </dl>
  105. <p class="align_center"><input type="submit" value="', $txt['save'], '" class="button_submit"></p>
  106. </div>
  107. </div>
  108. <input type="hidden" name="code" value="', $context['code'], '">
  109. <input type="hidden" name="u" value="', $context['memID'], '">
  110. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  111. <input type="hidden" name="', $context['remind-sp_token_var'], '" value="', $context['remind-sp_token'], '">
  112. </form>
  113. <script><!-- // --><![CDATA[
  114. var regTextStrings = {
  115. "password_short": "', $txt['registration_password_short'], '",
  116. "password_reserved": "', $txt['registration_password_reserved'], '",
  117. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  118. "password_no_match": "', $txt['registration_password_no_match'], '",
  119. "password_valid": "', $txt['registration_password_valid'], '"
  120. };
  121. var verificationHandle = new smfRegister("reminder_form", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  122. // ]]></script>';
  123. }
  124. function template_ask()
  125. {
  126. global $context, $txt, $scripturl, $modSettings;
  127. echo '
  128. <br>
  129. <form action="', $scripturl, '?action=reminder;sa=secret2" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
  130. <div class="tborder login">
  131. <div class="cat_bar">
  132. <h3 class="catbg">', $txt['authentication_reminder'], '</h3>
  133. </div>
  134. <div class="roundframe">
  135. <p class="smalltext">', $context['account_type'] == 'password' ? $txt['enter_new_password'] : $txt['openid_secret_reminder'], '</p>
  136. <dl>
  137. <dt>', $txt['secret_question'], ':</dt>
  138. <dd>', $context['secret_question'], '</dd>
  139. <dt>', $txt['secret_answer'], ':</dt>
  140. <dd><input type="text" name="secret_answer" size="22" class="input_text"></dd>';
  141. if ($context['account_type'] == 'password')
  142. echo '
  143. <dt>', $txt['choose_pass'], ': </dt>
  144. <dd>
  145. <input type="password" name="passwrd1" id="smf_autov_pwmain" size="22" class="input_password">
  146. <span id="smf_autov_pwmain_div" style="display: none;">
  147. <span id="smf_autov_pwmain_img" class="field_icons invalid"></span>
  148. </span>
  149. </dd>
  150. <dt>', $txt['verify_pass'], ': </dt>
  151. <dd>
  152. <input type="password" name="passwrd2" id="smf_autov_pwverify" size="22" class="input_password">
  153. <span id="smf_autov_pwverify_div" style="display: none;">
  154. <span id="smf_autov_pwverify_img" class="field_icons valid"></span>
  155. </span>
  156. </dd>';
  157. echo '
  158. </dl>
  159. <div class="auto_flow">
  160. <input type="submit" value="', $txt['save'], '" class="button_submit">
  161. <input type="hidden" name="uid" value="', $context['remind_user'], '">
  162. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  163. <input type="hidden" name="', $context['remind-sai_token_var'], '" value="', $context['remind-sai_token'], '">
  164. </div>
  165. </div>
  166. </div>
  167. </form>';
  168. if ($context['account_type'] == 'password')
  169. echo '
  170. <script><!-- // --><![CDATA[
  171. var regTextStrings = {
  172. "password_short": "', $txt['registration_password_short'], '",
  173. "password_reserved": "', $txt['registration_password_reserved'], '",
  174. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  175. "password_no_match": "', $txt['registration_password_no_match'], '",
  176. "password_valid": "', $txt['registration_password_valid'], '"
  177. };
  178. var verificationHandle = new smfRegister("creator", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  179. // ]]></script>';
  180. }
  181. ?>