Ignore:
Timestamp:
Nov 14, 2011, 11:17:15 PM (12 years ago)
Author:
dj3c1t
Message:

passage a Fluxbb 1.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/rsr.v5.1.dev/web/punbb/register.php

    r1 r3  
    11<?php
    2 /***********************************************************************
    3 
    4   Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
    5 
    6   This file is part of PunBB.
    7 
    8   PunBB is free software; you can redistribute it and/or modify it
    9   under the terms of the GNU General Public License as published
    10   by the Free Software Foundation; either version 2 of the License,
    11   or (at your option) any later version.
    12 
    13   PunBB is distributed in the hope that it will be useful, but
    14   WITHOUT ANY WARRANTY; without even the implied warranty of
    15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16   GNU General Public License for more details.
    17 
    18   You should have received a copy of the GNU General Public License
    19   along with this program; if not, write to the Free Software
    20   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
    21   MA  02111-1307  USA
    22 
    23 ************************************************************************/
    24 
    25 
    26 define('PUN_ROOT', './');
     2
     3/**
     4 * Copyright (C) 2008-2011 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
     9define('PUN_ROOT', dirname(__FILE__).'/');
    2710require PUN_ROOT.'include/common.php';
    2811
     
    5235else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent']))
    5336{
    54         $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
     37        $page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register'], $lang_register['Forum rules']);
     38        define('PUN_ACTIVE_PAGE', 'register');
    5539        require PUN_ROOT.'header.php';
    5640
    5741?>
    58 <div class="blockform">
    59         <h2><span><?php echo $lang_register['Forum rules'] ?></span></h2>
     42<div id="rules" class="blockform">
     43        <div class="hd"><h2><span><?php echo $lang_register['Forum rules'] ?></span></h2></div>
    6044        <div class="box">
    6145                <form method="get" action="register.php">
     
    6448                                        <legend><?php echo $lang_register['Rules legend'] ?></legend>
    6549                                        <div class="infldset">
    66                                                 <p><?php echo $pun_config['o_rules_message'] ?></p>
     50                                                <div class="usercontent"><?php echo $pun_config['o_rules_message'] ?></div>
    6751                                        </div>
    6852                                </fieldset>
    6953                        </div>
    70                         <p><input type="submit" name="agree" value="<?php echo $lang_register['Agree'] ?>" /><input type="submit" name="cancel" value="<?php echo $lang_register['Cancel'] ?>" /></p>
     54                        <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>
    7155                </form>
    7256        </div>
     
    7761}
    7862
    79 
    80 else if (isset($_POST['form_sent']))
     63// Start with a clean slate
     64$errors = array();
     65
     66if (isset($_POST['form_sent']))
    8167{
    82         $username = pun_trim($_POST['req_username']);
     68        // Check that someone from this IP didn't register a user within the last hour (DoS prevention)
     69        $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());
     70
     71        if ($db->num_rows($result))
     72                message($lang_register['Registration flood']);
     73
     74
     75        $username = pun_trim($_POST['req_user']);
    8376        $email1 = strtolower(trim($_POST['req_email1']));
    8477
     
    9285        else
    9386        {
    94                 $password1 = trim($_POST['req_password1']);
    95                 $password2 = trim($_POST['req_password2']);
    96         }
    97 
    98         // Convert multiple whitespace characters into one (to prevent people from registering with indistinguishable usernames)
    99         $username = preg_replace('#\s+#s', ' ', $username);
     87                $password1 = pun_trim($_POST['req_password1']);
     88                $password2 = pun_trim($_POST['req_password2']);
     89        }
    10090
    10191        // Validate username and passwords
    102         if (strlen($username) < 2)
    103                 message($lang_prof_reg['Username too short']);
    104         else if (pun_strlen($username) > 25)    // This usually doesn't happen since the form element only accepts 25 characters
    105             message($lang_common['Bad request']);
    106         else if (strlen($password1) < 4)
    107                 message($lang_prof_reg['Pass too short']);
     92        check_username($username);
     93
     94        if (pun_strlen($password1) < 4)
     95                $errors[] = $lang_prof_reg['Pass too short'];
    10896        else if ($password1 != $password2)
    109                 message($lang_prof_reg['Pass not match']);
    110         else if (!strcasecmp($username, 'invité') || !strcasecmp($username, $lang_common['Guest']))
    111                 message($lang_prof_reg['Username guest']);
    112         else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username))
    113                 message($lang_prof_reg['Username IP']);
    114         else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
    115                 message($lang_prof_reg['Username reserved chars']);
    116         else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username))
    117                 message($lang_prof_reg['Username BBCode']);
    118 
    119         // Check username for any censored words
    120         if ($pun_config['o_censoring'] == '1')
    121         {
    122                 // If the censored username differs from the username
    123                 if (censor_words($username) != $username)
    124                         message($lang_register['Username censor']);
    125         }
    126 
    127         // Check that the username (or a too similar username) is not already registered
    128         $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE UPPER(username)=UPPER(\''.$db->escape($username).'\') OR UPPER(username)=UPPER(\''.$db->escape(preg_replace('/[^\w]/', '', $username)).'\')') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
    129 
    130         if ($db->num_rows($result))
    131         {
    132                 $busy = $db->result($result);
    133                 message($lang_register['Username dupe 1'].' '.pun_htmlspecialchars($busy).'. '.$lang_register['Username dupe 2']);
    134         }
    135 
    136 
    137         // Validate e-mail
     97                $errors[] = $lang_prof_reg['Pass not match'];
     98
     99        // Validate email
    138100        require PUN_ROOT.'include/email.php';
    139101
    140102        if (!is_valid_email($email1))
    141                 message($lang_common['Invalid e-mail']);
     103                $errors[] = $lang_common['Invalid email'];
    142104        else if ($pun_config['o_regs_verify'] == '1' && $email1 != $email2)
    143                 message($lang_register['E-mail not match']);
    144 
    145         // Check it it's a banned e-mail address
     105                $errors[] = $lang_register['Email not match'];
     106
     107        // Check if it's a banned email address
    146108        if (is_banned_email($email1))
    147109        {
    148110                if ($pun_config['p_allow_banned_email'] == '0')
    149                         message($lang_prof_reg['Banned e-mail']);
    150 
    151                 $banned_email = true;   // Used later when we send an alert e-mail
     111                        $errors[] = $lang_prof_reg['Banned email'];
     112
     113                $banned_email = true; // Used later when we send an alert email
    152114        }
    153115        else
    154116                $banned_email = false;
    155117
    156         // Check if someone else already has registered with that e-mail address
     118        // Check if someone else already has registered with that email address
    157119        $dupe_list = array();
    158120
    159         $result = $db->query('SELECT username FROM '.$db->prefix.'users WHERE email=\''.$email1.'\'') or error('Impossible de retrouver les informations utilisateur', __FILE__, __LINE__, $db->error());
     121        $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());
    160122        if ($db->num_rows($result))
    161123        {
    162124                if ($pun_config['p_allow_dupe_email'] == '0')
    163                         message($lang_prof_reg['Dupe e-mail']);
     125                        $errors[] = $lang_prof_reg['Dupe email'];
    164126
    165127                while ($cur_dupe = $db->fetch_assoc($result))
     
    167129        }
    168130
    169         $timezone = intval($_POST['timezone']);
    170         $language = isset($_POST['language']) ? $_POST['language'] : $pun_config['o_default_lang'];
    171         $save_pass = (!isset($_POST['save_pass']) || $_POST['save_pass'] != '1') ? '0' : '1';
     131        // Make sure we got a valid language string
     132        if (isset($_POST['language']))
     133        {
     134                $language = preg_replace('%[\.\\\/]%', '', $_POST['language']);
     135                if (!file_exists(PUN_ROOT.'lang/'.$language.'/common.php'))
     136                        message($lang_common['Bad request']);
     137        }
     138        else
     139                $language = $pun_config['o_default_lang'];
     140
     141        $timezone = round($_POST['timezone'], 1);
     142
     143        $dst = isset($_POST['dst']) ? '1' : '0';
    172144
    173145        $email_setting = intval($_POST['email_setting']);
    174         if ($email_setting < 0 || $email_setting > 2) $email_setting = 1;
    175 
    176         // Insert the new user into the database. We do this now to get the last inserted id for later use.
    177         $now = time();
    178 
    179         $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
    180         $password_hash = pun_hash($password1);
    181 
    182         // Add the user
    183         $db->query('INSERT INTO '.$db->prefix.'users (username, group_id, password, email, email_setting, save_pass, timezone, language, style, registered, registration_ip, last_visit) VALUES(\''.$db->escape($username).'\', '.$intial_group_id.', \''.$password_hash.'\', \''.$email1.'\', '.$email_setting.', '.$save_pass.', '.$timezone.' , \''.$db->escape($language).'\', \''.$pun_config['o_default_style'].'\', '.$now.', \''.get_remote_address().'\', '.$now.')') or error('Impossible de créer un utilisateur', __FILE__, __LINE__, $db->error());
    184         $new_uid = $db->insert_id();
    185 
    186 
    187         // If we previously found out that the e-mail was banned
    188         if ($banned_email && $pun_config['o_mailing_list'] != '')
    189         {
    190                 $mail_subject = 'Alerte - Adresse e-mail bannis détectée';
    191                 $mail_message = 'L\'utilisateur \''.$username.'\' s\est inscrit avec l\'adresse e-mail bannis : '.$email1."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne répondez pas à ce message)';
    192 
    193                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    194         }
    195 
    196         // If we previously found out that the e-mail was a dupe
    197         if (!empty($dupe_list) && $pun_config['o_mailing_list'] != '')
    198         {
    199                 $mail_subject = 'Alerte - Adresse e-mail en doublon détéctée';
    200                 $mail_message = 'L\'utilisateur \''.$username.'\' s\'est inscrit avec l\'adresse qui appartient également à : '.implode(', ', $dupe_list)."\n\n".'User profile: '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne répondez pas à ce message)';
    201 
    202                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    203         }
    204 
    205         // Should we alert people on the admin mailing list that a new user has registered?
    206         if ($pun_config['o_regs_report'] == '1')
    207         {
    208                 $mail_subject = 'Alerte - Nouvelle inscription';
    209                 $mail_message = 'L\'utilisateur \''.$username.'\' registered in the forums at '.$pun_config['o_base_url']."\n\n".'Profil utilisateur : '.$pun_config['o_base_url'].'/profile.php?id='.$new_uid."\n\n".'-- '."\n".'E-mail automatique'."\n".'(Ne répondez pas à ce message)';
    210 
    211                 pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
    212         }
    213 
    214         // Must the user verify the registration or do we log him/her in right now?
    215         if ($pun_config['o_regs_verify'] == '1')
    216         {
    217                 // Load the "welcome" template
    218                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
    219 
    220                 // The first row contains the subject
    221                 $first_crlf = strpos($mail_tpl, "\n");
    222                 $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
    223                 $mail_message = trim(substr($mail_tpl, $first_crlf));
    224 
    225                 $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
    226                 $mail_message = str_replace('<base_url>', $pun_config['o_base_url'].'/', $mail_message);
    227                 $mail_message = str_replace('<username>', $username, $mail_message);
    228                 $mail_message = str_replace('<password>', $password1, $mail_message);
    229                 $mail_message = str_replace('<login_url>', $pun_config['o_base_url'].'/login.php', $mail_message);
    230                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
    231 
    232                 pun_mail($email1, $mail_subject, $mail_message);
    233 
    234                 message($lang_register['Reg e-mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
    235         }
    236 
    237         pun_setcookie($new_uid, $password_hash, ($save_pass != '0') ? $now + 31536000 : 0);
    238 
    239         redirect(isset($_GET["from"]) ? urldecode($_GET["from"]) : "index.php", $lang_register['Reg complete']);
     146        if ($email_setting < 0 || $email_setting > 2)
     147                $email_setting = $pun_config['o_default_email_setting'];
     148
     149        // Did everything go according to plan?
     150        if (empty($errors))
     151        {
     152                // Insert the new user into the database. We do this now to get the last inserted ID for later use
     153                $now = time();
     154
     155                $intial_group_id = ($pun_config['o_regs_verify'] == '0') ? $pun_config['o_default_user_group'] : PUN_UNVERIFIED;
     156                $password_hash = pun_hash($password1);
     157
     158                // Add the user
     159                $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());
     160                $new_uid = $db->insert_id();
     161
     162                // If the mailing list isn't empty, we may need to send out some alerts
     163                if ($pun_config['o_mailing_list'] != '')
     164                {
     165                        // If we previously found out that the email was banned
     166                        if ($banned_email)
     167                        {
     168                                // Load the "banned email register" template
     169                                $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/banned_email_register.tpl'));
     170
     171                                // The first row contains the subject
     172                                $first_crlf = strpos($mail_tpl, "\n");
     173                                $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
     174                                $mail_message = trim(substr($mail_tpl, $first_crlf));
     175
     176                                $mail_message = str_replace('<username>', $username, $mail_message);
     177                                $mail_message = str_replace('<email>', $email1, $mail_message);
     178                                $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
     179                                $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
     180
     181                                pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
     182                        }
     183
     184                        // If we previously found out that the email was a dupe
     185                        if (!empty($dupe_list))
     186                        {
     187                                // Load the "dupe email register" template
     188                                $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/dupe_email_register.tpl'));
     189
     190                                // The first row contains the subject
     191                                $first_crlf = strpos($mail_tpl, "\n");
     192                                $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
     193                                $mail_message = trim(substr($mail_tpl, $first_crlf));
     194
     195                                $mail_message = str_replace('<username>', $username, $mail_message);
     196                                $mail_message = str_replace('<dupe_list>', implode(', ', $dupe_list), $mail_message);
     197                                $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
     198                                $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
     199
     200                                pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
     201                        }
     202
     203                        // Should we alert people on the admin mailing list that a new user has registered?
     204                        if ($pun_config['o_regs_report'] == '1')
     205                        {
     206                                // Load the "new user" template
     207                                $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/new_user.tpl'));
     208
     209                                // The first row contains the subject
     210                                $first_crlf = strpos($mail_tpl, "\n");
     211                                $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
     212                                $mail_message = trim(substr($mail_tpl, $first_crlf));
     213
     214                                $mail_message = str_replace('<username>', $username, $mail_message);
     215                                $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
     216                                $mail_message = str_replace('<profile_url>', get_base_url().'/profile.php?id='.$new_uid, $mail_message);
     217                                $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
     218
     219                                pun_mail($pun_config['o_mailing_list'], $mail_subject, $mail_message);
     220                        }
     221                }
     222
     223                // Must the user verify the registration or do we log him/her in right now?
     224                if ($pun_config['o_regs_verify'] == '1')
     225                {
     226                        // Load the "welcome" template
     227                        $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/welcome.tpl'));
     228
     229                        // The first row contains the subject
     230                        $first_crlf = strpos($mail_tpl, "\n");
     231                        $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
     232                        $mail_message = trim(substr($mail_tpl, $first_crlf));
     233
     234                        $mail_subject = str_replace('<board_title>', $pun_config['o_board_title'], $mail_subject);
     235                        $mail_message = str_replace('<base_url>', get_base_url().'/', $mail_message);
     236                        $mail_message = str_replace('<username>', $username, $mail_message);
     237                        $mail_message = str_replace('<password>', $password1, $mail_message);
     238                        $mail_message = str_replace('<login_url>', get_base_url().'/login.php', $mail_message);
     239                        $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'], $mail_message);
     240
     241                        pun_mail($email1, $mail_subject, $mail_message);
     242
     243                        message($lang_register['Reg email'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true);
     244                }
     245
     246                // Regenerate the users info cache
     247                if (!defined('FORUM_CACHE_FUNCTIONS_LOADED'))
     248                        require PUN_ROOT.'include/cache.php';
     249
     250                generate_users_info_cache();
     251
     252                pun_setcookie($new_uid, $password_hash, time() + $pun_config['o_timeout_visit']);
     253
     254                redirect('index.php', $lang_register['Reg complete']);
     255        }
    240256}
    241257
    242 $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register'];
    243 $required_fields = array('req_username' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['E-mail'], 'req_email2' => $lang_common['E-mail'].' 2');
    244 $focus_element = array('register', 'req_username');
     258
     259$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']), $lang_register['Register']);
     260$required_fields = array('req_user' => $lang_common['Username'], 'req_password1' => $lang_common['Password'], 'req_password2' => $lang_prof_reg['Confirm pass'], 'req_email1' => $lang_common['Email'], 'req_email2' => $lang_common['Email'].' 2');
     261$focus_element = array('register', 'req_user');
     262define('PUN_ACTIVE_PAGE', 'register');
    245263require PUN_ROOT.'header.php';
    246264
    247 ?>
    248 <div class="blockform">
     265$timezone = isset($timezone) ? $timezone : $pun_config['o_default_timezone'];
     266$dst = isset($dst) ? $dst : $pun_config['o_default_dst'];
     267$email_setting = isset($email_setting) ? $email_setting : $pun_config['o_default_email_setting'];
     268
     269// If there are errors, we display them
     270if (!empty($errors))
     271{
     272
     273?>
     274<div id="posterror" class="block">
     275        <h2><span><?php echo $lang_register['Registration errors'] ?></span></h2>
     276        <div class="box">
     277                <div class="inbox error-info">
     278                        <p><?php echo $lang_register['Registration errors info'] ?></p>
     279                        <ul class="error-list">
     280<?php
     281
     282        foreach ($errors as $cur_error)
     283                echo "\t\t\t\t".'<li><strong>'.$cur_error.'</strong></li>'."\n";
     284?>
     285                        </ul>
     286                </div>
     287        </div>
     288</div>
     289
     290<?php
     291
     292}
     293?>
     294<div id="regform" class="blockform">
    249295        <h2><span><?php echo $lang_register['Register'] ?></span></h2>
    250296        <div class="box">
    251   <form id="register" method="post" action="register.php?action=register<?php echo isset($_GET["from"]) ? "&from=".$_GET["from"] : ""; ?>"
    252                       onsubmit="this.register.disabled=true;if(process_form(this)){return true;}else{this.register.disabled=false;return false;}">
     297                <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;}">
    253298                        <div class="inform">
    254299                                <div class="forminfo">
     
    261306                                        <div class="infldset">
    262307                                                <input type="hidden" name="form_sent" value="1" />
    263                                                 <label><strong><?php echo $lang_common['Username'] ?></strong><br /><input type="text" name="req_username" size="25" maxlength="25" /><br /></label>
     308                                                <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>
    264309                                        </div>
    265310                                </fieldset>
     
    267312<?php if ($pun_config['o_regs_verify'] == '0'): ?>                      <div class="inform">
    268313                                <fieldset>
    269                                         <legend><?php echo $lang_register['Pass legend 1'] ?></legend>
    270                                         <div class="infldset">
    271                                                 <label class="conl"><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password1" size="16" maxlength="16" /><br /></label>
    272                                                 <label class="conl"><strong><?php echo $lang_prof_reg['Confirm pass'] ?></strong><br /><input type="password" name="req_password2" size="16" maxlength="16" /><br /></label>
     314                                        <legend><?php echo $lang_register['Pass legend'] ?></legend>
     315                                        <div class="infldset">
     316                                                <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>
     317                                                <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>
    273318                                                <p class="clearb"><?php echo $lang_register['Pass info'] ?></p>
    274319                                        </div>
     
    277322<?php endif; ?>                 <div class="inform">
    278323                                <fieldset>
    279                                         <legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['E-mail legend 2'] : $lang_prof_reg['E-mail legend'] ?></legend>
    280                                         <div class="infldset">
    281 <?php if ($pun_config['o_regs_verify'] == '1'): ?>                      <p><?php echo $lang_register['E-mail info'] ?></p>
    282 <?php endif; ?>                                 <label><strong><?php echo $lang_common['E-mail'] ?></strong><br />
    283                                                 <input type="text" name="req_email1" size="50" maxlength="50" /><br /></label>
    284 <?php if ($pun_config['o_regs_verify'] == '1'): ?>                                              <label><strong><?php echo $lang_register['Confirm e-mail'] ?></strong><br />
    285                                                 <input type="text" name="req_email2" size="50" maxlength="50" /><br /></label>
     324                                        <legend><?php echo ($pun_config['o_regs_verify'] == '1') ? $lang_prof_reg['Email legend 2'] : $lang_prof_reg['Email legend'] ?></legend>
     325                                        <div class="infldset">
     326<?php if ($pun_config['o_regs_verify'] == '1'): ?>                                              <p><?php echo $lang_register['Email info'] ?></p>
     327<?php endif; ?>                                         <label class="required"><strong><?php echo $lang_common['Email'] ?> <span><?php echo $lang_common['Required'] ?></span></strong><br />
     328                                                <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>
     329<?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 />
     330                                                <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>
    286331<?php endif; ?>                                 </div>
    287332                                </fieldset>
     
    291336                                        <legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend>
    292337                                        <div class="infldset">
    293                                                 <label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?>
     338                                                <p><?php echo $lang_prof_reg['Time zone info'] ?></p>
     339                                                <label><?php echo $lang_prof_reg['Time zone']."\n" ?>
    294340                                                <br /><select id="time_zone" name="timezone">
    295                                                         <option value="-12"<?php if ($pun_config['o_server_timezone'] == -12 ) echo ' selected="selected"' ?>>-12</option>
    296                                                         <option value="-11"<?php if ($pun_config['o_server_timezone'] == -11) echo ' selected="selected"' ?>>-11</option>
    297                                                         <option value="-10"<?php if ($pun_config['o_server_timezone'] == -10) echo ' selected="selected"' ?>>-10</option>
    298                                                         <option value="-9.5"<?php if ($pun_config['o_server_timezone'] == -9.5) echo ' selected="selected"' ?>>-9.5</option>
    299                                                         <option value="-9"<?php if ($pun_config['o_server_timezone'] == -9 ) echo ' selected="selected"' ?>>-09</option>
    300                                                         <option value="-8.5"<?php if ($pun_config['o_server_timezone'] == -8.5) echo ' selected="selected"' ?>>-8.5</option>
    301                                                         <option value="-8"<?php if ($pun_config['o_server_timezone'] == -8 ) echo ' selected="selected"' ?>>-08 PST</option>
    302                                                         <option value="-7"<?php if ($pun_config['o_server_timezone'] == -7 ) echo ' selected="selected"' ?>>-07 MST</option>
    303                                                         <option value="-6"<?php if ($pun_config['o_server_timezone'] == -6 ) echo ' selected="selected"' ?>>-06 CST</option>
    304                                                         <option value="-5"<?php if ($pun_config['o_server_timezone'] == -5 ) echo ' selected="selected"' ?>>-05 EST</option>
    305                                                         <option value="-4"<?php if ($pun_config['o_server_timezone'] == -4 ) echo ' selected="selected"' ?>>-04 AST</option>
    306                                                         <option value="-3.5"<?php if ($pun_config['o_server_timezone'] == -3.5) echo ' selected="selected"' ?>>-3.5</option>
    307                                                         <option value="-3"<?php if ($pun_config['o_server_timezone'] == -3 ) echo ' selected="selected"' ?>>-03 ADT</option>
    308                                                         <option value="-2"<?php if ($pun_config['o_server_timezone'] == -2 ) echo ' selected="selected"' ?>>-02</option>
    309                                                         <option value="-1"<?php if ($pun_config['o_server_timezone'] == -1) echo ' selected="selected"' ?>>-01</option>
    310                                                         <option value="0"<?php if ($pun_config['o_server_timezone'] == 0) echo ' selected="selected"' ?>>00 GMT</option>
    311                                                         <option value="1"<?php if ($pun_config['o_server_timezone'] == 1) echo ' selected="selected"' ?>>+01 CET</option>
    312                                                         <option value="2"<?php if ($pun_config['o_server_timezone'] == 2 ) echo ' selected="selected"' ?>>+02</option>
    313                                                         <option value="3"<?php if ($pun_config['o_server_timezone'] == 3 ) echo ' selected="selected"' ?>>+03</option>
    314                                                         <option value="3.5"<?php if ($pun_config['o_server_timezone'] == 3.5 ) echo ' selected="selected"' ?>>+03.5</option>
    315                                                         <option value="4"<?php if ($pun_config['o_server_timezone'] == 4 ) echo ' selected="selected"' ?>>+04</option>
    316                                                         <option value="4.5"<?php if ($pun_config['o_server_timezone'] == 4.5 ) echo ' selected="selected"' ?>>+04.5</option>
    317                                                         <option value="5"<?php if ($pun_config['o_server_timezone'] == 5 ) echo ' selected="selected"' ?>>+05</option>
    318                                                         <option value="5.5"<?php if ($pun_config['o_server_timezone'] == 5.5 ) echo ' selected="selected"' ?>>+05.5</option>
    319                                                         <option value="6"<?php if ($pun_config['o_server_timezone'] == 6 ) echo ' selected="selected"' ?>>+06</option>
    320                                                         <option value="6.5"<?php if ($pun_config['o_server_timezone'] == 6.5 ) echo ' selected="selected"' ?>>+06.5</option>
    321                                                         <option value="7"<?php if ($pun_config['o_server_timezone'] == 7 ) echo ' selected="selected"' ?>>+07</option>
    322                                                         <option value="8"<?php if ($pun_config['o_server_timezone'] == 8 ) echo ' selected="selected"' ?>>+08</option>
    323                                                         <option value="9"<?php if ($pun_config['o_server_timezone'] == 9 ) echo ' selected="selected"' ?>>+09</option>
    324                                                         <option value="9.5"<?php if ($pun_config['o_server_timezone'] == 9.5 ) echo ' selected="selected"' ?>>+09.5</option>
    325                                                         <option value="10"<?php if ($pun_config['o_server_timezone'] == 10) echo ' selected="selected"' ?>>+10</option>
    326                                                         <option value="10.5"<?php if ($pun_config['o_server_timezone'] == 10.5 ) echo ' selected="selected"' ?>>+10.5</option>
    327                                                         <option value="11"<?php if ($pun_config['o_server_timezone'] == 11) echo ' selected="selected"' ?>>+11</option>
    328                                                         <option value="11.5"<?php if ($pun_config['o_server_timezone'] == 11.5 ) echo ' selected="selected"' ?>>+11.5</option>
    329                                                         <option value="12"<?php if ($pun_config['o_server_timezone'] == 12 ) echo ' selected="selected"' ?>>+12</option>
    330                                                         <option value="13"<?php if ($pun_config['o_server_timezone'] == 13 ) echo ' selected="selected"' ?>>+13</option>
    331                                                         <option value="14"<?php if ($pun_config['o_server_timezone'] == 14 ) echo ' selected="selected"' ?>>+14</option>
     341                                                        <option value="-12"<?php if ($timezone == -12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-12:00'] ?></option>
     342                                                        <option value="-11"<?php if ($timezone == -11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-11:00'] ?></option>
     343                                                        <option value="-10"<?php if ($timezone == -10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-10:00'] ?></option>
     344                                                        <option value="-9.5"<?php if ($timezone == -9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:30'] ?></option>
     345                                                        <option value="-9"<?php if ($timezone == -9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-09:00'] ?></option>
     346                                                        <option value="-8.5"<?php if ($timezone == -8.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:30'] ?></option>
     347                                                        <option value="-8"<?php if ($timezone == -8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-08:00'] ?></option>
     348                                                        <option value="-7"<?php if ($timezone == -7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-07:00'] ?></option>
     349                                                        <option value="-6"<?php if ($timezone == -6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-06:00'] ?></option>
     350                                                        <option value="-5"<?php if ($timezone == -5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-05:00'] ?></option>
     351                                                        <option value="-4"<?php if ($timezone == -4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-04:00'] ?></option>
     352                                                        <option value="-3.5"<?php if ($timezone == -3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:30'] ?></option>
     353                                                        <option value="-3"<?php if ($timezone == -3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-03:00'] ?></option>
     354                                                        <option value="-2"<?php if ($timezone == -2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-02:00'] ?></option>
     355                                                        <option value="-1"<?php if ($timezone == -1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC-01:00'] ?></option>
     356                                                        <option value="0"<?php if ($timezone == 0) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC'] ?></option>
     357                                                        <option value="1"<?php if ($timezone == 1) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+01:00'] ?></option>
     358                                                        <option value="2"<?php if ($timezone == 2) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+02:00'] ?></option>
     359                                                        <option value="3"<?php if ($timezone == 3) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:00'] ?></option>
     360                                                        <option value="3.5"<?php if ($timezone == 3.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+03:30'] ?></option>
     361                                                        <option value="4"<?php if ($timezone == 4) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:00'] ?></option>
     362                                                        <option value="4.5"<?php if ($timezone == 4.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+04:30'] ?></option>
     363                                                        <option value="5"<?php if ($timezone == 5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:00'] ?></option>
     364                                                        <option value="5.5"<?php if ($timezone == 5.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:30'] ?></option>
     365                                                        <option value="5.75"<?php if ($timezone == 5.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+05:45'] ?></option>
     366                                                        <option value="6"<?php if ($timezone == 6) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:00'] ?></option>
     367                                                        <option value="6.5"<?php if ($timezone == 6.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+06:30'] ?></option>
     368                                                        <option value="7"<?php if ($timezone == 7) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+07:00'] ?></option>
     369                                                        <option value="8"<?php if ($timezone == 8) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:00'] ?></option>
     370                                                        <option value="8.75"<?php if ($timezone == 8.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+08:45'] ?></option>
     371                                                        <option value="9"<?php if ($timezone == 9) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:00'] ?></option>
     372                                                        <option value="9.5"<?php if ($timezone == 9.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+09:30'] ?></option>
     373                                                        <option value="10"<?php if ($timezone == 10) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:00'] ?></option>
     374                                                        <option value="10.5"<?php if ($timezone == 10.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+10:30'] ?></option>
     375                                                        <option value="11"<?php if ($timezone == 11) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:00'] ?></option>
     376                                                        <option value="11.5"<?php if ($timezone == 11.5) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+11:30'] ?></option>
     377                                                        <option value="12"<?php if ($timezone == 12) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:00'] ?></option>
     378                                                        <option value="12.75"<?php if ($timezone == 12.75) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+12:45'] ?></option>
     379                                                        <option value="13"<?php if ($timezone == 13) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+13:00'] ?></option>
     380                                                        <option value="14"<?php if ($timezone == 14) echo ' selected="selected"' ?>><?php echo $lang_prof_reg['UTC+14:00'] ?></option>
    332381                                                </select>
    333382                                                <br /></label>
    334 <?php
    335 
    336                 $languages = array();
    337                 $d = dir(PUN_ROOT.'lang');
    338                 while (($entry = $d->read()) !== false)
    339                 {
    340                         if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
    341                                 $languages[] = $entry;
    342                 }
    343                 $d->close();
     383                                                <div class="rbox">
     384                                                        <label><input type="checkbox" name="dst" value="1"<?php if ($dst == '1') echo ' checked="checked"' ?> /><?php echo $lang_prof_reg['DST'] ?><br /></label>
     385                                                </div>
     386<?php
     387
     388                $languages = forum_list_langs();
    344389
    345390                // Only display the language selection box if there's more than one language available
     
    348393
    349394?>
    350                                                         <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
     395                                                        <label><?php echo $lang_prof_reg['Language'] ?>
    351396                                                        <br /><select name="language">
    352397<?php
    353398
    354                         while (list(, $temp) = @each($languages))
     399                        foreach ($languages as $temp)
    355400                        {
    356401                                if ($pun_config['o_default_lang'] == $temp)
     
    374419                                        <legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend>
    375420                                        <div class="infldset">
    376                                                 <p><?php echo $lang_prof_reg['E-mail setting info'] ?></p>
     421                                                <p><?php echo $lang_prof_reg['Email setting info'] ?></p>
    377422                                                <div class="rbox">
    378                                                         <label><input type="radio" name="email_setting" value="0" /><?php echo $lang_prof_reg['E-mail setting 1'] ?><br /></label>
    379                                                         <label><input type="radio" name="email_setting" value="1" checked="checked" /><?php echo $lang_prof_reg['E-mail setting 2'] ?><br /></label>
    380                                                         <label><input type="radio" name="email_setting" value="2" /><?php echo $lang_prof_reg['E-mail setting 3'] ?><br /></label>
    381                                                 </div>
    382                                                 <p><?php echo $lang_prof_reg['Save user/pass info'] ?></p>
    383                                                 <div class="rbox">
    384                                                         <label><input type="checkbox" name="save_pass" value="1" checked="checked" /><?php echo $lang_prof_reg['Save user/pass'] ?><br /></label>
     423                                                        <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>
     424                                                        <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>
     425                                                        <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>
    385426                                                </div>
    386427                                        </div>
    387428                                </fieldset>
    388429                        </div>
    389                         <p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
     430                        <p class="buttons"><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p>
    390431                </form>
    391432        </div>
Note: See TracChangeset for help on using the changeset viewer.