Register.template.php 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731
  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. /**
  13. * Before showing users a registration form, show them the registration agreement.
  14. */
  15. function template_registration_agreement()
  16. {
  17. global $context, $scripturl, $txt, $modSettings;
  18. echo '
  19. <form action="', $scripturl, '?action=register" method="post" accept-charset="', $context['character_set'], '" id="registration">
  20. <div class="cat_bar">
  21. <h3 class="catbg">', $txt['registration_agreement'], '</h3>
  22. </div>
  23. <div class="roundframe">
  24. <p>', $context['agreement'], '</p>
  25. </div>
  26. <div id="confirm_buttons">';
  27. // Age restriction in effect?
  28. if ($context['show_coppa'])
  29. echo '
  30. <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br>
  31. <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">';
  32. else
  33. echo '
  34. <input type="submit" name="accept_agreement" value="', $txt['agreement_agree'], '" class="button_submit">';
  35. echo '
  36. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  37. <input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '">
  38. </div>
  39. <input type="hidden" name="step" value="1">
  40. </form>';
  41. }
  42. // Before registering - get their information.
  43. function template_registration_form()
  44. {
  45. global $context, $settings, $scripturl, $txt, $modSettings;
  46. echo '
  47. <script><!-- // --><![CDATA[
  48. function verifyAgree()
  49. {
  50. if (currentAuthMethod == \'passwd\' && document.forms.registration.smf_autov_pwmain.value != document.forms.registration.smf_autov_pwverify.value)
  51. {
  52. alert("', $txt['register_passwords_differ_js'], '");
  53. return false;
  54. }
  55. return true;
  56. }
  57. var currentAuthMethod = \'passwd\';
  58. // ]]></script>';
  59. // Any errors?
  60. if (!empty($context['registration_errors']))
  61. {
  62. echo '
  63. <div class="errorbox">
  64. <span>', $txt['registration_errors_occurred'], '</span>
  65. <ul class="reset">';
  66. // Cycle through each error and display an error message.
  67. foreach ($context['registration_errors'] as $error)
  68. echo '
  69. <li>', $error, '</li>';
  70. echo '
  71. </ul>
  72. </div>';
  73. }
  74. echo '
  75. <form action="', $scripturl, '?action=register2" method="post" accept-charset="', $context['character_set'], '" name="registration" id="registration" onsubmit="return verifyAgree();">
  76. <div class="cat_bar">
  77. <h3 class="catbg">', $txt['registration_form'], '</h3>
  78. </div>
  79. <div class="title_bar title_top">
  80. <h4 class="titlebg">', $txt['required_info'], '</h4>
  81. </div>
  82. <div class="windowbg2">
  83. <fieldset class="content">
  84. <dl class="register_form">
  85. <dt><strong><label for="smf_autov_username">', $txt['username'], ':</label></strong></dt>
  86. <dd>
  87. <input type="text" name="user" id="smf_autov_username" size="30" tabindex="', $context['tabindex']++, '" maxlength="25" value="', isset($context['username']) ? $context['username'] : '', '" class="input_text">
  88. <span id="smf_autov_username_div" style="display: none;">
  89. <a id="smf_autov_username_link" href="#">
  90. <span id="smf_autov_username_img" class="field_icons check"></span>
  91. </a>
  92. </span>
  93. </dd>
  94. <dt><strong><label for="smf_autov_reserve1">', $txt['user_email_address'], ':</label></strong></dt>
  95. <dd>
  96. <input type="text" name="email" id="smf_autov_reserve1" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['email']) ? $context['email'] : '', '" class="input_text">
  97. </dd>
  98. <dt><strong><label for="allow_email">', $txt['allow_user_email'], ':</label></strong></dt>
  99. <dd>
  100. <input type="checkbox" name="allow_email" id="allow_email" tabindex="', $context['tabindex']++, '" class="input_check">
  101. </dd>
  102. </dl>';
  103. // If OpenID is enabled, give the user a choice between password and OpenID.
  104. if (!empty($modSettings['enableOpenID']) && $modSettings['enableOpenID'] != 2)
  105. {
  106. echo '
  107. <dl class="register_form" id="authentication_group">
  108. <dt>
  109. <strong>', $txt['authenticate_label'], ':</strong>
  110. <a href="', $scripturl, '?action=helpadmin;help=register_openid" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a>
  111. </dt>
  112. <dd>
  113. <label for="auth_pass" id="option_auth_pass">
  114. <input type="radio" name="authenticate" value="passwd" id="auth_pass" tabindex="', $context['tabindex']++, '"', empty($context['openid']) ? ' checked' : '', ' onclick="updateAuthMethod();" class="input_radio">
  115. ', $txt['authenticate_password'], '
  116. </label>
  117. <label for="auth_openid" id="option_auth_openid">
  118. <input type="radio" name="authenticate" value="openid" id="auth_openid" tabindex="', $context['tabindex']++, '"', !empty($context['openid']) ? ' checked' : '', ' onclick="updateAuthMethod();" class="input_radio">
  119. ', $txt['authenticate_openid'], '
  120. </label>
  121. </dd>
  122. </dl>';
  123. }
  124. echo '
  125. <dl class="register_form" id="password1_group">
  126. <dt><strong><label for="smf_autov_pwmain">', ucwords($txt['choose_pass']), ':</label></strong></dt>
  127. <dd>
  128. <input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password">
  129. <span id="smf_autov_pwmain_div" style="display: none;">
  130. <span id="smf_autov_pwmain_img" class="field_icons invalid"></span>
  131. </span>
  132. </dd>
  133. </dl>
  134. <dl class="register_form" id="password2_group">
  135. <dt><strong><label for="smf_autov_pwverify">', ucwords($txt['verify_pass']), ':</label></strong></dt>
  136. <dd>
  137. <input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password">
  138. <span id="smf_autov_pwverify_div" style="display: none;">
  139. <span id="smf_autov_pwverify_img" class="field_icons valid"></span>
  140. </span>
  141. </dd>
  142. </dl>';
  143. // If OpenID is enabled, give the user a choice between password and OpenID.
  144. if (!empty($modSettings['enableOpenID']) && $modSettings['enableOpenID'] != 2)
  145. {
  146. echo '
  147. <dl class="register_form" id="openid_group">
  148. <dt><strong>', $txt['authenticate_openid_url'], ':</strong></dt>
  149. <dd>
  150. <input type="text" name="openid_identifier" id="openid_url" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['openid']) ? $context['openid'] : '', '" class="input_text openid_login">
  151. </dd>
  152. </dl>';
  153. }
  154. // If there is any field marked as required, show it here!
  155. if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
  156. {
  157. echo '
  158. <dl class="register_form">';
  159. foreach ($context['custom_fields'] as $field)
  160. if ($field['show_reg'] > 1)
  161. echo '
  162. <dt>
  163. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
  164. <span class="smalltext">', $field['desc'], '</span>
  165. </dt>
  166. <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
  167. echo '
  168. </dl>';
  169. }
  170. echo '
  171. </fieldset>
  172. </div>';
  173. // If we have either of these, show the extra group.
  174. if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
  175. {
  176. echo '
  177. <div class="title_bar title_top">
  178. <h4 class="titlebg">', $txt['additional_information'], '</h4>
  179. </div>
  180. <div class="windowbg2">
  181. <fieldset class="content">
  182. <dl class="register_form" id="custom_group">';
  183. }
  184. if (!empty($context['profile_fields']))
  185. {
  186. // Any fields we particularly want?
  187. foreach ($context['profile_fields'] as $key => $field)
  188. {
  189. if ($field['type'] == 'callback')
  190. {
  191. if (isset($field['callback_func']) && function_exists('template_profile_' . $field['callback_func']))
  192. {
  193. $callback_func = 'template_profile_' . $field['callback_func'];
  194. $callback_func();
  195. }
  196. }
  197. else
  198. {
  199. echo '
  200. <dt>
  201. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['label'], ':</strong>';
  202. // Does it have any subtext to show?
  203. if (!empty($field['subtext']))
  204. echo '
  205. <span class="smalltext">', $field['subtext'], '</span>';
  206. echo '
  207. </dt>
  208. <dd>';
  209. // Want to put something infront of the box?
  210. if (!empty($field['preinput']))
  211. echo '
  212. ', $field['preinput'];
  213. // What type of data are we showing?
  214. if ($field['type'] == 'label')
  215. echo '
  216. ', $field['value'];
  217. // Maybe it's a text box - very likely!
  218. elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
  219. echo '
  220. <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="', empty($field['size']) ? 30 : $field['size'], '" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '">';
  221. // You "checking" me out? ;)
  222. elseif ($field['type'] == 'check')
  223. echo '
  224. <input type="hidden" name="', $key, '" value="0"><input type="checkbox" name="', $key, '" id="', $key, '"', !empty($field['value']) ? ' checked' : '', ' value="1" tabindex="', $context['tabindex']++, '" class="input_check" ', $field['input_attr'], '>';
  225. // Always fun - select boxes!
  226. elseif ($field['type'] == 'select')
  227. {
  228. echo '
  229. <select name="', $key, '" id="', $key, '" tabindex="', $context['tabindex']++, '">';
  230. if (isset($field['options']))
  231. {
  232. // Is this some code to generate the options?
  233. if (!is_array($field['options']))
  234. $field['options'] = eval($field['options']);
  235. // Assuming we now have some!
  236. if (is_array($field['options']))
  237. foreach ($field['options'] as $value => $name)
  238. echo '
  239. <option value="', $value, '"', $value == $field['value'] ? ' selected' : '', '>', $name, '</option>';
  240. }
  241. echo '
  242. </select>';
  243. }
  244. // Something to end with?
  245. if (!empty($field['postinput']))
  246. echo '
  247. ', $field['postinput'];
  248. echo '
  249. </dd>';
  250. }
  251. }
  252. }
  253. // Are there any custom fields?
  254. if (!empty($context['custom_fields']))
  255. {
  256. foreach ($context['custom_fields'] as $field)
  257. {
  258. if ($field['show_reg'] < 2)
  259. echo '
  260. <dt>
  261. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
  262. <span class="smalltext">', $field['desc'], '</span>
  263. </dt>
  264. <dd>', $field['input_html'], '</dd>';
  265. }
  266. }
  267. // If we have either of these, close the list like a proper gent.
  268. if (!empty($context['profile_fields']) || !empty($context['custom_fields']))
  269. {
  270. echo '
  271. </dl>
  272. </fieldset>
  273. </div>';
  274. }
  275. if ($context['visual_verification'])
  276. {
  277. echo '
  278. <div class="title_bar title_top">
  279. <h4 class="titlebg">', $txt['verification'], '</h4>
  280. </div>
  281. <div class="windowbg2">
  282. <fieldset class="content centertext">
  283. ', template_control_verification($context['visual_verification_id'], 'all'), '
  284. </fieldset>
  285. </div>';
  286. }
  287. echo '
  288. <div id="confirm_buttons flow_auto">';
  289. // Age restriction in effect?
  290. if (!$context['require_agreement'] && $context['show_coppa'])
  291. echo '
  292. <input type="submit" name="accept_agreement" value="', $context['coppa_agree_above'], '" class="button_submit"><br><br>
  293. <input type="submit" name="accept_agreement_coppa" value="', $context['coppa_agree_below'], '" class="button_submit">';
  294. else
  295. echo '
  296. <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">';
  297. echo '
  298. </div>
  299. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  300. <input type="hidden" name="', $context['register_token_var'], '" value="', $context['register_token'], '">
  301. <input type="hidden" name="step" value="2">
  302. </form>
  303. <script><!-- // --><![CDATA[
  304. var regTextStrings = {
  305. "username_valid": "', $txt['registration_username_available'], '",
  306. "username_invalid": "', $txt['registration_username_unavailable'], '",
  307. "username_check": "', $txt['registration_username_check'], '",
  308. "password_short": "', $txt['registration_password_short'], '",
  309. "password_reserved": "', $txt['registration_password_reserved'], '",
  310. "password_numbercase": "', $txt['registration_password_numbercase'], '",
  311. "password_no_match": "', $txt['registration_password_no_match'], '",
  312. "password_valid": "', $txt['registration_password_valid'], '"
  313. };
  314. var verificationHandle = new smfRegister("registration", ', empty($modSettings['password_strength']) ? 0 : $modSettings['password_strength'], ', regTextStrings);
  315. // Update the authentication status.
  316. updateAuthMethod();
  317. // ]]></script>';
  318. }
  319. // After registration... all done ;).
  320. function template_after()
  321. {
  322. global $context, $txt, $scripturl;
  323. // Not much to see here, just a quick... "you're now registered!" or what have you.
  324. echo '
  325. <div id="registration_success">
  326. <div class="cat_bar">
  327. <h3 class="catbg">', $context['title'], '</h3>
  328. </div>
  329. <div class="windowbg">
  330. <p class="content">', $context['description'], '</p>
  331. </div>
  332. </div>';
  333. }
  334. // Template for giving instructions about COPPA activation.
  335. function template_coppa()
  336. {
  337. global $context, $txt, $scripturl;
  338. // Formulate a nice complicated message!
  339. echo '
  340. <div class="title_bar title_top">
  341. <h3 class="titlebg">', $context['page_title'], '</h3>
  342. </div>
  343. <div class="windowbg2">
  344. <div class="content">
  345. <p>', $context['coppa']['body'], '</p>
  346. <p>
  347. <span><a href="', $scripturl, '?action=coppa;form;member=', $context['coppa']['id'], '" target="_blank" class="new_win">', $txt['coppa_form_link_popup'], '</a> | <a href="', $scripturl, '?action=coppa;form;dl;member=', $context['coppa']['id'], '">', $txt['coppa_form_link_download'], '</a></span>
  348. </p>
  349. <p>', $context['coppa']['many_options'] ? $txt['coppa_send_to_two_options'] : $txt['coppa_send_to_one_option'], '</p>';
  350. // Can they send by post?
  351. if (!empty($context['coppa']['post']))
  352. {
  353. echo '
  354. <h4>1) ', $txt['coppa_send_by_post'], '</h4>
  355. <div class="coppa_contact">
  356. ', $context['coppa']['post'], '
  357. </div>';
  358. }
  359. // Can they send by fax??
  360. if (!empty($context['coppa']['fax']))
  361. {
  362. echo '
  363. <h4>', !empty($context['coppa']['post']) ? '2' : '1', ') ', $txt['coppa_send_by_fax'], '</h4>
  364. <div class="coppa_contact">
  365. ', $context['coppa']['fax'], '
  366. </div>';
  367. }
  368. // Offer an alternative Phone Number?
  369. if ($context['coppa']['phone'])
  370. {
  371. echo '
  372. <p>', $context['coppa']['phone'], '</p>';
  373. }
  374. echo '
  375. </div>
  376. </div>';
  377. }
  378. // An easily printable form for giving permission to access the forum for a minor.
  379. function template_coppa_form()
  380. {
  381. global $context, $txt, $scripturl;
  382. // Show the form (As best we can)
  383. echo '
  384. <table style="width: 100%; padding: 3px; border: 0" class="tborder" align="center">
  385. <tr>
  386. <td align="left">', $context['forum_contacts'], '</td>
  387. </tr><tr>
  388. <td align="right">
  389. <em>', $txt['coppa_form_address'], '</em>: ', $context['ul'], '<br>
  390. ', $context['ul'], '<br>
  391. ', $context['ul'], '<br>
  392. ', $context['ul'], '
  393. </td>
  394. </tr><tr>
  395. <td align="right">
  396. <em>', $txt['coppa_form_date'], '</em>: ', $context['ul'], '
  397. <br><br>
  398. </td>
  399. </tr><tr>
  400. <td align="left">
  401. ', $context['coppa_body'], '
  402. </td>
  403. </tr>
  404. </table>
  405. <br>';
  406. }
  407. // Show a window containing the spoken verification code.
  408. function template_verification_sound()
  409. {
  410. global $context, $settings, $txt, $scripturl, $modSettings;
  411. echo '<!DOCTYPE html>
  412. <html', $context['right_to_left'] ? ' dir="rtl"' : '', '>
  413. <head>
  414. <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '">
  415. <title>', $txt['visual_verification_sound'], '</title>
  416. <meta name="robots" content="noindex">
  417. <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'">
  418. <style type="text/css">';
  419. // Just show the help text and a "close window" link.
  420. echo '
  421. </style>
  422. </head>
  423. <body style="margin: 1ex;">
  424. <div class="windowbg description" style="text-align: center;">';
  425. if (isBrowser('is_ie') || isBrowser('is_ie11'))
  426. echo '
  427. <object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" type="audio/x-wav">
  428. <param name="AutoStart" value="1">
  429. <param name="FileName" value="', $context['verification_sound_href'], '">
  430. </object>';
  431. else
  432. echo '
  433. <object type="audio/x-wav" data="', $context['verification_sound_href'], '">
  434. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $context['verification_sound_href'], '</a>
  435. </object>';
  436. echo '
  437. <br>
  438. <a href="', $context['verification_sound_href'], ';sound" rel="nofollow">', $txt['visual_verification_sound_again'], '</a><br>
  439. <a href="', $context['verification_sound_href'], '" rel="nofollow">', $txt['visual_verification_sound_direct'], '</a><br><br>
  440. <a href="javascript:self.close();">', $txt['visual_verification_sound_close'], '</a><br>
  441. </div>
  442. </body>
  443. </html>';
  444. }
  445. function template_admin_register()
  446. {
  447. global $context, $settings, $scripturl, $txt, $modSettings;
  448. echo '
  449. <div id="admincenter">
  450. <div id="admin_form_wrapper">
  451. <form id="postForm" class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '" name="postForm">
  452. <div class="cat_bar">
  453. <h3 class="catbg">', $txt['admin_browse_register_new'], '</h3>
  454. </div>
  455. <div class="content" id="register_screen">';
  456. if (!empty($context['registration_done']))
  457. echo '
  458. <div class="infobox">
  459. ', $context['registration_done'], '
  460. </div>';
  461. echo '
  462. <dl class="register_form" id="admin_register_form">
  463. <dt>
  464. <strong><label for="user_input">', $txt['admin_register_username'], ':</label></strong>
  465. <span class="smalltext">', $txt['admin_register_username_desc'], '</span>
  466. </dt>
  467. <dd>
  468. <input type="text" name="user" id="user_input" tabindex="', $context['tabindex']++, '" size="30" maxlength="25" class="input_text">
  469. </dd>
  470. <dt>
  471. <strong><label for="email_input">', $txt['admin_register_email'], ':</label></strong>
  472. <span class="smalltext">', $txt['admin_register_email_desc'], '</span>
  473. </dt>
  474. <dd>
  475. <input type="text" name="email" id="email_input" tabindex="', $context['tabindex']++, '" size="30" class="input_text">
  476. </dd>
  477. <dt>
  478. <strong><label for="password_input">', $txt['admin_register_password'], ':</label></strong>
  479. <span class="smalltext">', $txt['admin_register_password_desc'], '</span>
  480. </dt>
  481. <dd>
  482. <input type="password" name="password" id="password_input" tabindex="', $context['tabindex']++, '" size="30" class="input_password" onchange="onCheckChange();">
  483. </dd>';
  484. if (!empty($context['member_groups']))
  485. {
  486. echo '
  487. <dt>
  488. <strong><label for="group_select">', $txt['admin_register_group'], ':</label></strong>
  489. <span class="smalltext">', $txt['admin_register_group_desc'], '</span>
  490. </dt>
  491. <dd>
  492. <select name="group" id="group_select" tabindex="', $context['tabindex']++, '">';
  493. foreach ($context['member_groups'] as $id => $name)
  494. echo '
  495. <option value="', $id, '">', $name, '</option>';
  496. echo '
  497. </select>
  498. </dd>';
  499. }
  500. // If there is any field marked as required, show it here!
  501. if (!empty($context['custom_fields_required']) && !empty($context['custom_fields']))
  502. foreach ($context['custom_fields'] as $field)
  503. if ($field['show_reg'] > 1)
  504. echo '
  505. <dt>
  506. <strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
  507. <span class="smalltext">', $field['desc'], '</span>
  508. </dt>
  509. <dd>', str_replace('name="', 'tabindex="' . $context['tabindex']++ .'" name="', $field['input_html']), '</dd>';
  510. echo '
  511. <dt>
  512. <strong><label for="emailPassword_check">', $txt['admin_register_email_detail'], ':</label></strong>
  513. <span class="smalltext">', $txt['admin_register_email_detail_desc'], '</span>
  514. </dt>
  515. <dd>
  516. <input type="checkbox" name="emailPassword" id="emailPassword_check" tabindex="', $context['tabindex']++, '" checked disabled class="input_check">
  517. </dd>
  518. <dt>
  519. <strong><label for="emailActivate_check">', $txt['admin_register_email_activate'], ':</label></strong>
  520. </dt>
  521. <dd>
  522. <input type="checkbox" name="emailActivate" id="emailActivate_check" tabindex="', $context['tabindex']++, '"', !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? ' checked' : '', ' onclick="onCheckChange();" class="input_check">
  523. </dd>
  524. </dl>
  525. <div class="flow_auto">
  526. <input type="submit" name="regSubmit" value="', $txt['register'], '" tabindex="', $context['tabindex']++, '" class="button_submit">
  527. <input type="hidden" name="sa" value="register">
  528. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  529. <input type="hidden" name="', $context['admin-regc_token_var'], '" value="', $context['admin-regc_token'], '">
  530. </div>
  531. </div>
  532. </form>
  533. </div>
  534. </div>
  535. <br class="clear">';
  536. }
  537. // Form for editing the agreement shown for people registering to the forum.
  538. function template_edit_agreement()
  539. {
  540. global $context, $scripturl, $txt;
  541. if (!empty($context['saved_successful']))
  542. echo '
  543. <div class="infobox">', $txt['settings_saved'], '</div>';
  544. elseif (!empty($context['could_not_save']))
  545. echo '
  546. <div class="errorbox">', $txt['admin_agreement_not_saved'], '</div>';
  547. // Just a big box to edit the text file ;).
  548. echo '
  549. <form id="admin_form_wrapper" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
  550. <div class="cat_bar">
  551. <h3 class="catbg">', $txt['registration_agreement'], '</h3>
  552. </div>';
  553. // Warning for if the file isn't writable.
  554. if (!empty($context['warning']))
  555. echo '
  556. <p class="error">', $context['warning'], '</p>';
  557. echo '
  558. <div class="windowbg2" id="registration_agreement">
  559. <div class="content">';
  560. // Is there more than one language to choose from?
  561. if (count($context['editable_agreements']) > 1)
  562. {
  563. echo '
  564. <div class="cat_bar">
  565. <h3 class="catbg">', $txt['language_configuration'], '</h3>
  566. </div>
  567. <div class="information">
  568. <form action="', $scripturl, '?action=admin;area=regcenter" id="change_reg" method="post" accept-charset="', $context['character_set'], '" style="display: inline;">
  569. <strong>', $txt['admin_agreement_select_language'], ':</strong>&nbsp;
  570. <select name="agree_lang" onchange="document.getElementById(\'change_reg\').submit();" tabindex="', $context['tabindex']++, '">';
  571. foreach ($context['editable_agreements'] as $file => $name)
  572. echo '
  573. <option value="', $file, '"', $context['current_agreement'] == $file ? ' selected' : '', '>', $name, '</option>';
  574. echo '
  575. </select>
  576. <div class="righttext">
  577. <input type="hidden" name="sa" value="agreement">
  578. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  579. <input type="submit" name="change" value="', $txt['admin_agreement_select_language_change'], '" tabindex="', $context['tabindex']++, '" class="button_submit">
  580. </div>
  581. </form>
  582. </div>';
  583. }
  584. // Show the actual agreement in an oversized text box.
  585. echo '
  586. <p class="agreement">
  587. <textarea cols="70" rows="20" name="agreement" id="agreement">', $context['agreement'], '</textarea>
  588. </p>
  589. <p>
  590. <label for="requireAgreement"><input type="checkbox" name="requireAgreement" id="requireAgreement"', $context['require_agreement'] ? ' checked' : '', ' tabindex="', $context['tabindex']++, '" value="1" class="input_check"> ', $txt['admin_agreement'], '.</label>
  591. </p>
  592. <div class="flow_auto" >
  593. <input type="submit" value="', $txt['save'], '" tabindex="', $context['tabindex']++, '" class="button_submit">
  594. <input type="hidden" name="agree_lang" value="', $context['current_agreement'], '">
  595. <input type="hidden" name="sa" value="agreement">
  596. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  597. <input type="hidden" name="', $context['admin-rega_token_var'], '" value="', $context['admin-rega_token'], '">
  598. </div>
  599. </div>
  600. </div>
  601. </form>';
  602. }
  603. function template_edit_reserved_words()
  604. {
  605. global $context, $scripturl, $txt;
  606. if (!empty($context['saved_successful']))
  607. echo '
  608. <div class="infobox">', $txt['settings_saved'], '</div>';
  609. echo '
  610. <form id="admin_form_wrapper" class="windowbg2" action="', $scripturl, '?action=admin;area=regcenter" method="post" accept-charset="', $context['character_set'], '">
  611. <div class="cat_bar">
  612. <h3 class="catbg">', $txt['admin_reserved_set'], '</h3>
  613. </div>
  614. <div class="content">
  615. <h4>', $txt['admin_reserved_line'], '</h4>
  616. <p class="reserved_names">
  617. <textarea cols="30" rows="6" name="reserved" id="reserved">', implode("\n", $context['reserved_words']), '</textarea>
  618. </p>
  619. <dl class="settings">
  620. <dt>
  621. <label for="matchword">', $txt['admin_match_whole'], '</label>
  622. </dt>
  623. <dd>
  624. <input type="checkbox" name="matchword" id="matchword" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_word'] ? ' checked' : '', ' class="input_check">
  625. </dd>
  626. <dt>
  627. <label for="matchcase">', $txt['admin_match_case'], '</label>
  628. </dt>
  629. <dd>
  630. <input type="checkbox" name="matchcase" id="matchcase" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_case'] ? ' checked' : '', ' class="input_check">
  631. </dd>
  632. <dt>
  633. <label for="matchuser">', $txt['admin_check_user'], '</label>
  634. </dt>
  635. <dd>
  636. <input type="checkbox" name="matchuser" id="matchuser" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_user'] ? ' checked' : '', ' class="input_check">
  637. </dd>
  638. <dt>
  639. <label for="matchname">', $txt['admin_check_display'], '</label>
  640. </dt>
  641. <dd>
  642. <input type="checkbox" name="matchname" id="matchname" tabindex="', $context['tabindex']++, '"', $context['reserved_word_options']['match_name'] ? ' checked' : '', ' class="input_check">
  643. </dd>
  644. </dl>
  645. <div class="flow_auto" >
  646. <input type="submit" value="', $txt['save'], '" name="save_reserved_names" tabindex="', $context['tabindex']++, '" style="margin: 1ex;" class="button_submit">
  647. <input type="hidden" name="sa" value="reservednames">
  648. <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '">
  649. <input type="hidden" name="', $context['admin-regr_token_var'], '" value="', $context['admin-regr_token'], '">
  650. </div>
  651. </div>
  652. </form>';
  653. }
  654. ?>