Register.template.php 27 KB

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