사용할수 없는 메일도메인 작동하도록 수정

This commit is contained in:
gnuboard
2013-01-18 15:46:22 +09:00
parent 3d98886bd4
commit 835f632da6
4 changed files with 32 additions and 3 deletions

View File

@ -67,6 +67,8 @@ if ($w == '' || $w == 'u') {
if ($msg = reserve_mb_nick($mb_nick)) alert($msg);
if ($msg = valid_mb_name($mb_name)) alert($msg);
if ($msg = valid_mb_nick($mb_nick)) alert($msg);
if ($msg = valid_mb_email($mb_email)) alert($msg);
if ($msg = prohibit_mb_email($mb_email))alert($msg);
if ($w=='') {
if ($msg = exist_mb_id($mb_id)) alert($msg);

View File

@ -104,6 +104,19 @@ function valid_mb_email($reg_mb_email)
return "";
}
// 금지 메일 도메인 검사
function prohibit_mb_email($reg_mb_email)
{
global $config;
list($id, $domain) = explode("@", $reg_mb_email);
$email_domains = explode("\n", trim($config['cf_prohibit_email']));
for ($i=0; $i<count($email_domains); $i++) {
if (strtolower($domain) == strtolower($email_domains[$i]))
return "$domain 메일은 사용할 수 없습니다.";
}
return "";
}
function exist_mb_email($reg_mb_email, $reg_mb_id)
{
global $g4;

View File

@ -7,5 +7,6 @@ $mb_id = escape_trim($_POST['reg_mb_id']);
if ($msg = empty_mb_email($mb_email)) die($msg);
if ($msg = valid_mb_email($mb_email)) die($msg);
if ($msg = prohibit_mb_email($mb_email)) die($msg);
if ($msg = exist_mb_email($mb_email, $mb_id)) die($msg);
?>

View File

@ -1,6 +1,19 @@
<?
define('sss', 1);
if (defined('ss')) {
echo xxx(1);
include_once('./_common.php');
// 금지 메일 도메인 검사
function prohibit_mb_email($reg_mb_email)
{
global $config;
list($id, $domain) = explode("@", $reg_mb_email);
$email_domains = explode("\n", trim($config['cf_prohibit_email']));
for ($i=0; $i<count($email_domains); $i++) {
if (strtolower($domain) == strtolower($email_domains[$i]))
return $domain;
}
return "";
}
echo prohibit_mb_email("kagla@naver.com");
echo prohibit_mb_email("kagla@hanmail.net");
?>