Guest User

Untitled

a guest
Sep 28th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 25.85 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * Copyright (C) 2008-2012 FluxBB
  5.  * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
  6.  * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
  7.  */
  8.  
  9. define('PUN_ROOT', dirname(__FILE__).'/');
  10. require PUN_ROOT.'include/common.php';
  11.  
  12.  
  13. // If we are logged in, we shouldn't be here
  14. if (!$pun_user['is_guest'])
  15. {
  16.     header('Location: index.php');
  17.     exit;
  18. }
  19.  
  20. // Load the register.php language file
  21. require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php';
  22.  
  23. // Load the register.php/profile.php language file
  24. require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
  25.  
  26. if ($pun_config['o_regs_allow'] == '0')
  27.     message($lang_register['No new regs']);
  28.  
  29. // мод отслеживания ошибок ввода - Visman
  30. require PUN_ROOT.'include/security.php';
  31. vsecurity_get(1);
  32.  
  33. // User pressed the cancel button
  34. if (isset($_GET['cancel']))
  35.     redirect('index.php', $lang_register['Reg cancel redirect']);
  36.  
  37.  
  38. else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
  39. {
  40.     $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register'], $lang_register['Forum rules']);
  41.     define('PUN_ACTIVE_PAGE', 'register');
  42.     require PUN_ROOT.'header.php';
  43.  
  44. ?>
  45. <div id="rules" class="blockform">
  46.     <div class="hd"><h2><span><?php echo $lang_register['Forum rules'] ?></span></h2></div>
  47.     <div class="box">
  48.         <form method="get" action="register.php">
  49.             <div class="inform">
  50.                 <fieldset>
  51.                     <legend><?php echo $lang_register['Rules legend'] ?></legend>
  52.                     <div class="infldset">
  53.                         <div class="usercontent"><?php echo $pun_config['o_rules_message'] ?></div>
  54.                     </div>
  55.                 </fieldset>
  56.             </div>
  57.             <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>
  58.         </form>
  59.     </div>
  60. </div>
  61. <?php
  62.  
  63.     require PUN_ROOT.'footer.php';
  64. }
  65.  
  66. // Start with a clean slate
  67. $errors = array();
  68.  
  69. if (isset($_POST['form_sent']))
  70. {
  71.     // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
  72.     $result = $db->query('SELECT 1 FROM '.$db->prefix.'users WHERE registration_ip=\''.$db->escape(get_remote_address()).'\' AND registered>'.(time() - 3600)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
  73.  
  74.     if ($db->num_rows($result))
  75.         message($lang_register['Registration flood']);
  76.  
  77. // шифрование данных - Visman
  78.     $cry_time = check_for_crypto();
  79.  
  80.     $username = pun_trim($_POST['req_user']);
  81.                   $badUsername=array( //тут указываем имена пользователей, которые нельзя регистрировать
  82.                       'Анон',
  83.                       'анон'
  84.                   );
  85.                   if(in_array($username, $badUsername))
  86.                         message(sprintf('Имя пользователя «%s» запрещено к регистрации',$username));
  87.     $email1 = strtolower(pun_trim($_POST['req_email1']));
  88.  
  89.     if ($pun_config['o_regs_verify'] == '1')
  90.     {
  91.         $email2 = strtolower(pun_trim($_POST['req_email2']));
  92.  
  93.         $password1 = random_pass(8);
  94.         $password2 = $password1;
  95.     }
  96.     else
  97.     {
  98.         $password1 = pun_trim($_POST['req_password1']);
  99.         $password2 = pun_trim($_POST['req_password2']);
  100.     }
  101.  
  102.     // Validate username and passwords
  103.     check_username($username);
  104.  
  105.     if (pun_strlen($password1) < 4)
  106.         $errors[] = $lang_prof_reg['Pass too short'];
  107.     else if ($password1 != $password2)
  108.         $errors[] = $lang_prof_reg['Pass not match'];
  109.  
  110.     // Validate email
  111.     require PUN_ROOT.'include/email.php';
  112.  
  113.     if (!is_valid_email($email1))
  114.         $errors[] = $lang_common['Invalid email'];
  115.     else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
  116.         $errors[] = $lang_register['Email not match'];
  117.  
  118.     // Check if it's a banned email address
  119.     if (is_banned_email($email1))
  120.     {
  121.         if ($pun_config['p_allow_banned_email'] == '0')
  122.             $errors[] = $lang_prof_reg['Banned email'];
  123.  
  124.         $banned_email = true; // Used later when we send an alert email
  125.     }
  126.     else
  127.         $banned_email = false;
  128.  
  129.     // Check if someone else already has registered with that email address
  130.     $dupe_list = array();
  131.  
  132.     $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());
  133.     if ($db->num_rows($result))
  134.     {
  135.         if ($pun_config['p_allow_dupe_email'] == '0')
  136.             $errors[] = $lang_prof_reg['Dupe email'];
  137.  
  138.         while ($cur_dupe = $db->fetch_assoc($result))
  139.             $dupe_list[] = $cur_dupe['username'];
  140.     }
  141.  
  142.     // Make sure we got a valid language string
  143.     if (isset($_POST['language']))
  144.     {
  145.         $language = preg_replace('%[\.\\\/]%', '', $_POST['language']);
  146.         if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
  147.             message($lang_common['Bad request'], false, '404 Not Found');
  148.     }
  149.     else
  150.         $language = $pun_config['o_default_lang'];
  151.  
  152.     $timezone = round($_POST['timezone'], 1);
  153.     // мод запоминания пароля - Visman
  154.     $save_pass = isset($_POST['save_pass']) ? $_POST['save_pass'] : '0';
  155.  
  156.     $dst = isset($_POST['dst']) ? '1' : '0';
  157.  
  158.     $email_setting = intval($_POST['email_setting']);
  159.     if ($email_setting < 0 || $email_setting > 2)
  160.         $email_setting = $pun_config['o_default_email_setting'];
  161.  
  162.     // проверка на робота - Visman
  163.     if ($pun_config['o_coding_forms'] == '1' && $_POST['form_sent'] != '11')
  164.         $errors = array($lang_sec['Enable JS']);
  165.     else if (empty($_POST['csrf_token']) || empty($_POST['cr']) || empty($_POST['req_user']) || empty($_POST['req_email1']) || !isset($_POST['timezone']))
  166.         $errors = array('Error 1: '.$lang_sec['You are robot']);
  167.     else if (empty($_SERVER['HTTP_ACCEPT_CHARSET']) && empty($_SERVER['HTTP_ACCEPT_ENCODING']) && empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
  168.         $errors = array('Error 2: '.$lang_sec['You are robot']);
  169.     else if ($_POST['csrf_token'] != csrf_hash() || !isset($_POST['tunt']) || $_POST['tunt'] != '9')
  170.         $errors = array('Error 3: '.$lang_sec['You are robot2']);
  171.     else if ($cry_time < 10)
  172.         $errors = array($lang_sec['You fast']);
  173.     else if ($cry_time > 3600)
  174.         $errors = array($lang_sec['You slowly']);
  175.  
  176.     // Did everything go according to plan?
  177.     if (empty($errors))
  178.     {
  179.         // Insert the new user into the database. We do this now to get the last inserted ID for later use
  180.         $now = time();
  181.  
  182.         $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
  183.         $password_hash = pun_hash($password1);
  184.  
  185.         // Add the user
  186.         $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.', \''.$db->escape(get_remote_address()).'\', '.$now.')') or error('Unable to create user', __FILE__, __LINE__, $db->error());
  187.         $new_uid = $db->insert_id();
  188.  
  189.         if ($pun_config['o_regs_verify'] == '0')
  190.         {
  191.             // Regenerate the users info cache
  192.             if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
  193.                 require PUN_ROOT.'include/cache.php';
  194.  
  195.             generate_users_info_cache();
  196.         }
  197.  
  198.         // If the mailing list isn't empty, we may need to send out some alerts
  199.         if ($pun_config['o_mailing_list'] != '')
  200.         {
  201.             // If we previously found out that the email was banned
  202.             if ($banned_email)
  203.             {
  204.                 // Load the "banned email register" template
  205.                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/banned_email_register.tpl'));
  206.  
  207.                 // The first row contains the subject
  208.                 $first_crlf = strpos($mail_tpl, "\n");
  209.                 $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
  210.                 $mail_message = trim(substr($mail_tpl, $first_crlf));
  211.  
  212.                 $mail_message = str_replace('<username>', $username, $mail_message);
  213.                 $mail_message = str_replace('<email>', $email1, $mail_message);
  214.                 $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
  215.                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
  216.  
  217.                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  218.             }
  219.  
  220.             // If we previously found out that the email was a dupe
  221.             if (!empty($dupe_list))
  222.             {
  223.                 // Load the "dupe email register" template
  224.                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/dupe_email_register.tpl'));
  225.  
  226.                 // The first row contains the subject
  227.                 $first_crlf = strpos($mail_tpl, "\n");
  228.                 $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
  229.                 $mail_message = trim(substr($mail_tpl, $first_crlf));
  230.  
  231.                 $mail_message = str_replace('<username>', $username, $mail_message);
  232.                 $mail_message = str_replace('<dupe_list>', implode(', ', $dupe_list), $mail_message);
  233.                 $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
  234.                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
  235.  
  236.                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  237.             }
  238.  
  239.             // Should we alert people on the admin mailing list that a new user has registered?
  240.             if ($pun_config['o_regs_report'] == '1')
  241.             {
  242.                 // Load the "new user" template
  243.                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/new_user.tpl'));
  244.  
  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.  
  250.                 $mail_message = str_replace('<username>', $username, $mail_message);
  251.                 $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
  252.                 $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
  253.                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
  254.  
  255.                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
  256.             }
  257.         }
  258.  
  259.         // Must the user verify the registration or do we log him/her in right now?
  260.         if ($pun_config['o_regs_verify'] == '1')
  261.         {
  262.             // Load the "welcome" template
  263.             $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
  264.  
  265.             // The first row contains the subject
  266.             $first_crlf = strpos($mail_tpl, "\n");
  267.             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
  268.             $mail_message = trim(substr($mail_tpl, $first_crlf));
  269.  
  270.             $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
  271.             $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
  272.             $mail_message = str_replace('<username>', $username, $mail_message);
  273.             $mail_message = str_replace('<password>', $password1, $mail_message);
  274.             $mail_message = str_replace('<login_url>', get_base_url().'/login.php', $mail_message);
  275.             $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
  276.  
  277.             pun_mail($email1, $mail_subject, $mail_message);
  278.  
  279.             message($lang_register['Reg email'].' <a href="mailto:'.pun_htmlspecialchars($pun_config['o_admin_email']).'">'.pun_htmlspecialchars($pun_config['o_admin_email']).'</a>.', true);
  280.         }
  281.  
  282.         pun_setcookie($new_uid, $password_hash, ($save_pass == '1') ? time() + 1209600 : time() + $pun_config['o_timeout_visit']); // мод запоминания пароля - Visman
  283.        
  284.         // удаляем из онлайн таблицы запись для этого пользователя для правильного подсчета макс. кол-во пользователей - Visman
  285.         $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape(get_remote_address()).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
  286.  
  287.         redirect('index.php', $lang_register['Reg complete']);
  288.     }
  289. }
  290.  
  291.  
  292. $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register']);
  293. $required_fields = array(random_for_crypto('req_user') => $lang_common['Username'], random_for_crypto('req_password1') => $lang_common['Password'], random_for_crypto('req_password2') => $lang_prof_reg['Confirm pass'], random_for_crypto('req_email1') => $lang_common['Email'], random_for_crypto('req_email2') => $lang_common['Email'].' 2');
  294. $focus_element = array('register', random_for_crypto('req_user'));
  295. define('PUN_ACTIVE_PAGE', 'register');
  296. require PUN_ROOT.'header.php';
  297.  
  298. $timezone = isset($timezone) ? $timezone : $pun_config['o_default_timezone'];
  299. $dst = isset($dst) ? $dst : $pun_config['o_default_dst'];
  300. $email_setting = isset($email_setting) ? $email_setting : $pun_config['o_default_email_setting'];
  301.  
  302. // If there are errors, we display them
  303. if (!empty($errors))
  304. {
  305.     // мод отслеживания ошибок ввода - Visman
  306.     vsecurity_get(1, 'UserName = '.$username."\n".'Email = '.$email1);
  307.  
  308. ?>
  309. <div id="posterror" class="block">
  310.     <h2><span><?php echo $lang_register['Registration errors'] ?></span></h2>
  311.     <div class="box">
  312.         <div class="inbox error-info">
  313.             <p><?php echo $lang_register['Registration errors info'] ?></p>
  314.             <ul class="error-list">
  315. <?php
  316.  
  317.     foreach ($errors as $cur_error)
  318.         echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
  319. ?>
  320.             </ul>
  321.         </div>
  322.     </div>
  323. </div>
  324.  
  325. <?php
  326.  
  327. }
  328. ?>
  329. <div id="regform" class="blockform">
  330.     <h2><span><?php echo $lang_register['Register'] ?></span></h2>
  331.     <div class="box">
  332.         <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;}">
  333.             <div class="inform">
  334.                 <div class="forminfo">
  335.                     <h3><?php echo $lang_common['Important information'] ?></h3>
  336.                     <p><?php echo $lang_register['Desc 1'] ?></p>
  337.                     <p><?php echo $lang_register['Desc 2'] ?></p>
  338.                 </div>
  339.                 <fieldset>
  340.                     <legend><?php echo $lang_register['Username legend'] ?></legend>
  341.                     <div class="infldset">
  342.                         <input type="hidden" id="form_sent" name="form_sent" value="1" />
  343.                         <label class="required"><strong><?php echo $lang_common['Username'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="text" name="<?php echo random_for_crypto('req_user') ?>" value="<?php if (isset($_POST['req_user'])) echo pun_htmlspecialchars($_POST['req_user']); ?>" size="25" maxlength="25" /><br /></label>
  344.                     </div>
  345.                 </fieldset>
  346.             </div>
  347. <?php if ($pun_config['o_regs_verify'] == '0'): ?>          <div class="inform">
  348.                 <fieldset>
  349.                     <legend><?php echo $lang_register['Pass legend'] ?></legend>
  350.                     <div class="infldset">
  351.                         <label class="conl required"><strong><?php echo $lang_common['Password'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br /><input type="password" name="<?php echo random_for_crypto('req_password1') ?>" value="<?php if (isset($_POST['req_password1'])) echo pun_htmlspecialchars($_POST['req_password1']); ?>" size="16" /><br /></label>
  352.                         <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="<?php echo random_for_crypto('req_password2') ?>" value="<?php if (isset($_POST['req_password2'])) echo pun_htmlspecialchars($_POST['req_password2']); ?>" size="16" /><br /></label>
  353.                         <p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
  354.                     </div>
  355.                 </fieldset>
  356.             </div>
  357. <?php endif; ?>         <div class="inform">
  358.                 <fieldset>
  359.                     <legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['Email legend 2'] : $lang_prof_reg['Email legend'] ?></legend>
  360.                     <div class="infldset">
  361. <?php if ($pun_config['o_regs_verify'] == '1'): ?>                      <p><?php echo $lang_register['Email info'] ?></p>
  362. <?php endif; ?>                     <label class="required"><strong><?php echo $lang_common['Email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
  363.                         <input type="text" name="<?php echo random_for_crypto('req_email1') ?>" value="<?php if (isset($_POST['req_email1'])) echo pun_htmlspecialchars($_POST['req_email1']); ?>" size="50" maxlength="80" /><br /></label>
  364. <?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 />
  365.                         <input type="text" name="<?php echo random_for_crypto('req_email2') ?>" value="<?php if (isset($_POST['req_email2'])) echo pun_htmlspecialchars($_POST['req_email2']); ?>" size="50" maxlength="80" /><br /></label>
  366. <?php endif; ?>                 </div>
  367.                 </fieldset>
  368.             </div>
  369.             <div class="inform">
  370.                 <fieldset>
  371.                     <legend><?php echo $lang_sec['Robot test'] ?></legend>
  372.                     <div class="infldset">
  373.                         <div class="rbox">
  374. <?php if ($pun_config['o_coding_forms'] == '1') {
  375.     $page_js['c'][] = 'document.getElementById("form_sent").value="11";';
  376. ?>
  377.                             <noscript><p style="color: red; font-weight: bold"><?php echo $lang_sec['Enable JS'] ?></p></noscript>
  378. <?php } ?>
  379.                             <label><span class="b64"><?php echo encode_for_js('<input type="checkbox" name="'.random_for_crypto('tunt').'" value="9" />') ?></span><?php echo $lang_sec['Not robot'] ?><br /></label>
  380.                             <span class="b64"><?php echo encode_for_js('<input type="hidden" name="'.random_for_crypto('csrf_token').'" value="'.csrf_hash().'" />') ?></span>
  381.                         </div>
  382.                         <p class="clearb"><?php echo $lang_sec['Robot info'] ?></p>
  383.                     </div>
  384.                 </fieldset>
  385.             </div>
  386.             <div class="inform">
  387.                 <fieldset>
  388.                     <legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
  389.                     <div class="infldset">
  390.                         <p><?php echo $lang_prof_reg['Time zone info'] ?></p>
  391.                         <label><?php echo $lang_prof_reg['Time zone']."\n" ?>
  392.                         <br /><select id="time_zone" name="<?php echo random_for_crypto('timezone') ?>">
  393.                             <option value="-12"<?php if ($timezone == -12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-12:00'] ?></option>
  394.                             <option value="-11"<?php if ($timezone == -11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-11:00'] ?></option>
  395.                             <option value="-10"<?php if ($timezone == -10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-10:00'] ?></option>
  396.                             <option value="-9.5"<?php if ($timezone == -9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:30'] ?></option>
  397.                             <option value="-9"<?php if ($timezone == -9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:00'] ?></option>
  398.                             <option value="-8.5"<?php if ($timezone == -8.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:30'] ?></option>
  399.                             <option value="-8"<?php if ($timezone == -8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:00'] ?></option>
  400.                             <option value="-7"<?php if ($timezone == -7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-07:00'] ?></option>
  401.                             <option value="-6"<?php if ($timezone == -6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-06:00'] ?></option>
  402.                             <option value="-5"<?php if ($timezone == -5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-05:00'] ?></option>
  403.                             <option value="-4"<?php if ($timezone == -4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-04:00'] ?></option>
  404.                             <option value="-3.5"<?php if ($timezone == -3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:30'] ?></option>
  405.                             <option value="-3"<?php if ($timezone == -3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:00'] ?></option>
  406.                             <option value="-2"<?php if ($timezone == -2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-02:00'] ?></option>
  407.                             <option value="-1"<?php if ($timezone == -1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-01:00'] ?></option>
  408.                             <option value="0"<?php if ($timezone == 0) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC'] ?></option>
  409.                             <option value="1"<?php if ($timezone == 1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+01:00'] ?></option>
  410.                             <option value="2"<?php if ($timezone == 2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+02:00'] ?></option>
  411.                             <option value="3"<?php if ($timezone == 3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:00'] ?></option>
  412.                             <option value="3.5"<?php if ($timezone == 3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:30'] ?></option>
  413.                             <option value="4"<?php if ($timezone == 4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:00'] ?></option>
  414.                             <option value="4.5"<?php if ($timezone == 4.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:30'] ?></option>
  415.                             <option value="5"<?php if ($timezone == 5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:00'] ?></option>
  416.                             <option value="5.5"<?php if ($timezone == 5.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:30'] ?></option>
  417.                             <option value="5.75"<?php if ($timezone == 5.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:45'] ?></option>
  418.                             <option value="6"<?php if ($timezone == 6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:00'] ?></option>
  419.                             <option value="6.5"<?php if ($timezone == 6.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:30'] ?></option>
  420.                             <option value="7"<?php if ($timezone == 7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+07:00'] ?></option>
  421.                             <option value="8"<?php if ($timezone == 8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:00'] ?></option>
  422.                             <option value="8.75"<?php if ($timezone == 8.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:45'] ?></option>
  423.                             <option value="9"<?php if ($timezone == 9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:00'] ?></option>
  424.                             <option value="9.5"<?php if ($timezone == 9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:30'] ?></option>
  425.                             <option value="10"<?php if ($timezone == 10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:00'] ?></option>
  426.                             <option value="10.5"<?php if ($timezone == 10.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:30'] ?></option>
  427.                             <option value="11"<?php if ($timezone == 11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:00'] ?></option>
  428.                             <option value="11.5"<?php if ($timezone == 11.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:30'] ?></option>
  429.                             <option value="12"<?php if ($timezone == 12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:00'] ?></option>
  430.                             <option value="12.75"<?php if ($timezone == 12.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:45'] ?></option>
  431.                             <option value="13"<?php if ($timezone == 13) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+13:00'] ?></option>
  432.                             <option value="14"<?php if ($timezone == 14) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+14:00'] ?></option>
  433.                         </select>
  434.                         <br /></label>
  435.                         <div class="rbox">
  436.                             <label><input type="checkbox" name="<?php echo random_for_crypto('dst') ?>" value="1"<?php if ($dst == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['DST'] ?><br /></label>
  437.                         </div>
  438. <?php
  439.  
  440.         $languages = forum_list_langs();
  441.  
  442.         // Only display the language selection box if there's more than one language available
  443.         if (count($languages) > 1)
  444.         {
  445.  
  446. ?>
  447.                             <label><?php echo $lang_prof_reg['Language'] ?>
  448.                             <br /><select name="<?php echo random_for_crypto('language') ?>">
  449. <?php
  450.  
  451.             foreach ($languages as $temp)
  452.             {
  453.                 if ($pun_config['o_default_lang'] == $temp)
  454.                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
  455.                 else
  456.                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
  457.             }
  458.  
  459. ?>
  460.                             </select>
  461.                             <br /></label>
  462. <?php
  463.  
  464.         }
  465. ?>
  466.                     </div>
  467.                 </fieldset>
  468.             </div>
  469.             <div class="inform">
  470.                 <fieldset>
  471.                     <legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
  472.                     <div class="infldset">
  473.                         <p><?php echo $lang_prof_reg['Email setting info'] ?></p>
  474.                         <div class="rbox">
  475.                             <label><input type="radio" name="<?php echo random_for_crypto('email_setting') ?>" value="0"<?php if ($email_setting == '0') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 1'] ?><br /></label>
  476.                             <label><input type="radio" name="<?php echo random_for_crypto('email_setting') ?>" value="1"<?php if ($email_setting == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 2'] ?><br /></label>
  477.                             <label><input type="radio" name="<?php echo random_for_crypto('email_setting') ?>" value="2"<?php if ($email_setting == '2') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Email setting 3'] ?><br /></label>
  478.                         </div>
  479. <?php if ($pun_config['o_regs_verify'] == '0'): ?>                      <p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
  480.                         <div class="rbox">
  481.                             <label><input type="checkbox" name="<?php echo random_for_crypto('save_pass') ?>" value="1"<?php if (isset($save_pass) && $save_pass == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
  482.                         </div>
  483. <?php endif; ?>                 </div>
  484.                     <input type="hidden" name="cr" value="<?php echo random_for_crypto() ?>" />
  485.                 </fieldset>
  486.             </div>
  487.             <p class="buttons"><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
  488.         </form>
  489.     </div>
  490. </div>
  491. <?php
  492.  
  493. require PUN_ROOT.'footer.php';
Advertisement
Add Comment
Please, Sign In to add comment