public function isValidEmail_invite($email, $old_email = null)
{
$res = preg_match($this->_email_reg, $email, $matches) !== 0;
if (!$res) {
$this->_error = L('PUBLIC_EMAIL_TIPS');
// 无效的Email地址
} elseif (!empty($this->_config['email_suffix'])) {
$res = in_array($matches['1'], explode(',', $this->_config['email_suffix']));
// !$res && $this->_error =L('PUBLIC_EMAIL_SUFFIX_FORBIDDEN'); // 邮箱后缀不允许注册
!$res && ($this->_error = '该邮箱后缀不允许注册');
// 邮箱后缀不允许注册
}
if ($res && $email != $old_email && $this->_user_model->where('`email`="' . mysql_escape_string($email) . '"')->find()) {
$this->_error = L('PUBLIC_ACCOUNT_REGISTERED');
// 该用户已注册
$res = false;
}
return (bool) $res;
}