- // Write catgories
- if ((is_array(REQUEST_POST('cat'))) && (count(REQUEST_POST('cat')))) {
- foreach (REQUEST_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 = translateGender(REQUEST_POST('gender'));
-
- // ... rewrite a zero referal ID to the main title
- if (REQUEST_POST('refid') == '0') REQUEST_SET_POST('refid', constant('MAIN_TITLE'));
-
- // Is ZIP code set?
- if (REQUEST_ISSET_POST('zip')) {
- // Prepare data array for the email template
- // Start with the gender...
- $DATA = array(
- 'hash' => $hash,
- 'uid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE(REQUEST_POST('surname')),
- 'family' => SQL_ESCAPE(REQUEST_POST('family')),
- 'email' => SQL_ESCAPE(REQUEST_POST('addy')),
- 'street' => SQL_ESCAPE(REQUEST_POST('street_nr')),
- 'city' => SQL_ESCAPE(REQUEST_POST('city')),
- 'zip' => bigintval(REQUEST_POST('zip')),
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE(REQUEST_POST('refid')),
- 'pass' => SQL_ESCAPE(REQUEST_POST('pass1')),
- );
- } else {
- // No ZIP code entered
- $DATA = array(
- 'hash' => $hash,
- 'uid' => $userid,
- 'gender' => $gender,
- 'surname' => SQL_ESCAPE(REQUEST_POST('surname')),
- 'family' => SQL_ESCAPE(REQUEST_POST('family')),
- 'email' => SQL_ESCAPE(REQUEST_POST('addy')),
- 'street' => SQL_ESCAPE(REQUEST_POST('street_nr')),
- 'city' => SQL_ESCAPE(REQUEST_POST('city')),
- 'zip' => "",
- 'country' => $countryData,
- 'refid' => SQL_ESCAPE(REQUEST_POST('refid')),
- 'pass' => SQL_ESCAPE(REQUEST_POST('pass1')),
- );
- }
-
- // Continue with birthday...
- switch (getLanguage())
- {
- case 'de':
- $DATA['birthday'] = bigintval(REQUEST_POST('day')).'.'.bigintval(REQUEST_POST('month')).'.'.bigintval(REQUEST_POST('year'));
- break;
-
- default:
- $DATA['birthday'] = bigintval(REQUEST_POST('month')).'/'.bigintval(REQUEST_POST('day')).'/'.bigintval(REQUEST_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'];
- sendEmail ($DATA['email'], getMessage('GUEST_CONFIRM_LINK'), $msg_guest);
- $DATA['email'] = $EMAIL;
-
- // Send mail to admin
- sendAdminNotification(getMessage('ADMIN_NEW_ACCOUNT'), 'register-admin', $DATA, $userid);
-
- // Output success registration
- LOAD_TEMPLATE('admin_settings_saved', false, getMessage('REGISTRATION_DONE'));
-} else {
- if (REQUEST_POST('agree') == '!') {
- registerOutputFailedMessage('HAVE_TO_AGREE');
- } // END - if
-
- if (REQUEST_POST('addy') == '!') {
- registerOutputFailedMessage('ENTER_EMAIL');
- REQUEST_SET_POST('addy', '');
- } elseif (REQUEST_POST('addy') == '?') {
- registerOutputFailedMessage('EMAIL_ALREADY_DB');
- REQUEST_SET_POST('addy', '');
- }
-
- if (REQUEST_POST('surname') == '!') {
- registerOutputFailedMessage('ENTER_SURNAME');
- REQUEST_SET_POST('surname', '');
- } // END - if
-
- if (REQUEST_POST('family') == '!') {
- registerOutputFailedMessage('ENTER_FAMILY');
- REQUEST_SET_POST('family', '');
- } // END - if
-
- if ((REQUEST_POST('pass1') == '!') && (REQUEST_POST('pass2') == '!')) {
- registerOutputFailedMessage('ENTER_BOTH_PASSWORDS');
- } elseif (REQUEST_POST('pass1') == '!') {
- registerOutputFailedMessage('ENTER_PASS1');
- } elseif (REQUEST_POST('pass2') == '!') {
- registerOutputFailedMessage('ENTER_PASS2');
- }
-
- if ($SHORT_PASS === true) {
- registerOutputFailedMessage('SHORT_PASS', ": ".getConfig('pass_len'));
- } // END - if
-
- if ($IP_TIMEOUT === true) {
- registerOutputFailedMessage('REMOTE_ADDR_TIMEOUT');
- } // END - if
-
- if ((!empty($cats)) && ($cats < getConfig('least_cats'))) {
- registerOutputFailedMessage(sprintf(getMessage('CATS_LEAST'), getConfig('least_cats')));
- } // END - if
-