1 | <?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', './'); |
---|
27 | require PUN_ROOT.'include/common.php'; |
---|
28 | |
---|
29 | |
---|
30 | // If we are logged in, we shouldn't be here |
---|
31 | if (!$pun_user['is_guest']) |
---|
32 | { |
---|
33 | header('Location: index.php'); |
---|
34 | exit; |
---|
35 | } |
---|
36 | |
---|
37 | // Load the register.php language file |
---|
38 | require PUN_ROOT.'lang/'.$pun_user['language'].'/register.php'; |
---|
39 | |
---|
40 | // Load the register.php/profile.php language file |
---|
41 | require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php'; |
---|
42 | |
---|
43 | if ($pun_config['o_regs_allow'] == '0') |
---|
44 | message($lang_register['No new regs']); |
---|
45 | |
---|
46 | |
---|
47 | // User pressed the cancel button |
---|
48 | if (isset($_GET['cancel'])) |
---|
49 | redirect('index.php', $lang_register['Reg cancel redirect']); |
---|
50 | |
---|
51 | |
---|
52 | else if ($pun_config['o_rules'] == '1' && !isset($_GET['agree']) && !isset($_POST['form_sent'])) |
---|
53 | { |
---|
54 | $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_register['Register']; |
---|
55 | require PUN_ROOT.'header.php'; |
---|
56 | |
---|
57 | ?> |
---|
58 | <div class="blockform"> |
---|
59 | <h2><span><?php echo $lang_register['Forum rules'] ?></span></h2> |
---|
60 | <div class="box"> |
---|
61 | <form method="get" action="register.php"> |
---|
62 | <div class="inform"> |
---|
63 | <fieldset> |
---|
64 | <legend><?php echo $lang_register['Rules legend'] ?></legend> |
---|
65 | <div class="infldset"> |
---|
66 | <p><?php echo $pun_config['o_rules_message'] ?></p> |
---|
67 | </div> |
---|
68 | </fieldset> |
---|
69 | </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> |
---|
71 | </form> |
---|
72 | </div> |
---|
73 | </div> |
---|
74 | <?php |
---|
75 | |
---|
76 | require PUN_ROOT.'footer.php'; |
---|
77 | } |
---|
78 | |
---|
79 | |
---|
80 | else if (isset($_POST['form_sent'])) |
---|
81 | { |
---|
82 | $username = pun_trim($_POST['req_username']); |
---|
83 | $email1 = strtolower(trim($_POST['req_email1'])); |
---|
84 | |
---|
85 | if ($pun_config['o_regs_verify'] == '1') |
---|
86 | { |
---|
87 | $email2 = strtolower(trim($_POST['req_email2'])); |
---|
88 | |
---|
89 | $password1 = random_pass(8); |
---|
90 | $password2 = $password1; |
---|
91 | } |
---|
92 | else |
---|
93 | { |
---|
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); |
---|
100 | |
---|
101 | // 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']); |
---|
108 | 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 |
---|
138 | require PUN_ROOT.'include/email.php'; |
---|
139 | |
---|
140 | if (!is_valid_email($email1)) |
---|
141 | message($lang_common['Invalid e-mail']); |
---|
142 | 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 |
---|
146 | if (is_banned_email($email1)) |
---|
147 | { |
---|
148 | 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 |
---|
152 | } |
---|
153 | else |
---|
154 | $banned_email = false; |
---|
155 | |
---|
156 | // Check if someone else already has registered with that e-mail address |
---|
157 | $dupe_list = array(); |
---|
158 | |
---|
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()); |
---|
160 | if ($db->num_rows($result)) |
---|
161 | { |
---|
162 | if ($pun_config['p_allow_dupe_email'] == '0') |
---|
163 | message($lang_prof_reg['Dupe e-mail']); |
---|
164 | |
---|
165 | while ($cur_dupe = $db->fetch_assoc($result)) |
---|
166 | $dupe_list[] = $cur_dupe['username']; |
---|
167 | } |
---|
168 | |
---|
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'; |
---|
172 | |
---|
173 | $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']); |
---|
240 | } |
---|
241 | |
---|
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'); |
---|
245 | require PUN_ROOT.'header.php'; |
---|
246 | |
---|
247 | ?> |
---|
248 | <div class="blockform"> |
---|
249 | <h2><span><?php echo $lang_register['Register'] ?></span></h2> |
---|
250 | <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;}"> |
---|
253 | <div class="inform"> |
---|
254 | <div class="forminfo"> |
---|
255 | <h3><?php echo $lang_common['Important information'] ?></h3> |
---|
256 | <p><?php echo $lang_register['Desc 1'] ?></p> |
---|
257 | <p><?php echo $lang_register['Desc 2'] ?></p> |
---|
258 | </div> |
---|
259 | <fieldset> |
---|
260 | <legend><?php echo $lang_register['Username legend'] ?></legend> |
---|
261 | <div class="infldset"> |
---|
262 | <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> |
---|
264 | </div> |
---|
265 | </fieldset> |
---|
266 | </div> |
---|
267 | <?php if ($pun_config['o_regs_verify'] == '0'): ?> <div class="inform"> |
---|
268 | <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> |
---|
273 | <p class="clearb"><?php echo $lang_register['Pass info'] ?></p> |
---|
274 | </div> |
---|
275 | </fieldset> |
---|
276 | </div> |
---|
277 | <?php endif; ?> <div class="inform"> |
---|
278 | <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> |
---|
286 | <?php endif; ?> </div> |
---|
287 | </fieldset> |
---|
288 | </div> |
---|
289 | <div class="inform"> |
---|
290 | <fieldset> |
---|
291 | <legend><?php echo $lang_prof_reg['Localisation legend'] ?></legend> |
---|
292 | <div class="infldset"> |
---|
293 | <label><?php echo $lang_prof_reg['Timezone'] ?>: <?php echo $lang_prof_reg['Timezone info'] ?> |
---|
294 | <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> |
---|
332 | </select> |
---|
333 | <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(); |
---|
344 | |
---|
345 | // Only display the language selection box if there's more than one language available |
---|
346 | if (count($languages) > 1) |
---|
347 | { |
---|
348 | |
---|
349 | ?> |
---|
350 | <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?> |
---|
351 | <br /><select name="language"> |
---|
352 | <?php |
---|
353 | |
---|
354 | while (list(, $temp) = @each($languages)) |
---|
355 | { |
---|
356 | if ($pun_config['o_default_lang'] == $temp) |
---|
357 | echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n"; |
---|
358 | else |
---|
359 | echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n"; |
---|
360 | } |
---|
361 | |
---|
362 | ?> |
---|
363 | </select> |
---|
364 | <br /></label> |
---|
365 | <?php |
---|
366 | |
---|
367 | } |
---|
368 | ?> |
---|
369 | </div> |
---|
370 | </fieldset> |
---|
371 | </div> |
---|
372 | <div class="inform"> |
---|
373 | <fieldset> |
---|
374 | <legend><?php echo $lang_prof_reg['Privacy options legend'] ?></legend> |
---|
375 | <div class="infldset"> |
---|
376 | <p><?php echo $lang_prof_reg['E-mail setting info'] ?></p> |
---|
377 | <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> |
---|
385 | </div> |
---|
386 | </div> |
---|
387 | </fieldset> |
---|
388 | </div> |
---|
389 | <p><input type="submit" name="register" value="<?php echo $lang_register['Register'] ?>" /></p> |
---|
390 | </form> |
---|
391 | </div> |
---|
392 | </div> |
---|
393 | <?php |
---|
394 | |
---|
395 | require PUN_ROOT.'footer.php'; |
---|