Changeset 1524 in ExiteCMS for trunk/register.php
- Timestamp:
- 07/05/08 12:58:33 (4 years ago)
- File:
-
- 1 edited
-
trunk/register.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/register.php
r1449 r1524 17 17 require_once PATH_INCLUDES."dns_functions.php"; 18 18 19 // do we want extensive email checks? 20 define('CHECK_EMAIL', true); 21 19 22 // temp storage for template variables 20 23 $variables = array(); … … 38 41 $user_info = unserialize($data['user_info']); 39 42 $activation = $settings['admin_activation'] == "1" ? "2" : "0"; 40 $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_fullname, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_ theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status, user_newsletters) VALUES('".$user_info['user_name']."', '".$user_info['user_fullname']."', '".md5(md5($user_info['user_password']))."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', 'Default', '".$user_info['user_offset']."', '', '', '0', '".time()."', '".time()."', '".USER_IP."', '', '', '101', '$activation', '1')");43 $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_fullname, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_locale, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status, user_newsletters) VALUES('".$user_info['user_name']."', '".$user_info['user_fullname']."', '".md5(md5($user_info['user_password']))."', '".$user_info['user_email']."', '".$user_info['user_hide_email']."', '', '0000-00-00', '', '', '', '', '', '".$settings['locale']."', 'Default', '".$user_info['user_offset']."', '', '', '0', '".time()."', '".time()."', '".USER_IP."', '', '', '101', '$activation', '1')"); 41 44 $result = dbquery("DELETE FROM ".$db_prefix."new_users WHERE user_code='$activate'"); 42 45 if ($settings['admin_activation'] == "1") { … … 74 77 } 75 78 76 $email_domain = substr(strrchr($email, "@"), 1); 77 if (CMS_getmxrr($email_domain, $mxhosts)) { 78 // Get the hostname the MX record points to 79 $mailhost = $mxhosts[0]; 80 } else { 81 // No MX record for this domain. Might be a hostname that accepts email 82 $mailhost = $email_domain; 83 } 84 $mailhost_ip = gethostbyname($mailhost); 85 if ($mailhost != $mailhost_ip) { 86 // found the mailserver for this email address. Check if the address exists 87 require_once PATH_INCLUDES.'smtp_include.php'; 88 $mail = new SMTP(); 89 if (!$mail->Connect($mailhost_ip, 0, 60)) { // default SMTP port, 60sec timeout 90 // mail server doesn't respond 91 $error .= sprintf($locale['413'], $email_domain)."<br /><br />\n"; 92 } else { 93 if (!$mail->Hello(substr(strrchr($settings['siteemail'], "@"), 1))) { 94 // mail server doesn't respond to HELLO message 79 if (CHECK_EMAIL) { 80 $email_domain = substr(strrchr($email, "@"), 1); 81 if (CMS_getmxrr($email_domain, $mxhosts)) { 82 // Get the hostname the MX record points to 83 $mailhost = $mxhosts[0]; 84 } else { 85 // No MX record for this domain. Might be a hostname that accepts email 86 $mailhost = $email_domain; 87 } 88 $mailhost_ip = gethostbyname($mailhost); 89 if ($mailhost != $mailhost_ip) { 90 // found the mailserver for this email address. Check if the address exists 91 require_once PATH_INCLUDES.'smtp_include.php'; 92 $mail = new SMTP(); 93 if (!$mail->Connect($mailhost_ip, 0, 60)) { // default SMTP port, 60sec timeout 94 // mail server doesn't respond 95 95 $error .= sprintf($locale['413'], $email_domain)."<br /><br />\n"; 96 96 } else { 97 if (!$mail-> Mail('address-validation'.strrchr($settings['siteemail'], "@"))) {98 // mail server doesn't respond to MAIL FROMmessage97 if (!$mail->Hello(substr(strrchr($settings['siteemail'], "@"), 1))) { 98 // mail server doesn't respond to HELLO message 99 99 $error .= sprintf($locale['413'], $email_domain)."<br /><br />\n"; 100 100 } else { 101 if (!$mail-> CheckRecipient($email)) {102 // mail server doesn't respond to RCPT TOmessage103 $error .= sprintf($locale['41 4'], $email, $mailhost)."<br /><br />\n";101 if (!$mail->Mail('address-validation'.strrchr($settings['siteemail'], "@"))) { 102 // mail server doesn't respond to MAIL FROM message 103 $error .= sprintf($locale['413'], $email_domain)."<br /><br />\n"; 104 104 } else { 105 // email address is accepted 105 if (!$mail->CheckRecipient($email)) { 106 // mail server doesn't respond to RCPT TO message 107 $error .= sprintf($locale['414'], $email, $mailhost)."<br /><br />\n"; 108 } else { 109 // email address is accepted 110 } 106 111 } 107 112 } 113 $mail->Quit(); 108 114 } 109 $mail->Quit(); 110 } 111 } else { 112 $error .= sprintf($locale['412'], $email_domain)."<br /><br />\n"; 113 } 114 115 } else { 116 $error .= sprintf($locale['412'], $email_domain)."<br /><br />\n"; 117 } 118 } 119 115 120 $result = dbquery("SELECT * FROM ".$db_prefix."blacklist WHERE blacklist_email='".$email."' OR blacklist_email='$email_domain'"); 116 121 if (dbrows($result) != 0) $error .= $locale['411']."<br /><br />\n"; … … 161 166 $user_sig = isset($_POST['user_sig']) ? stripinput(trim($_POST['user_sig'])) : ""; 162 167 } 168 error_reporting(E_ALL); 163 169 if ($error == "") { 164 170 if ($settings['email_verification'] == "1") { … … 193 199 } else { 194 200 $activation = $settings['admin_activation'] == "1" ? "2" : "0"; 195 $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_ offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('$username', md5(md5('".$password1."')), '".$email."', '$user_hide_email', '$user_location', '$user_birthdate', '$user_aim', '$user_icq', '$user_msn', '$user_yahoo', '$user_web', '$user_theme', '$user_offset', '', '$user_sig', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')");201 $result = dbquery("INSERT INTO ".$db_prefix."users (user_name, user_password, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_theme, user_locale, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES('$username', md5(md5('".$password1."')), '".$email."', '$user_hide_email', '$user_location', '$user_birthdate', '$user_aim', '$user_icq', '$user_msn', '$user_yahoo', '$user_web', '$user_theme', '".$settings['locale']."', '$user_offset', '', '$user_sig', '0', '".time()."', '0', '".USER_IP."', '', '', '101', '$activation')"); 196 202 if ($settings['admin_activation'] == "1") { 197 203 $variables['message'] = $locale['453']; 204 // send the webmaster a PM that an account needs to be activated 205 $result = dbquery("INSERT INTO ".$db_prefix."pm (pm_subject, pm_message, pm_recipients, pm_size, pm_datestamp) VALUES ('".$locale['509']."', '".mysql_escape_string(sprintf($locale['510'], $username))."', '1', '100', '".time()."')"); 206 if ($result) { 207 $pm_id = mysql_insert_id(); 208 $result = dbquery("INSERT INTO ".$db_prefix."pm_index (pm_id, pmindex_user_id, pmindex_from_id, pmindex_to_id, pmindex_folder) VALUES ('".$pm_id."', '1', '1', '1', '0')"); 209 } 198 210 } else { 199 211 $variables['message'] = $locale['452'];
Note: See TracChangeset
for help on using the changeset viewer.
