PageRenderTime 59ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/register.php

https://github.com/Dratone/EveBB
PHP | 554 lines | 437 code | 73 blank | 44 comment | 155 complexity | 61aa16e5b7bc9a2678493eceb09425dc MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. /**
  3. * Copyright (C) 2008-2010 FluxBB
  4. * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
  5. * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
  6. */
  7. define('PUN_ROOT', dirname(__FILE__).'/');
  8. require PUN_ROOT.'include/common.php';
  9. // If we are logged in, we shouldn't be here
  10. if (!$pun_user['is_guest'])
  11. {
  12. header('Location: index.php');
  13. exit;
  14. }
  15. // Load the register.php language file
  16. require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
  17. // Load the register.php/profile.php language file
  18. require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
  19. if ($pun_config['o_regs_allow'] == '0')
  20. message($lang_register['No new regs']);
  21. // User pressed the cancel button
  22. if (isset($_GET['cancel']))
  23. redirect('index.php', $lang_register['Reg cancel redirect']);
  24. else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
  25. {
  26. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register'], $lang_register['Forum rules']);
  27. define('PUN_ACTIVE_PAGE', 'register');
  28. require PUN_ROOT.'header.php';
  29. ?>
  30. <div id="rules" class="blockform">
  31. <div class="hd"><h2><span><?php echo $lang_register['Forum rules'] ?></span></h2></div>
  32. <div class="box">
  33. <form method="get" action="register.php">
  34. <div class="inform">
  35. <fieldset>
  36. <legend><?php echo $lang_register['Rules legend'] ?></legend>
  37. <div class="infldset">
  38. <div class="usercontent"><?php echo $pun_config['o_rules_message'] ?></div>
  39. </div>
  40. </fieldset>
  41. </div>
  42. <p class="buttons"><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /> <input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
  43. </form>
  44. </div>
  45. </div>
  46. <?php
  47. require PUN_ROOT.'footer.php';
  48. }
  49. // Start with a clean slate
  50. $errors = array();
  51. if (isset($_POST['form_sent']))
  52. {
  53. // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
  54. $result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.get_remote_address().'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  55. if ($db->num_rows($result))
  56. message($lang_register['Registration flood']);
  57. /*********** EvE-BB CHECKS ***********/
  58. $api_key = $_POST['api_key'];
  59. $api_user_id = $_POST['api_user_id'];
  60. $api_character_id = $_POST['api_character_id'];
  61. if (!check_alpha_numeric($api_key)) {
  62. $errors[] = $lang_prof_reg['Bad API Key'];
  63. } //End if.
  64. if (!check_numeric($api_user_id)) {
  65. $errors[] = $lang_prof_reg['Bad User ID'];
  66. } //End if.
  67. if (!check_numeric($api_character_id)) {
  68. $errors[] = $lang_prof_reg['Bad Character ID'];
  69. } //End if.
  70. //Now we hit the DB and see if there is already an API auth associated.
  71. if (empty($errors)) {
  72. $result = $db->query('SELECT user_id FROM '.$db->prefix.'api_auth WHERE api_character_id='.$api_character_id.' OR api_key=\''.$api_key.'\' OR api_user_id='.$api_user_id.';') or error('Unable to fetch user api info from the database.', __FILE__, __LINE__, $db->error());
  73. if ($db->num_rows($result) > 0) {
  74. $errors[] = $lang_prof_reg['Dupe API'];
  75. //error($lang_prof_reg['Dupe API']);
  76. } //End if.
  77. } //End if.
  78. $cak = new CAK($api_user_id, $api_key, $api_character_id);
  79. if (($cak_err = $cak->validate(true)) != CAK_OK) {
  80. switch ($cak_err) {
  81. case(CAK_NOT_INIT):
  82. $errors[] = "An internal error has occured while dealing with the API information. Well damn.";
  83. break;
  84. case(CAK_VCODE_LEN):
  85. $errors[] = "Your API Verification Code does not meet security requirements.<br/> Please generate a vcode between 20 and 64 characters in length.";
  86. break;
  87. case(CAK_ID_NOT_NUM):
  88. $errors[] = "Your API Key ID is not a valid ID.";
  89. break;
  90. case(CAK_BAD_VCODE):
  91. $errors[] = "Your API Verification Code is not valid.";
  92. break;
  93. } //End switch().
  94. } else if (($cak_err = $cak->validate_mask()) != CAK_OK) {
  95. switch ($cak_err) {
  96. case(CAK_BAD_FETCH):
  97. $errors[] = "Unable to fetch information from the API server. Please ensure the API server is currently operational.";
  98. break;
  99. case(CAK_BAD_KEY):
  100. $errors[] = "Your API Detials are not correct, please ensure they are correct and try again.";
  101. break;
  102. case(CAK_BAD_MASK):
  103. $errors[] = "Unable to locate a non-zero access mask for your CAK.";
  104. break;
  105. case(CAK_EXPIRE_SET):
  106. $errors[] = "Your CAK is set to expire; EveBB does not support this option. (By choice)";
  107. break;
  108. case(CAK_BAD_TYPE):
  109. $errors[] = "Your CAK type is not allowed by the administrators of this forum. If you are using character based CAK's, please try account based instead.";
  110. break;
  111. } //End switch().
  112. } //End if - else if.
  113. $username = "EveUser"; //Default name.
  114. $char;
  115. //Why not put this off the API in use check? Readability mostly.
  116. if (empty($errors)) {
  117. if (!$char = fetch_character_api($cak)) {
  118. $errors[] = $lang_prof_reg['Bad Api Request'];
  119. } else {
  120. if ($pun_config['o_eve_restrict_reg_corp'] == '1') {
  121. if (!is_allowed_corp($char->corporationID)) {
  122. $errors[] = $lang_prof_reg['Bad Character'];
  123. } //End if.
  124. } //End if.
  125. $username = strip_special($char->name);
  126. } //End if - else.
  127. } //End if.
  128. /*********** EvE-BB CHECKS ***********/
  129. //$username = pun_trim($_POST['req_user']);
  130. $email1 = strtolower(trim($_POST['req_email1']));
  131. if ($pun_config['o_regs_verify'] == '1')
  132. {
  133. $email2 = strtolower(trim($_POST['req_email2']));
  134. $password1 = random_pass(8);
  135. $password2 = $password1;
  136. }
  137. else
  138. {
  139. $password1 = pun_trim($_POST['req_password1']);
  140. $password2 = pun_trim($_POST['req_password2']);
  141. }
  142. // Validate username and passwords
  143. check_username($username);
  144. if (pun_strlen($password1) < 4)
  145. $errors[] = $lang_prof_reg['Pass too short'];
  146. else if ($password1 != $password2)
  147. $errors[] = $lang_prof_reg['Pass not match'];
  148. // Validate email
  149. require PUN_ROOT.'include/email.php';
  150. if (!is_valid_email($email1))
  151. $errors[] = $lang_common['Invalid email'];
  152. else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
  153. $errors[] = $lang_register['Email not match'];
  154. // Check if it's a banned email address
  155. if (is_banned_email($email1))
  156. {
  157. if ($pun_config['p_allow_banned_email'] == '0')
  158. $errors[] = $lang_prof_reg['Banned email'];
  159. $banned_email = true; // Used later when we send an alert email
  160. }
  161. else
  162. $banned_email = false;
  163. // Check if someone else already has registered with that email address
  164. $dupe_list = array();
  165. $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($email1).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  166. if ($db->num_rows($result))
  167. {
  168. if ($pun_config['p_allow_dupe_email'] == '0')
  169. $errors[] = $lang_prof_reg['Dupe email'];
  170. while ($cur_dupe = $db->fetch_assoc($result))
  171. $dupe_list[] = $cur_dupe['username'];
  172. }
  173. // Make sure we got a valid language string
  174. if (isset($_POST['language']))
  175. {
  176. $language = preg_replace('#[\.\\\/]#', '', $_POST['language']);
  177. if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
  178. message($lang_common['Bad request']);
  179. }
  180. else
  181. $language = $pun_config['o_default_lang'];
  182. $timezone = round($_POST['timezone'], 1);
  183. $dst = isset($_POST['dst']) ? '1' : '0';
  184. $email_setting = intval($_POST['email_setting']);
  185. if ($email_setting < 0 || $email_setting > 2)
  186. $email_setting = $pun_config['o_default_email_setting'];
  187. // Did everything go according to plan?
  188. if (empty($errors))
  189. {
  190. // Insert the new user into the database. We do this now to get the last inserted ID for later use
  191. $now = time();
  192. $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
  193. $password_hash = pun_hash($password1);
  194. // Add the user
  195. $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, timezone, dst, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$db->escape($email1).'\', '.$email_setting.', '.$timezone.' , '.$dst.', \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
  196. $new_uid = $db->insert_id();
  197. /*********** EvE-BB Inserts ***********/
  198. //We now add all their characters at once!
  199. update_characters($new_uid, $cak);
  200. select_character($new_uid, $api_character_id);
  201. add_corp_from_character($api_character_id, ($pun_config['o_eve_restrict_reg_corp'] == '1' ? true : false));
  202. $log = '';
  203. apply_rules($log);
  204. cache_char_pic($api_character_id);
  205. foreach ($_HOOKS['users'] as $hook) {
  206. $hook->register($new_uid);
  207. } //End foreach().
  208. /*********** EvE-BB Inserts ***********/
  209. // If the mailing list isn't empty, we may need to send out some alerts
  210. if ($pun_config['o_mailing_list'] != '')
  211. {
  212. // If we previously found out that the email was banned
  213. if ($banned_email)
  214. {
  215. $mail_subject = $lang_common['Banned email notification'];
  216. $mail_message = sprintf($lang_common['Banned email register message'], $username, $email1)."\n";
  217. $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
  218. $mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
  219. pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  220. }
  221. // If we previously found out that the email was a dupe
  222. if (!empty($dupe_list))
  223. {
  224. $mail_subject = $lang_common['Duplicate email notification'];
  225. $mail_message = sprintf($lang_common['Duplicate email register message'], $username, implode(', ', $dupe_list))."\n";
  226. $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
  227. $mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
  228. pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  229. }
  230. // Should we alert people on the admin mailing list that a new user has registered?
  231. if ($pun_config['o_regs_report'] == '1')
  232. {
  233. $mail_subject = $lang_common['New user notification'];
  234. $mail_message = sprintf($lang_common['New user message'], $username, get_base_url().'/')."\n";
  235. $mail_message .= sprintf($lang_common['User profile'], get_base_url().'/profile.php?id='.$new_uid)."\n";
  236. $mail_message .= "\n".'--'."\n".$lang_common['Email signature'];
  237. pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  238. }
  239. }
  240. // Must the user verify the registration or do we log him/her in right now?
  241. if ($pun_config['o_regs_verify'] == '1')
  242. {
  243. // Load the "welcome" template
  244. $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
  245. // The first row contains the subject
  246. $first_crlf = strpos($mail_tpl, "\n");
  247. $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
  248. $mail_message = trim(substr($mail_tpl, $first_crlf));
  249. $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
  250. $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
  251. $mail_message = str_replace('<username>', $username, $mail_message);
  252. $mail_message = str_replace('<password>', $password1, $mail_message);
  253. $mail_message = str_replace('<login_url>', get_base_url().'/login.php', $mail_message);
  254. $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
  255. pun_mail($email1, $mail_subject, $mail_message);
  256. message($lang_register['Reg email'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
  257. }
  258. // Regenerate the users info cache
  259. if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
  260. require PUN_ROOT.'include/cache.php';
  261. generate_users_info_cache();
  262. pun_setcookie($new_uid, $password_hash, time() + $pun_config['o_timeout_visit']);
  263. //redirect('index.php', $lang_register['Reg complete']);
  264. //Since we use their character name for registration, we need to display their names.
  265. message(sprintf($lang_register['api_register_success'], $username, $password1), true);
  266. }
  267. foreach ($_HOOKS['users'] as $hook) {
  268. $hook->register_failed($errors);
  269. } //End foreach().
  270. }
  271. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register']);
  272. $required_fields = array(
  273. 'req_password1' => $lang_common['Password'],
  274. 'req_password2' => $lang_prof_reg['Confirm pass'],
  275. 'req_email1' => $lang_common['Email'],
  276. 'req_email2' => $lang_common['Email'].' 2',
  277. 'api_key' => $lang_common['api_key'],
  278. 'api_user_id' => $lang_common['api_user_id'],
  279. 'api_character_id' => $lang_common['api_character_id']
  280. );
  281. if ($pun_config['o_regs_verify'] == '1') {
  282. unset($required_fields['req_password1']);
  283. unset($required_fields['req_password2']);
  284. } //End if.
  285. $focus_element = array('register', 'req_email1');
  286. define('PUN_ACTIVE_PAGE', 'register');
  287. require PUN_ROOT.'header.php';
  288. $timezone = isset($timezone) ? $timezone : $pun_config['o_default_timezone'];
  289. $dst = isset($dst) ? $dst : $pun_config['o_default_dst'];
  290. $email_setting = isset($email_setting) ? $email_setting : $pun_config['o_default_email_setting'];
  291. ?>
  292. <?php
  293. // If there are errors, we display them
  294. if (!empty($errors))
  295. {
  296. ?>
  297. <div id="posterror" class="block">
  298. <h2><span><?php echo $lang_register['Registration errors'] ?></span></h2>
  299. <div class="box">
  300. <div class="inbox error-info">
  301. <p><?php echo $lang_register['Registration errors info'] ?></p>
  302. <ul class="error-list">
  303. <?php
  304. foreach ($errors as $cur_error)
  305. echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
  306. ?>
  307. </ul>
  308. </div>
  309. </div>
  310. </div>
  311. <?php
  312. }
  313. ?>
  314. <div id="regform" class="blockform">
  315. <h2><span><?php echo $lang_register['Register'] ?></span></h2>
  316. <div class="box">
  317. <form id="register" method="post" action="register.php?action=register" onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
  318. <div class="inform">
  319. <div class="forminfo">
  320. <h3><?php echo $lang_common['Important information'] ?></h3>
  321. <p><?php echo $lang_register['Desc 1'] ?></p>
  322. <p><?php echo $lang_register['Desc 2'] ?></p>
  323. </div>
  324. </div>
  325. <?php
  326. /*
  327. <div class="inform">
  328. <fieldset>
  329. <legend><?php echo $lang_register['Username legend'] ?></legend>
  330. <div class="infldset">
  331. <label class="required"><strong><?php echo $lang_common['Username'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="req_user" value="<?php if (isset($_POST['req_user'])) echo pun_htmlspecialchars($_POST['req_user']); ?>" size="25" maxlength="25" /><br /></label>
  332. </div>
  333. </fieldset>
  334. </div>
  335. */
  336. ?>
  337. <?php if ($pun_config['o_regs_verify'] == '0'): ?>
  338. <div class="inform">
  339. <fieldset>
  340. <legend><?php echo $lang_register['Pass legend'] ?></legend>
  341. <div class="infldset">
  342. <label class="conl required"><strong><?php echo $lang_common['Password'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password1" value="<?php if (isset($_POST['req_password1'])) echo pun_htmlspecialchars($_POST['req_password1']); ?>" size="16" /><br /></label>
  343. <label class="conl required"><strong><?php echo $lang_prof_reg['Confirm pass'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="req_password2" value="<?php if (isset($_POST['req_password2'])) echo pun_htmlspecialchars($_POST['req_password2']); ?>" size="16" /><br /></label>
  344. <p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
  345. </div>
  346. </fieldset>
  347. </div>
  348. <?php endif; ?>
  349. <div class="inform">
  350. <fieldset>
  351. <legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['Email legend 2'] : $lang_prof_reg['Email legend'] ?></legend>
  352. <div class="infldset">
  353. <input type="hidden" name="form_sent" value="1" />
  354. <?php if ($pun_config['o_regs_verify'] == '1'): ?> <p><?php echo $lang_register['Email info'] ?></p>
  355. <?php endif; ?> <label class="required"><strong><?php echo $lang_common['Email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
  356. <input type="text" name="req_email1" value="<?php if (isset($_POST['req_email1'])) echo pun_htmlspecialchars($_POST['req_email1']); ?>" size="50" maxlength="80" /><br /></label>
  357. <?php if ($pun_config['o_regs_verify'] == '1'): ?> <label class="required"><strong><?php echo $lang_register['Confirm email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
  358. <input type="text" name="req_email2" value="<?php if (isset($_POST['req_email2'])) echo pun_htmlspecialchars($_POST['req_email2']); ?>" size="50" maxlength="80" /><br /></label>
  359. <?php endif; ?> </div>
  360. </fieldset>
  361. </div>
  362. <div class="inform">
  363. <fieldset>
  364. <legend><?php echo $lang_register['api_legend'] ?></legend>
  365. <div class="infldset">
  366. <label class="required"><strong><?php echo $lang_register['api_user_id'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="api_user_id" id="api_user_id" value="<?php if (isset($_POST['api_user_id'])) echo pun_htmlspecialchars($_POST['api_user_id']); ?>" size="16" /><br /></label>
  367. <label class="required"><strong><?php echo $lang_register['api_key'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="api_key" id="api_key" value="<?php if (isset($_POST['api_key'])) echo pun_htmlspecialchars($_POST['api_key']); ?>" size="16" /><br /></label>
  368. <label class="required"><strong><?php echo $lang_register['api_character_id'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
  369. <span id="api_holder"><a class="fetch_chars" href="index.php" onClick="fetchCharacters(); return false;"><span id="char_fetch_text"><?php echo $lang_register['char_fetch_text']; ?></span></a></span>
  370. </label>
  371. <p class="clearb"><?php echo $lang_register['api_info'] ?></p>
  372. </div>
  373. </fieldset>
  374. </div>
  375. <div class="inform">
  376. <fieldset>
  377. <legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
  378. <div class="infldset">
  379. <p><?php echo $lang_prof_reg['Time zone info'] ?></p>
  380. <label><?php echo $lang_prof_reg['Time zone']."\n" ?>
  381. <br /><select id="time_zone" name="timezone">
  382. <option value="-12"<?php if ($timezone == -12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-12:00'] ?></option>
  383. <option value="-11"<?php if ($timezone == -11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-11:00'] ?></option>
  384. <option value="-10"<?php if ($timezone == -10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-10:00'] ?></option>
  385. <option value="-9.5"<?php if ($timezone == -9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:30'] ?></option>
  386. <option value="-9"<?php if ($timezone == -9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:00'] ?></option>
  387. <option value="-8.5"<?php if ($timezone == -8.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:30'] ?></option>
  388. <option value="-8"<?php if ($timezone == -8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:00'] ?></option>
  389. <option value="-7"<?php if ($timezone == -7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-07:00'] ?></option>
  390. <option value="-6"<?php if ($timezone == -6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-06:00'] ?></option>
  391. <option value="-5"<?php if ($timezone == -5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-05:00'] ?></option>
  392. <option value="-4"<?php if ($timezone == -4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-04:00'] ?></option>
  393. <option value="-3.5"<?php if ($timezone == -3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:30'] ?></option>
  394. <option value="-3"<?php if ($timezone == -3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:00'] ?></option>
  395. <option value="-2"<?php if ($timezone == -2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-02:00'] ?></option>
  396. <option value="-1"<?php if ($timezone == -1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-01:00'] ?></option>
  397. <option value="0"<?php if ($timezone == 0) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC'] ?></option>
  398. <option value="1"<?php if ($timezone == 1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+01:00'] ?></option>
  399. <option value="2"<?php if ($timezone == 2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+02:00'] ?></option>
  400. <option value="3"<?php if ($timezone == 3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:00'] ?></option>
  401. <option value="3.5"<?php if ($timezone == 3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:30'] ?></option>
  402. <option value="4"<?php if ($timezone == 4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:00'] ?></option>
  403. <option value="4.5"<?php if ($timezone == 4.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:30'] ?></option>
  404. <option value="5"<?php if ($timezone == 5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:00'] ?></option>
  405. <option value="5.5"<?php if ($timezone == 5.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:30'] ?></option>
  406. <option value="5.75"<?php if ($timezone == 5.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:45'] ?></option>
  407. <option value="6"<?php if ($timezone == 6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:00'] ?></option>
  408. <option value="6.5"<?php if ($timezone == 6.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:30'] ?></option>
  409. <option value="7"<?php if ($timezone == 7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+07:00'] ?></option>
  410. <option value="8"<?php if ($timezone == 8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:00'] ?></option>
  411. <option value="8.75"<?php if ($timezone == 8.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:45'] ?></option>
  412. <option value="9"<?php if ($timezone == 9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:00'] ?></option>
  413. <option value="9.5"<?php if ($timezone == 9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:30'] ?></option>
  414. <option value="10"<?php if ($timezone == 10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:00'] ?></option>
  415. <option value="10.5"<?php if ($timezone == 10.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:30'] ?></option>
  416. <option value="11"<?php if ($timezone == 11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:00'] ?></option>
  417. <option value="11.5"<?php if ($timezone == 11.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:30'] ?></option>
  418. <option value="12"<?php if ($timezone == 12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:00'] ?></option>
  419. <option value="12.75"<?php if ($timezone == 12.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:45'] ?></option>
  420. <option value="13"<?php if ($timezone == 13) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+13:00'] ?></option>
  421. <option value="14"<?php if ($timezone == 14) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+14:00'] ?></option>
  422. </select>
  423. <br /></label>
  424. <div class="rbox">
  425. <label><input type="checkbox" name="dst" value="1"<?php if ($dst == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['DST'] ?><br /></label>
  426. </div>
  427. <?php
  428. $languages = forum_list_langs();
  429. // Only display the language selection box if there's more than one language available
  430. if (count($languages) > 1)
  431. {
  432. ?>
  433. <label><?php echo $lang_prof_reg['Language'] ?>
  434. <br /><select name="language">
  435. <?php
  436. foreach ($languages as $temp)
  437. {
  438. if ($pun_config['o_default_lang'] == $temp)
  439. echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
  440. else
  441. echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
  442. }
  443. ?>
  444. </select>
  445. <br /></label>
  446. <?php
  447. }
  448. ?>
  449. </div>
  450. </fieldset>
  451. </div>
  452. <div class="inform">
  453. <fieldset>
  454. <legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
  455. <div class="infldset">
  456. <p><?php echo $lang_prof_reg['Email setting info'] ?></p>
  457. <div class="rbox">
  458. <label><input type="radio" name="email_setting" value="0"<?php if ($email_setting == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 1'] ?><br /></label>
  459. <label><input type="radio" name="email_setting" value="1"<?php if ($email_setting == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 2'] ?><br /></label>
  460. <label><input type="radio" name="email_setting" value="2"<?php if ($email_setting == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 3'] ?><br /></label>
  461. </div>
  462. </div>
  463. </fieldset>
  464. </div>
  465. <p class="buttons"><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
  466. </form>
  467. </div>
  468. </div>
  469. <?php
  470. require PUN_ROOT.'footer.php';