Register.template.php 27 KB

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