0ebcfcb29b7264b82834f994f994fe889c8b8ee2
[mailer.git] / inc / modules / guest / what-register.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 10/10/2003 *
4  * ===============                              Last change: 11/26/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-register.php                                *
8  * -------------------------------------------------------------------- *
9  * Short description : Registration form                                *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Anmeldeformular                                  *
12  * -------------------------------------------------------------------- *
13  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
37         require($INC);
38 } elseif ((!EXT_IS_ACTIVE("register"))) {
39         addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "register");
40         return;
41 }
42
43 // Add description as navigation point
44 ADD_DESCR("guest", __FILE__);
45
46 global $DATA;
47
48 // Initialize variables
49 $FAILED = false; $SHORT_PASS = false; $cats = 0; $IP_TIMEOUT = false;
50
51 if (!IS_FORM_SENT()) REQUEST_UNSET_POST('ok');
52
53 if (!REQUEST_ISSET_POST(('agree')))        REQUEST_SET_POST('agree'       , "");
54 if (!REQUEST_ISSET_POST(('addy')))         REQUEST_SET_POST('addy'        , "");
55 if (!REQUEST_ISSET_POST(('surname')))      REQUEST_SET_POST('surname'     , "");
56 if (!REQUEST_ISSET_POST(('family')))       REQUEST_SET_POST('family'      , "");
57 if (!REQUEST_ISSET_POST(('pass1')))        REQUEST_SET_POST('pass1'       , "");
58 if (!REQUEST_ISSET_POST(('pass2')))        REQUEST_SET_POST('pass2'       , "");
59 if (!REQUEST_ISSET_POST(('day')))          REQUEST_SET_POST('day'         , "");
60 if (!REQUEST_ISSET_POST(('month')))        REQUEST_SET_POST('month'       , "");
61 if (!REQUEST_ISSET_POST(('year')))         REQUEST_SET_POST('year'        , "");
62 if (!REQUEST_ISSET_POST(('max_mails')))    REQUEST_SET_POST('max_mails'   , "");
63 if (!REQUEST_ISSET_POST(('street_nr')))    REQUEST_SET_POST('street_nr'   , "");
64 if (!REQUEST_ISSET_POST(('zip')))          REQUEST_SET_POST('zip'         , "");
65 if (!REQUEST_ISSET_POST(('city')))         REQUEST_SET_POST('city'        , "");
66 if (!REQUEST_ISSET_POST(('cntry')))        REQUEST_SET_POST('cntry'       , "");
67 if (!REQUEST_ISSET_POST(('country_code'))) REQUEST_SET_POST('country_code', "1");
68
69 // Default refid is zero
70 REQUEST_SET_POST('refid', 0);
71 if ($GLOBALS['refid'] > 0) {
72         // Test if the refid is valid
73         $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
74                 array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
75
76         // Userid found?
77         //* DEBUG: */ die("refid={$GLOBALS['refid']}/numRows=".SQL_NUMROWS($result)."");
78         if (SQL_NUMROWS($result) == 0) {
79                 // Not found so we set your refid!
80                 REQUEST_SET_POST('refid', getConfig('def_refid'));
81                 set_session('refid', getConfig('def_refid'));
82         } else {
83                 // Use the refid here
84                 REQUEST_SET_POST('refid', $GLOBALS['refid']);
85         }
86 } // END - if
87
88 if (IS_FORM_SENT()) {
89         // First we only check the submitted data then we continue... :)
90         //
91         // Did he agree to our Terms Of Usage?
92         if (REQUEST_POST('agree') != "Y") {
93                 REQUEST_SET_POST('agree', "!");
94                 $FAILED = true;
95         } // END - if
96
97         // Did he enter a valid email address? (we really don't care about
98         // that, he has to click on a confirmation link :P )
99         if ((!REQUEST_ISSET_POST(('addy'))) || (!VALIDATE_EMAIL(REQUEST_POST('addy')))) {
100                 REQUEST_SET_POST('addy', "!");
101                 $FAILED = true;
102         } // END - if
103
104         // And what about surname and family's name?
105         if (!REQUEST_ISSET_POST(('surname'))) {
106                 REQUEST_SET_POST('surname', "!");
107                 $FAILED = true;
108         } // END - if
109         if (!REQUEST_ISSET_POST(('family'))) {
110                 REQUEST_SET_POST('family', "!");
111                 $FAILED = true;
112         } // END - if
113
114         // Check for required fields
115         if (!$FAILED) $FAILED = REGISTER_CHECK_REQUIRED_FIELDS(REQUEST_POST_ARRAY());
116
117         // Did he enter his password twice?
118         if (((!REQUEST_ISSET_POST(('pass1'))) || (!REQUEST_ISSET_POST(('pass2')))) || ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2'))))) {
119                 if ((REQUEST_POST('pass1') != REQUEST_POST('pass2')) && (REQUEST_ISSET_POST(('pass1'))) && (REQUEST_ISSET_POST(('pass2')))) {
120                         REQUEST_SET_POST('pass1', "!");
121                         REQUEST_SET_POST('pass2', "!");
122                 } else {
123                         if (!REQUEST_ISSET_POST(('pass1'))) { REQUEST_SET_POST('pass1', "!"); } else { REQUEST_SET_POST('pass1' ""); }
124                         if (!REQUEST_ISSET_POST(('pass2'))) { REQUEST_SET_POST('pass2', "!"); } else { REQUEST_SET_POST('pass2' ""); }
125                 }
126                 $FAILED = true;
127         } // END - if
128
129         // Is the password long enouth?
130         if ((strlen(REQUEST_POST('pass1')) < getConfig('pass_len')) && (!$FAILED)) {
131                 $SHORT_PASS = true;
132                 $FAILED = true;
133         } // END - if
134
135         // No admin? Admins can always register!
136         if (!IS_ADMIN()) {
137                 // Do this check only when no admin is logged in
138                 foreach (REQUEST_POST('cat') as $id => $answer) {
139                         if ($answer == "Y") $cats++;
140                 } // END - foreach
141
142                 if ($cats < getConfig('least_cats')) {
143                         // ... nope!
144                         $FAILED = true;
145                 } // END - if
146         } // END - if
147
148         if ((REQUEST_POST('addy') != "!") && (getConfig('check_double_email') == "Y")) {
149                 // Does the email address already exists in our database?
150                 $CHK = SEARCH_EMAIL_USERTAB(REQUEST_POST('addy'));
151                 if ($CHK) { REQUEST_SET_POST('addy', "?"); $FAILED = true; }
152         } // END - if
153
154         // Check for IP timeout?
155         if (getConfig('ip_timeout') > 0) {
156                 // Check his IP number
157                 $result = SQL_QUERY_ESC("SELECT joined, last_update FROM `{!_MYSQL_PREFIX!}_user_data` WHERE REMOTE_ADDR='%s' AND (joined > (UNIX_TIMESTAMP() - %s) OR last_update > (UNIX_TIMESTAMP() - %s)) LIMIT 1",
158                         array(GET_REMOTE_ADDR(), getConfig('ip_timeout'), getConfig('ip_timeout')), __FILE__, __LINE__);
159                 if (SQL_NUMROWS($result) == 1) {
160                         // Same IP in timeout range and different email address entered... Eat this, faker! ;-)
161                         // But admins are allowed to fake their own exchange service.
162                         $IP_TIMEOUT = true;
163                         $FAILED = true;
164                 } // END - if
165         } // END - if
166
167         // Free memory
168         SQL_FREERESULT($result);
169 }
170
171 if ((IS_FORM_SENT()) && ((!$FAILED) || (IS_ADMIN()))) {
172         // Prepapre month and day of birth
173         if (strlen(REQUEST_POST('day'))   == 1) REQUEST_POST('day')   = "0".REQUEST_POST('day');
174         if (strlen(REQUEST_POST('month')) == 1) REQUEST_SET_POST('month', "0".REQUEST_POST('month'));
175
176         // Get total ...
177         // ... confirmed, ...
178         $confirmedUsers   = GET_TOTAL_DATA("CONFIRMED", "user_data", "userid", "status", true);
179         // ... unconfirmed ...
180         $unconfirmedUsers = GET_TOTAL_DATA("UNCONFIRMED", "user_data", "userid", "status", true);
181         // ... and locked users!
182         $lockedUsers      = GET_TOTAL_DATA("LOCKED", "user_data", "userid", "status", true);
183
184         // Generate hash which will be inserted into confirmation mail
185         $hash = generateHash(sha1($confirmedUsers.":".$unconfirmedUsers.":".$lockedUsers.":".REQUEST_POST('month')."-".REQUEST_POST('day')."-".REQUEST_POST('year').":".getenv('SERVER_NAME').":".GET_REMOTE_ADDR().":".GET_USER_AGENT()."/".SITE_KEY."/".DATE_KEY."/".RAND_NUMBER));
186
187         // Add design when extension sql_patches is v0.2.7 or greater
188         $ADD1 = ""; $ADD2 = "";
189         if (GET_EXT_VERSION("sql_patches") >= "0.2.7") {
190                 // Okay, add design here
191                 $ADD1 = ", curr_theme";
192                 $ADD2 = ", '".GET_CURR_THEME()."'";
193         } // END - if
194
195         // Check if I shall disable sending mail to newly registered members out about active/begging rallye
196         // @TODO Rewrite this to a single filter
197         //
198         // First comes first: begging rallye
199         if (GET_EXT_VERSION("beg") >= "0.1.7") {
200                 // Okay, shall I disable now?
201                 if (getConfig('beg_new_mem_notify') != "Y") {
202                         $ADD1 .= ", beg_ral_notify, beg_ral_en_notify";
203                         $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
204                 } // END - if
205         } // END - if
206
207         // Second: active rallye
208         if (GET_EXT_VERSION("bonus") >= "0.7.7") {
209                 // Okay, shall I disable now?
210                 if (getConfig('bonus_new_mem_notify') != "Y") {
211                         $ADD1 .= ", bonus_ral_notify, bonus_ral_en_notify";
212                         $ADD2 .= ", UNIX_TIMESTAMP(), UNIX_TIMESTAMP()";
213                 } // END - if
214         } // END - if
215
216         // Write user data to table
217         if (EXT_IS_ACTIVE("country")) {
218                 // Save with new selectable country code
219                 $countryRow = "country_code";
220                 $countryData = bigintval(REQUEST_POST('country_code'));
221         } else {
222                 // Old way with enterable two-char-code
223                 $countryRow = "country";
224                 $countryData = substr(REQUEST_POST('cntry'), 0, 2);
225         }
226
227         //////////////////////////////
228         // Create user's account... //
229         //////////////////////////////
230         //
231         SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_data` (gender, surname, family, street_nr,%s, zip, city, email, birth_day, birth_month, birth_year, password, max_mails, receive_mails, refid, status, user_hash, REMOTE_ADDR, joined, last_update".$ADD1.")
232 VALUES ('%s','%s','%s','%s','%s',%s,'%s','%s',%s, %s,%s,'%s',%s, %s,'%s','UNCONFIRMED','%s','%s', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()".$ADD2.")",
233         array(
234                 $countryRow,
235                 substr(REQUEST_POST('gender'), 0, 1),
236                 REQUEST_POST('surname'),
237                 REQUEST_POST('family'),
238                 REQUEST_POST('street_nr'),
239                 $countryData,
240                 bigintval(REQUEST_POST('zip')),
241                 REQUEST_POST('city'),
242                 REQUEST_POST('addy'),
243                 bigintval(REQUEST_POST('day')),
244                 bigintval(REQUEST_POST('month')),
245                 bigintval(REQUEST_POST('year')),
246                 generateHash(REQUEST_POST('pass1')),
247                 bigintval(REQUEST_POST('max_mails')),
248                 bigintval(REQUEST_POST('max_mails')),
249                 bigintval(REQUEST_POST('refid')),
250                 $hash,
251                 GET_REMOTE_ADDR(),
252         ), __FILE__, __LINE__);
253
254         // Get his userid
255         $userid = SQL_INSERTID();
256
257         // Did this work?
258         if ($userid == 0) {
259                 // Something bad happened!
260                 LOAD_TEMPLATE("admin_settings_saved", false, getMessage('USER_NOT_REGISTERED'));
261                 return;
262         } // END - if
263
264         // Is the refback extension there?
265         if (EXT_IS_ACTIVE("refback")) {
266                 // Update refback table
267                 UPDATE_REFBACK_TABLE($userid);
268         } // END - if
269
270         // Write his welcome-points
271         $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_points` WHERE userid=%s AND ref_depth=0 LIMIT 1",
272          array(bigintval($userid)), __FILE__, __LINE__);
273         if (SQL_NUMROWS($result) == 0) {
274                 // Add only when the line was not found (maybe some more secure?)
275                 $locked = "points";
276                 if (getConfig('ref_payout') > 0) $locked = "locked_points"; // Pay him later. First he has to confirm some mails!
277                 SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_points` (userid, ref_depth, ".$locked.") VALUES (%s,0,'%s')",
278                  array(bigintval($userid), getConfig('points_register')), __FILE__, __LINE__);
279
280                 // Update mediadata as well
281                 if ((GET_EXT_VERSION("mediadata") >= "0.0.4") && ($locked == "points")) {
282                         // Update database
283                         MEDIA_UPDATE_ENTRY(array("total_points"), "add", getConfig('points_register'));
284                 } // END - if
285         } // END - if
286
287         // Write catgories
288         if ((is_array(REQUEST_POST('cat'))) && (count(REQUEST_POST('cat')))) {
289                 foreach (REQUEST_POST('cat') as $cat => $joined) {
290                         if ($joined == "Y") {
291                                 // Insert category entry
292                                 SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES (%s, %s)",
293                                  array(bigintval($userid), bigintval($cat)), __FILE__, __LINE__);
294                         } // END - if
295                 } // END - foreach
296         } // END - if
297
298         // Rewrite gender
299         $gender = TRANSLATE_GENDER(REQUEST_POST('gender'));
300
301         // ... rewrite a zero referal ID to the main title
302         if (REQUEST_POST('refid') == "0") REQUEST_SET_POST('refid', constant('MAIN_TITLE'));
303
304         // Is ZIP code set?
305         if (REQUEST_ISSET_POST(('zip'))) {
306                 // Prepare data array for the email template
307                 // Start with the gender...
308                 $DATA = array(
309                         'hash'    => $hash,
310                         'uid'     => $userid,
311                         'gender'  => $gender,
312                         'surname' => SQL_ESCAPE(REQUEST_POST('surname')),
313                         'family'  => SQL_ESCAPE(REQUEST_POST('family')),
314                         'email'   => SQL_ESCAPE(REQUEST_POST('addy')),
315                         'street'  => SQL_ESCAPE(REQUEST_POST('street_nr')),
316                         'city'    => SQL_ESCAPE(REQUEST_POST('city')),
317                         'zip'     => bigintval(REQUEST_POST('zip')),
318                         'country' => $countryData,
319                         'refid'   => SQL_ESCAPE(REQUEST_POST('refid')),
320                         'pass'    => SQL_ESCAPE(REQUEST_POST('pass1')),
321                 );
322         } else {
323                 // No ZIP code entered
324                 $DATA = array(
325                         'hash'    => $hash,
326                         'uid'     => $userid,
327                         'gender'  => $gender,
328                         'surname' => SQL_ESCAPE(REQUEST_POST('surname')),
329                         'family'  => SQL_ESCAPE(REQUEST_POST('family')),
330                         'email'   => SQL_ESCAPE(REQUEST_POST('addy')),
331                         'street'  => SQL_ESCAPE(REQUEST_POST('street_nr')),
332                         'city'    => SQL_ESCAPE(REQUEST_POST('city')),
333                         'zip'     => "",
334                         'country' => $countryData,
335                         'refid'   => SQL_ESCAPE(REQUEST_POST('refid')),
336                         'pass'    => SQL_ESCAPE(REQUEST_POST('pass1')),
337                 );
338         }
339
340         // Continue with birthday...
341         switch (GET_LANGUAGE())
342         {
343         case "de":
344                 $DATA['birthday'] = bigintval(REQUEST_POST('day')).".".bigintval(REQUEST_POST('month')).".".bigintval(REQUEST_POST('year'));
345                 break;
346
347         default:
348                 $DATA['birthday'] = bigintval(REQUEST_POST('month'))."/".bigintval(REQUEST_POST('day'))."/".bigintval(REQUEST_POST('year'));
349                 break;
350         }
351
352         // Display information to the user that he got mail and send it away
353         $msg_guest = LOAD_EMAIL_TEMPLATE("register-member", $DATA, $userid);
354
355         // Send mail to user (confirmation link!)
356         $EMAIL = $DATA['email'];
357         SEND_EMAIL ($DATA['email'], getMessage('GUEST_CONFIRM_LINK'), $msg_guest);
358         $DATA['email'] = $EMAIL;
359
360         // Send mail to admin
361         SEND_ADMIN_NOTIFICATION(getMessage('ADMIN_NEW_ACCOUNT'), "register-admin", $DATA, $userid);
362
363         // Output success registration
364         LOAD_TEMPLATE("admin_settings_saved", false, getMessage('REGISTRATION_DONE'));
365 } else {
366         if (REQUEST_POST('agree') == "!") {
367                 OUTPUT_HTML("<div class=\"register_failed\">{--HAVE_TO_AGREE--}</div>");
368         } // END - if
369
370         if (REQUEST_POST('addy') == "!") {
371                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_EMAIL--}</div>");
372                 REQUEST_SET_POST('addy', "");
373         } elseif (REQUEST_POST('addy') == "?") {
374                 OUTPUT_HTML("<div class=\"register_failed\">{--EMAIL_ALREADY_DB--}</div>");
375                 REQUEST_SET_POST('addy', "");
376         }
377
378         if (REQUEST_POST('surname') == "!") {
379                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_SURNAME--}</div>");
380                 REQUEST_SET_POST('surname', "");
381         } // END - if
382
383         if (REQUEST_POST('family') == "!") {
384                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_FAMILY--}</div>");
385                 REQUEST_SET_POST('family', "");
386         } // END - if
387
388         if ((REQUEST_POST('pass1') == "!") && (REQUEST_POST('pass2') == "!")) {
389                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_BOTH_PASSWORDS--}</div>");
390         } elseif (REQUEST_POST('pass1') == "!") {
391                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_PASS1--}</div>");
392         } elseif (REQUEST_POST('pass2') == "!") {
393                 OUTPUT_HTML("<div class=\"register_failed\">{--ENTER_PASS2--}</div>");
394         }
395
396         if ($SHORT_PASS === true) {
397                 OUTPUT_HTML("<div class=\"register_failed\">{--SHORT_PASS--}: ".getConfig('pass_len')."</div>");
398         } // END - if
399
400         if ($IP_TIMEOUT === true) {
401                 OUTPUT_HTML("<div class=\"register_failed\">{--REMOTE_ADDR_TIMEOUT--}</div>");
402         } // END - if
403
404         if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
405                 OUTPUT_HTML("<div class=\"register_failed\">{--CATS_LEAST--}: ".getConfig('least_cats')."</div>");
406         } // END - if
407
408         // Generate birthday selection
409         switch (GET_LANGUAGE())
410         {
411         case "de": // German date format
412                 define('BIRTHDAY_SELECTION', ADD_SELECTION("day", REQUEST_POST('day')).ADD_SELECTION("month", REQUEST_POST('month')).ADD_SELECTION("year", REQUEST_POST('year')));
413                 break;
414
415         default: // Default is the US date format... :)
416                 define('BIRTHDAY_SELECTION', ADD_SELECTION("month", REQUEST_POST('month')).ADD_SELECTION("day", REQUEST_POST('day')).ADD_SELECTION("year", REQUEST_POST('year')));
417                 break;
418         }
419
420         // Adds a table for the guests with all visible categories
421         define('CATEGORY_SELECTION', REGISTER_ADD_CATEGORY_TABLE("guest", true));
422
423         // Adds maximum receiveable mails list... :)
424         define('MAX_RECEIVE_LIST', ADD_MAX_RECEIVE_LIST("guest", "", true));
425
426         // Shall I display the refid or shall I make it editable?
427         if (getConfig('display_refid') == "Y") {
428                 // Load "hide" form template
429                 define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid_hide", true, $GLOBALS['refid']));
430         } else {
431                 // Load template to enter it
432                 define('REFID_CONTENT', LOAD_TEMPLATE("guest_register_refid", true, $GLOBALS['refid']));
433         }
434
435         // You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
436         define('REGISTER_HEADER_CONTENT', LOAD_TEMPLATE("register_header", true));
437
438         // Please select at least x categories
439         define('LEAST_CATS_VALUE', getConfig('least_cats'));
440
441         // Other values
442         define('__SURNAME', SQL_ESCAPE(REQUEST_POST('surname')));
443         define('__FAMILY',  SQL_ESCAPE(REQUEST_POST('family')));
444         define('__STREET',  SQL_ESCAPE(REQUEST_POST('street_nr')));
445         define('__COUNTRY', SQL_ESCAPE(REQUEST_POST('cntry')));
446         if (REQUEST_ISSET_POST(('zip'))) {
447                 define('__ZIP', bigintval(REQUEST_POST('zip')));
448         } else {
449                 define('__ZIP', "");
450         }
451         define('__CITY',    SQL_ESCAPE(REQUEST_POST('city')));
452         define('__ADDY',    SQL_ESCAPE(REQUEST_POST('addy')));
453
454         // Shall I add a counrty selection box or the old input box?
455         if (EXT_IS_ACTIVE("country")) {
456                 // New variant, good!
457                 $OUT  = "<select name=\"country_code\" class=\"guest_select\" size=\"1\">\n";
458                 $whereStatement = "WHERE is_active='Y'";
459                 if (IS_ADMIN()) $whereStatement = "";
460                 $OUT .= ADD_OPTION_LINES("countries", "id", "descr", REQUEST_POST('country_code'), "code", $whereStatement);
461                 $OUT .= "</select>";
462                 define('__COUNTRY_CONTENT', $OUT);
463         } else {
464                 // Old out-dated variant
465                 define('__COUNTRY_CONTENT', "<input type=\"text\" name=\"cntry\" class=\"guest_normal\" size=\"2\" maxlength=\"3\" value=\"{!__COUNTRY!}\" />");
466         }
467
468         // Set MUST_??? constants
469         if ((EXT_IS_ACTIVE("register")) && (GET_EXT_VERSION("register") > "0.0")) REGISTER_FILL_MUST_CONSTANTS();
470
471         // Display registration form
472         LOAD_TEMPLATE("guest_register");
473 }
474
475 //
476 ?>