function checkemail() { $emailcount = uc_check_email($this->usermail); if ($emailcount > 0) { return 1; } elseif ($emailcount == -3) { return -4; } else { return -6; } }
if (!checkemail($email)) { $error = true; $sysmsg[] = __('invalid_email'); } else { $rs = $db->fetch_one_array("select email from {$tpf}users where email='{$email}' limit 1"); if ($rs) { if (strcasecmp($email, $rs['email']) == 0) { $error = true; $sysmsg[] = __('email_already_exists'); } unset($rs); } } if (display_plugin('api', 'open_uc_plugin', $settings['connect_uc'], 0)) { if ($settings['connect_uc_type'] == 'phpwind') { $ucresult = uc_check_email($email); if ($ucresult != 1) { $error = true; $sysmsg[] = 'UC:' . __('email_already_exists'); } } else { $ucresult = uc_user_checkemail($email); if ($ucresult < 0) { $error = true; $sysmsg[] = 'UC:' . __('email_already_exists'); } } } if (!$error && display_plugin('api', 'open_uc_plugin', $settings['connect_uc'], 0)) { $uid = uc_user_register($username, $password, $email); if ($uid <= 0) {
function checkemail($email, $ucuid = 0) { $email = trim(strip_tags($email)); $email_len = strlen($email); if ($email_len < 6 || $email_len > 50) { return -4; } if (false == $this->_is_email($email)) { return -4; } #检测邮件白名单 $email_white_list = jconf::get('email_white_list'); if ($email_white_list) { $email_host = substr(strstr($email, '@'), 1); if (!in_array($email_host, $email_white_list)) { return -5; } } if ($GLOBALS['_J']['config']['reg_email_forbid']) { $email_host = strstr($email, '@'); if (false !== stristr($GLOBALS['_J']['config']['reg_email_forbid'], $email_host)) { return -5; } } if (1) { $email = addslashes($email); $row = DB::fetch_first("select `uid` from `" . TABLE_PREFIX . "members` where `email`='{$email}' limit 1"); if ($row) { return -6; } } if (true === UCENTER && $ucuid < 1) { $uc_result = uc_user_checkemail($email); if ($uc_result < 1) { return $uc_result; } } if (true === PWUCENTER && $ucuid < 1) { define('P_W', 'admincp'); include_once ROOT_PATH . 'api/pw_api/security.php'; include_once ROOT_PATH . 'api/pw_api/pw_common.php'; include_once ROOT_PATH . './api/pw_client/uc_client.php'; $uc_result = uc_check_email($email); if ($uc_result < 1) { return $uc_result; } } return 1; }