- // Write catgories
- if ((is_array($_POST['cat'])) && (count($_POST['cat']))) {
- foreach ($_POST['cat'] as $cat => $joined) {
- if ($joined == "Y") {
- // Insert category entry
- 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("<div class=\"register_failed\">".HAVE_TO_AGREE."</div>");
- } // END - if
-
- if ($_POST['addy'] == "!") {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_EMAIL."</div>");
- $_POST['addy'] = "";
- } elseif ($_POST['addy'] == "?") {
- OUTPUT_HTML("<div class=\"register_failed\">".EMAIL_ALREADY_DB."</div>");
- $_POST['addy'] = "";
- }
-
- if ($_POST['surname'] == "!") {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_SURNAME."</div>");
- $_POST['surname'] = "";
- } // END - if
-
- if ($_POST['family_name'] == "!") {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_FAMILY."</div>");
- $_POST['family_name'] = "";
- } // END - if
-
- if (($_POST['pass1'] == "!") && ($_POST['pass2'] == "!")) {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_BOTH_PASSWORDS."</div>");
- } elseif ($_POST['pass1'] == "!") {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_PASS1."</div>");
- } elseif ($_POST['pass2'] == "!") {
- OUTPUT_HTML("<div class=\"register_failed\">".ENTER_PASS2."</div>");
- }
-
- if ($SHORT_PASS) {
- OUTPUT_HTML("<div class=\"register_failed\">".SHORT_PASS.": ".getConfig('pass_len')."</div>");
- } // END - if
-
- if ($IP_TIMEOUT) {
- OUTPUT_HTML("<div class=\"register_failed\">".REMOTE_ADDR_TIMEOUT."</div>");
- } // END - if
-
- if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
- OUTPUT_HTML("<div class=\"register_failed\">".CATS_LEAST.": ".getConfig('least_cats')."</div>");
- } // END - if
-