- ชื่อ: EmailValidator
- ผู้เขียน: [SiNaN]
- นำเสนอโดย: DexMoreGroup
- ประเภท: Registration and Login
- รองรับ: SFMF 1.1.xx, 2.0.xx
- ปรับปรุงล่าสุด: 21 มิถุนายน 2552
- ต้นฉบับ: EmailValidator
รายละเอียด สำหรับตรวจสอบอีเมลของผู้ลงทะเบียนว่าใช้อีเมลปลอมหรือไม่
สำหรับ SMF 1.1.xxแก้ไขไฟล์:file $sourcedir/ManageRegistration.php
ค้นหา -->>
'send_welcomeEmail' => isset($_POST['send_welcomeEmail']) ? 1 : 0,
แก้เป็น -->>
'send_welcomeEmail' => isset($_POST['send_welcomeEmail']) ? 1 : 0,
'validateEmail' => isset($_POST['validateEmail']) ? 1 : 0,
file $sourcedir/Subs-Members.php
ค้นหา -->>
?>
เพิ่มไว้ก่อน -->>
function smf_domain_exists($email, $record = 'MX')
{
list($user,$domain) = split('@',$email);
$function = (function_exists('checkdnsrr') ? '' : 'smf_') . 'checkdnsrr';
return $function($domain, $record);
}
function smf_checkdnsrr($host, $type='')
{
if(!empty($host))
{
if($type == '')
$type = "MX";
exec("nslookup -type=$type $host", $result);
foreach ($result as $line)
{
if(eregi("^$host",$line))
{
return true;
}
}
return false;
}
return false;
}
ค้นหา -->>
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($regOptions['email'])) === 0 || strlen(stripslashes($regOptions['email'])) > 255)
แก้เป็น -->>
if (empty($regOptions['email']) || preg_match('~^[0-9A-Za-z=_+\-/][0-9A-Za-z=_\'+\-/\.]*@[\w\-]+(\.[\w\-]+)*(\.[\w]{2,6})$~', stripslashes($regOptions['email'])) === 0 || strlen(stripslashes($regOptions['email'])) > 255 || (!empty($modSettings['validateEmail']) && smf_domain_exists($regOptions['email']) === false))
file $themedir/Register.template.php
ค้นหา -->>
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"', !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
แก้เป็น -->>
<input type="checkbox" name="send_welcomeEmail" id="send_welcomeEmail_check"', !empty($modSettings['send_welcomeEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
</tr><tr class="windowbg2">
<th width="50%" align="right">
<label for="validateEmail_check">', $txt['admin_setting_validateEmail'], '</label>:
</th>
<td width="50%" align="left">
<input type="checkbox" name="validateEmail" id="validateEmail_check"', !empty($modSettings['validateEmail']) ? ' checked="checked"' : '', ' class="check" />
</td>
file $languagedir/Login.thai-utf8.php
เพิ่ม -->>
$txt['admin_setting_validateEmail'] = 'ตรวจสอบความถูกต้องของอีเมล์';
การตั้งค่า: ผู้ดูแล -->> ศูนย์จัดการลงทะเบียน -->> การตั้งค่า
ลิงค์หัวข้อ:
http://dexmore.com/topic/2498