Register.template.php 28 KB

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