- // Write catgories
- if ((is_array($_POST['cat'])) && (count($_POST['cat']))) {
- foreach ($_POST['cat'] as $cat => $joined) {
- if ($joined == "Y") {
- // Insert category entry
- $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_user_cats (userid, cat_id) VALUES (%s, %s)",
- array(bigintval($userid), bigintval($cat)), __FILE__, __LINE__);
- } // END - if
- } // END - foreach
- } // END - if
-
- // Rewrite gender
- $gender = TRANSLATE_GENDER($_POST['gender']);
-
- // ... rewrite a zero referal ID to the main title
- if ($_POST['refid'] == "0") $_POST['refid'] = MAIN_TITLE;
-
- // Is ZIP code set?
- if (!empty($_POST['zip'])) {
- // Prepare data array for the email template
- // Start with the gender...
- $DATA = array(
- 'hash' => $hash,
- 'uid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE($_POST['surname']),
- 'family' => SQL_ESCAPE($_POST['family_name']),
- 'email' => SQL_ESCAPE($_POST['addy']),
- 'street' => SQL_ESCAPE($_POST['street_nr']),
- 'city' => SQL_ESCAPE($_POST['city']),
- 'zip' => bigintval($_POST['zip']),
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE($_POST['refid']),
- 'pass' => SQL_ESCAPE($_POST['pass1']),
- );
- } else {
- // No ZIP code entered
- $DATA = array(
- 'hash' => $hash,
- 'uid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE($_POST['surname']),
- 'family' => SQL_ESCAPE($_POST['family_name']),
- 'email' => SQL_ESCAPE($_POST['addy']),
- 'street' => SQL_ESCAPE($_POST['street_nr']),
- 'city' => SQL_ESCAPE($_POST['city']),
- 'zip' => "",
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE($_POST['refid']),
- 'pass' => SQL_ESCAPE($_POST['pass1']),
- );
- }
-
- // Continue with birthday...
- switch (GET_LANGUAGE())
- {
- case "de":
- $DATA['birthday'] = bigintval($_POST['day']).".".bigintval($_POST['month']).".".bigintval($_POST['year']);
- break;
-
- default:
- $DATA['birthday'] = bigintval($_POST['month'])."/".bigintval($_POST['day'])."/".bigintval($_POST['year']);
- break;
- }
-
- // Display information to the user that he got mail and send it away
- $msg_guest = LOAD_EMAIL_TEMPLATE("register-member", $DATA, $userid);
-
- // Send mail to user (confirmation link!)
- $EMAIL = $DATA['email'];
- SEND_EMAIL ($DATA['email'], GUEST_CONFIRM_LINK, $msg_guest);
- $DATA['email'] = $EMAIL;
-
- // Send mail to admin
- SEND_ADMIN_NOTIFICATION(ADMIN_NEW_ACCOUNT, "register-admin", $DATA, $userid);
-
- // Output success registration
- LOAD_TEMPLATE("admin_settings_saved", false, REGISTRATION_DONE);
-} else {
- if ($_POST['agree'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".HAVE_TO_AGREE."</SPAN></STRONG><br /><br />");
- } // END - if
-
- if ($_POST['addy'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_EMAIL."</SPAN></STRONG><br /><br />");
- $_POST['addy'] = "";
- } elseif ($_POST['addy'] == "?") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".EMAIL_ALREADY_DB."</SPAN></STRONG><br /><br />");
- $_POST['addy'] = "";
- }
-
- if ($_POST['surname'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_SURNAME."</SPAN></STRONG><br /><br />");
- $_POST['surname'] = "";
- } // END - if
-
- if ($_POST['family_name'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_FAMILY."</SPAN></STRONG><br /><br />");
- $_POST['family_name'] = "";
- } // END - if
-
- if (($_POST['pass1'] == "!") && ($_POST['pass2'] == "!")) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_BOTH_PASSWORDS."</SPAN></STRONG><br /><br />");
- } elseif ($_POST['pass1'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_PASS1."</SPAN></STRONG><br /><br />");
- } elseif ($_POST['pass2'] == "!") {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".ENTER_PASS2."</SPAN></STRONG><br /><br />");
- }
-
- if ($SHORT_PASS) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".SHORT_PASS.": ".$_CONFIG['pass_len']."</SPAN></STRONG><br /><br />");
- } // END - if
-
- if ($IP_TIMEOUT) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</SPAN></STRONG><br /><br />");
- } // END - if
-
- if ((!empty($cats)) && ($cats < $_CONFIG['least_cats'])) {
- OUTPUT_HTML("<STRONG><SPAN class=\"register_failed\">".CATS_LEAST.": ".$_CONFIG['least_cats']."</SPAN></STRONG><br /><br />");
- } // END - if
-