묻고답하기
@키스투엑스이 님께좀 질문....
2014.08.08 00:32
키스투엑스이 님.. 다름이 아니라.. 로그인 방어 애드온 관련 질문 하나만 드릴께요..ㅠㅠ
XE 로그인 실패 기록 쪽지 전송 및 이메일 전송 기능만 없애는 방법좀 알고 싶습니다.
1. 쪽지로 보내지지 않게 하기
xe - modules - member - member.controller.php 열고 line 1515 쯤에 아래의 코드를 삭제 또는 주석 처리하면 해결.
$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true);
2. 이메일로 보내지지 않게 하기
xe - modules - member - member.controller.php 열고 line 1525 쯤에 아래의 코드를 삭제 또는 주석 처리하면 해결.
$oMail->send();
이렇게 하면 된다던데...
왜 저는 안될까요...?
아래는 저의 member.controller.php 파일입니다.
member.controller.php 파일 변경전
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //send message $oCommunicationController = &getController( 'communication' ); $oCommunicationController ->sendMessage( $args ->member_srl, $args ->member_srl, $title , $content , true); if ( $this ->memberInfo->email_address && $this ->memberInfo->allow_mailing == 'Y' ) { $view_url = Context::getRequestUri(); $content = sprintf( "%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>" , $content , $view_url , $view_url , $this ->memberInfo->nick_name, $this ->memberInfo->email_id); $oMail = new Mail(); $oMail ->setTitle( $title ); $oMail ->setContent( $content ); $oMail ->setSender( $config ->webmaster_name? $config ->webmaster_name: 'webmaster' , $config ->webmaster_email); $oMail ->setReceiptor( $this ->memberInfo->email_id. '(' . $this ->memberInfo->nick_name. ')' , $this ->memberInfo->email_address); $oMail ->send(); |
member.controller.php 파일 변경후
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | //send message $oCommunicationController = &getController( 'communication' ); //$oCommunicationController->sendMessage($args->member_srl, $args->member_srl, $title, $content, true); if ( $this ->memberInfo->email_address && $this ->memberInfo->allow_mailing == 'Y' ) { $view_url = Context::getRequestUri(); $content = sprintf( "%s<hr /><p>From: <a href=\"%s\" target=\"_blank\">%s</a><br />To: %s(%s)</p>" , $content , $view_url , $view_url , $this ->memberInfo->nick_name, $this ->memberInfo->email_id); $oMail = new Mail(); $oMail ->setTitle( $title ); $oMail ->setContent( $content ); $oMail ->setSender( $config ->webmaster_name? $config ->webmaster_name: 'webmaster' , $config ->webmaster_email); $oMail ->setReceiptor( $this ->memberInfo->email_id. '(' . $this ->memberInfo->nick_name. ')' , $this ->memberInfo->email_address); //$oMail->send(); |
무엇이 문제인지 도무지 모르겠네요..
혹시 member.controller.php 이 파일말고 또 다른걸 변경해줘야 하나요?
댓글 28
-
키스투엑스이
2014.08.08 01:00
-
사랑해요XE
2014.08.08 01:06
<?php if(!defined('__ZBXE__') && !defined('__XE__')) exit(); if(Context::getResponseMethod() == "HTML" && Context::get('is_logged') && $called_position == 'after_module_proc') { $member_info = Context::get('logged_info'); $oMemberModel = &getModel('member'); if(trim($member_info->user_id)) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } $id_attention = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$id_attention)); } if(trim($id_attention)) { $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } } } if(Context::get('act') == 'procMemberLogin') { if($called_position == 'before_display_content') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $ip_based_info = Context::get('login_defencer_ip_based_info'); if($oModule->getError() == -1) { //로그인 실패시 기록. $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); $member_info = $oMemberModel->getMemberInfoByUserID($user_id); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } if($user_id && $member_info->user_id == $user_id) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -기록된 메시지 : ".$oModule->getMessage().'**/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } $output = str_replace($oModule->getMessage(), $oModule->getMessage()."\r\n".'로그인을 '.$ip_based_info->frequency.'회 시도하였습니다.'."\r\n".$addon_info->frequency.'회 시도하면 차단됩니다.', $output); } } if($called_position == 'before_module_init') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } $ip_based_info = FileHandler::readFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); $ip_based_info = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$ip_based_info)); $ip_based_info = unserialize($ip_based_info); if((time() - $ip_based_info->date) >= ($addon_info->set_time * 120)) { $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency = 0; $ip_based_info->date = time(); FileHandler::removeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); } if($ip_based_info->frequency >= $addon_info->frequency) { if((time() - $ip_based_info->date) < ($addon_info->set_time * 60)) { if(!$ip_based_info->is_denied) { $ip_based_info->is_denied = true; $ip_based_info->date = time(); $ip_denied_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 올바른 비밀번호일때는 패스 if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_denied_info); if($user_id && $member_info->user_id == $user_id && $member_info->member_srl) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -방어 프로그램 동작 : ".$addon_info->set_time.'분간 로그인이 차단되었습니다. **/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } } header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if(defined('__XE__')) { printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>-1</error><message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message><message_type></message_type></response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } else { printf("<response>\r\n<error>-1</error>\r\n<message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message>\r\n</response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } Context::close(); exit(); } } $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency++; $ip_based_info->date = time(); Context::set('login_defencer_ip_based_info', $ip_based_info); $ip_based_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 비밀번호 옳을 때는 패스. if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_based_info); } }
현재 위와 같이 되있는데 어떻게 해야 할지 잘 모르겠습니다..
알려주시면 정말 감사하겠습니다..
-
애니즌
2014.08.09 15:06
if(trim($id_attention)) { return; $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } }
-
사랑해요XE
2014.08.09 19:24
<?php
if
(!defined(
'__ZBXE__'
) && !defined(
'__XE__'
))
exit
();
if
(Context::getResponseMethod() ==
"HTML"
&& Context::get(
'is_logged'
) &&
$called_position
==
'after_module_proc'
) {
$member_info
= Context::get(
'logged_info'
);
$oMemberModel
= &getModel(
'member'
);
if
(trim(
$member_info
->user_id)) {
$id_attention
= FileHandler::readFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(trim(
$member_info
->user_id)).
'.php'
);
if
(defined(
'__XE__'
)) {
$config
=
$oMemberModel
->getMemberConfig();
if
(
$config
->identifier ==
'email_address'
) {
$id_attention
= FileHandler::readFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(trim(
$member_info
->email_address)).
'.php'
);
}
}
$id_attention
= trim(
str_replace
(
array
(
'<?php /**'
,
'**/ ?>'
),
array
(
''
,
''
),
$id_attention
));
}
if
(trim(
$id_attention
)) {
$title
=
'로그인 실패 기록 알림'
;
$content
= sprintf(
'<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>'
,
str_replace
(
"\r\n"
,
"<br />"
,
$id_attention
),
date
(
'Y-m-d H:i:s P'
));
$oCommunicationController
= &getController(
'communication'
);
$oCommunicationController
->sendMessage(
$member_info
->member_srl,
$member_info
->member_srl,
$title
,
$content
, true);
if
(
$member_info
->email_address) {
$view_url
= Context::getRequestUri();
$title
= sprintf(
"%s @ %s"
,
$title
,
$view_url
);
$content
= sprintf(
"%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>"
,
$content
,
$view_url
,
$view_url
,
$member_info
->user_name,
$member_info
->user_id);
$oMail
=
new
Mail();
$oMail
->setTitle(
$title
);
$oMail
->setContent(
$content
);
$oMail
->setSender(
$member_info
->user_name.
'('
.
$member_info
->nick_name.
')'
,
$member_info
->email_address);
$oMail
->setReceiptor(
$member_info
->user_name.
'('
.
$member_info
->nick_name.
')'
,
$member_info
->email_address);
$oMail
->send();
}
$script
= sprintf(
'<script type="text/javascript">//<![CDATA['
.
"\r\n"
.
'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'
.
"\r\n"
.
'</script>'
,
str_replace
(
"\r\n"
,
"\\n"
,
$id_attention
));
Context::addHtmlHeader(
$script
);
FileHandler::removeFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(trim(
$member_info
->user_id)).
'.php'
);
if
(defined(
'__XE__'
)) {
if
(
$config
->identifier ==
'email_address'
) {
$id_attention
= FileHandler::removeFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(trim(
$member_info
->email_address)).
'.php'
);
}
}
}
}
if
(Context::get(
'act'
) ==
'procMemberLogin'
) {
if
(
$called_position
==
'before_display_content'
) {
$addon_info
->frequency =
intval
(
$addon_info
->frequency);
$addon_info
->set_time = doubleval(
$addon_info
->set_time);
if
(!
$addon_info
->frequency)
$addon_info
->frequency = 5;
if
(!
$addon_info
->set_time)
$addon_info
->set_time = 1;
$ip_based_info
= Context::get(
'login_defencer_ip_based_info'
);
if
(
$oModule
->getError() == -1) {
//로그인 실패시 기록.
$user_id
= trim(Context::get(
'user_id'
));
$oMemberModel
= &getModel(
'member'
);
$member_info
=
$oMemberModel
->getMemberInfoByUserID(
$user_id
);
if
(defined(
'__XE__'
)) {
$config
=
$oMemberModel
->getMemberConfig();
if
(
$config
->identifier ==
'email_address'
) {
$member_info
=
$oMemberModel
->getMemberInfoByEmailAddress(
$user_id
);
$member_info
->user_id =
$member_info
->email_address;
}
}
if
(
$user_id
&&
$member_info
->user_id ==
$user_id
) {
$id_attention
= FileHandler::readFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(
$user_id
).
'.php'
);
$id_attention
=
$id_attention
.
"\r\n\r\n"
;
$id_attention
.=
'<?php /**'
.
"시간 : "
.
date
(
'Y-m-d H:i:s P'
).
"\r\n -접속 IP : "
.
$_SERVER
[
'REMOTE_ADDR'
].
"\r\n -기록된 메시지 : "
.
$oModule
->getMessage().
'**/ ?>'
;
FileHandler::writeFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(
$user_id
).
'.php'
,
$id_attention
);
}
$output
=
str_replace
(
$oModule
->getMessage(),
$oModule
->getMessage().
"\r\n"
.
'로그인을 '
.
$ip_based_info
->frequency.
'회 시도하였습니다.'
.
"\r\n"
.
$addon_info
->frequency.
'회 시도하면 차단됩니다.'
,
$output
);
}
}
if
(
$called_position
==
'before_module_init'
) {
$addon_info
->frequency =
intval
(
$addon_info
->frequency);
$addon_info
->set_time = doubleval(
$addon_info
->set_time);
if
(!
$addon_info
->frequency)
$addon_info
->frequency = 5;
if
(!
$addon_info
->set_time)
$addon_info
->set_time = 1;
$user_id
= trim(Context::get(
'user_id'
));
$oMemberModel
= &getModel(
'member'
);
if
(defined(
'__XE__'
)) {
$config
=
$oMemberModel
->getMemberConfig();
if
(
$config
->identifier ==
'email_address'
) {
$member_info
=
$oMemberModel
->getMemberInfoByEmailAddress(
$user_id
);
$member_info
->user_id =
$member_info
->email_address;
}
}
$ip_based_info
= FileHandler::readFile(
'./files/cache/addons/login_defencer/ip_'
.
$_SERVER
[
'REMOTE_ADDR'
].
'.php'
);
$ip_based_info
= trim(
str_replace
(
array
(
'<?php /**'
,
'**/ ?>'
),
array
(
''
,
''
),
$ip_based_info
));
$ip_based_info
= unserialize(
$ip_based_info
);
if
((time() -
$ip_based_info
->
date
) >= (
$addon_info
->set_time * 120)) {
$ip_based_info
->userid = urlencode(
$user_id
);
$ip_based_info
->frequency = 0;
$ip_based_info
->
date
= time();
FileHandler::removeFile(
'./files/cache/addons/login_defencer/ip_'
.
$_SERVER
[
'REMOTE_ADDR'
].
'.php'
);
}
if
(
$ip_based_info
->frequency >=
$addon_info
->frequency) {
if
((time() -
$ip_based_info
->
date
) < (
$addon_info
->set_time * 60)) {
if
(!
$ip_based_info
->is_denied) {
$ip_based_info
->is_denied = true;
$ip_based_info
->
date
= time();
$ip_denied_info
=
'<?php /**'
.serialize(
$ip_based_info
).
'**/ ?>'
;
// 올바른 비밀번호일때는 패스
if
(!(md5(trim(Context::get(
'password'
))) ==
$member_info
->password &&
$member_info
->user_id ==
$user_id
&&
$member_info
->member_srl))
FileHandler::writeFile(
'./files/cache/addons/login_defencer/ip_'
.
$_SERVER
[
'REMOTE_ADDR'
].
'.php'
,
$ip_denied_info
);
if
(
$user_id
&&
$member_info
->user_id ==
$user_id
&&
$member_info
->member_srl) {
$id_attention
= FileHandler::readFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(
$user_id
).
'.php'
);
$id_attention
=
$id_attention
.
"\r\n\r\n"
;
$id_attention
.=
'<?php /**'
.
"시간 : "
.
date
(
'Y-m-d H:i:s P'
).
"\r\n -접속 IP : "
.
$_SERVER
[
'REMOTE_ADDR'
].
"\r\n -방어 프로그램 동작 : "
.
$addon_info
->set_time.
'분간 로그인이 차단되었습니다. **/ ?>'
;
FileHandler::writeFile(
'./files/cache/addons/login_defencer/id_attention/id_'
.md5(
$user_id
).
'.php'
,
$id_attention
);
}
}
header(
"Content-Type: text/xml; charset=UTF-8"
);
header(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT"
);
header(
"Last-Modified: "
.
gmdate
(
"D, d M Y H:i:s"
) .
" GMT"
);
header(
"Cache-Control: no-store, no-cache, must-revalidate"
);
header(
"Cache-Control: post-check=0, pre-check=0"
, false);
header(
"Pragma: no-cache"
);
if
(defined(
'__XE__'
)) {
printf(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>-1</error><message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message><message_type></message_type></response>"
,((
$addon_info
->set_time * 60)-(time() - (
$ip_based_info
->
date
)))/60,((
$addon_info
->set_time * 60)-(time() -
$ip_based_info
->
date
))/60);
}
else
{
printf(
"<response>\r\n<error>-1</error>\r\n<message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message>\r\n</response>"
,((
$addon_info
->set_time * 60)-(time() - (
$ip_based_info
->
date
)))/60,((
$addon_info
->set_time * 60)-(time() -
$ip_based_info
->
date
))/60);
}
Context::close();
exit
();
}
}
$ip_based_info
->userid = urlencode(
$user_id
);
$ip_based_info
->frequency++;
$ip_based_info
->
date
= time();
Context::set(
'login_defencer_ip_based_info'
,
$ip_based_info
);
$ip_based_info
=
'<?php /**'
.serialize(
$ip_based_info
).
'**/ ?>'
;
// 비밀번호 옳을 때는 패스.
if
(!(md5(trim(Context::get(
'password'
))) ==
$member_info
->password &&
$member_info
->user_id ==
$user_id
&&
$member_info
->member_srl))
FileHandler::writeFile(
'./files/cache/addons/login_defencer/ip_'
.
$_SERVER
[
'REMOTE_ADDR'
].
'.php'
,
$ip_based_info
);
}
}
이것을 저것으로 바꿔주라는 이야기인가요? ;; -
키스투엑스이
2014.08.09 19:44
네.
-
사랑해요XE
2014.08.09 05:31
부탁좀드립니다 고수님..ㅠㅠ
-
GG
2014.08.09 05:56
$oMail
->send();
이 코드가 한국말로 하자면,
oMail에 있는 send 함수를 실행한다~
하는건데 다시말해 메일 보낸다? 하고 하는 것입니다.
앞에 // 로 주석처리하면 작동 안합니다.
-
사랑해요XE
2014.08.09 09:53
member.controller.php 파일 변경후를 보시면 아시겠지만..$oMail->send(); 를 주석처리 해줬음에도
여전히 메일로 보내집니다..
ftp 문제도 아니고.. 캐쉬 다시 생성문제도 아니고..
하루를 기다려봐도 안됩니다..
다시 파일을 ftp에서 받아서 잘 업로드됬나 확인해봐도
주석처리가 초록색으로 잘되었는데
왜 안되는지 도무지 방법을 모르겠어서
질문글을 올렸습니다.. -
GG
2014.08.09 12:37
앗 그질문이 아니었군요.
죄송. ... -
GG
2014.08.09 15:24
member.controller.php 파일 말고
애드온의 login_defencer.addon.php 파일을 여셔서
22번 라인의 $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true);
33번 라인의 $oMail->send();
을 주석처리해 보세용..
-
사랑해요XE
2014.08.12 03:31
GG님.. 이렇게 해도 안되네요..ㅠㅠㅠ
-
키스투엑스이
2014.08.09 18:21
이제 XE에 접속해서 알람을 봤는데 이미 다른분께서 해결을 다 해주셨네용..
본래 자주자주 접속을 하는데.. 죄송합니다.
-
사랑해요XE
2014.08.09 19:25
애드온의 login_defencer.addon.php 파일을 여셔서
22번 라인의 $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true);
33번 라인의 $oMail->send();
을 주석처리해 보세용..
이렇게 하면 되나요?
-
키스투엑스이
2014.08.09 19:44
애니즌님이 댓글로 올려주신것을 사용해주세요.
만약 안되심 이 방법도 써보시고..
아마 애니즌님이 올려주신대로 하면 될겁니다.
-
사랑해요XE
2014.08.09 19:58
애니즌님 말대로 라면
<?php if(!defined('__ZBXE__') && !defined('__XE__')) exit(); if(Context::getResponseMethod() == "HTML" && Context::get('is_logged') && $called_position == 'after_module_proc') { $member_info = Context::get('logged_info'); $oMemberModel = &getModel('member'); if(trim($member_info->user_id)) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } $id_attention = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$id_attention)); } if(trim($id_attention)) { $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } } } if(Context::get('act') == 'procMemberLogin') { if($called_position == 'before_display_content') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $ip_based_info = Context::get('login_defencer_ip_based_info'); if($oModule->getError() == -1) { //로그인 실패시 기록. $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); $member_info = $oMemberModel->getMemberInfoByUserID($user_id); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } if($user_id && $member_info->user_id == $user_id) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -기록된 메시지 : ".$oModule->getMessage().'**/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } $output = str_replace($oModule->getMessage(), $oModule->getMessage()."\r\n".'로그인을 '.$ip_based_info->frequency.'회 시도하였습니다.'."\r\n".$addon_info->frequency.'회 시도하면 차단됩니다.', $output); } } if($called_position == 'before_module_init') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } $ip_based_info = FileHandler::readFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); $ip_based_info = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$ip_based_info)); $ip_based_info = unserialize($ip_based_info); if((time() - $ip_based_info->date) >= ($addon_info->set_time * 120)) { $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency = 0; $ip_based_info->date = time(); FileHandler::removeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); } if($ip_based_info->frequency >= $addon_info->frequency) { if((time() - $ip_based_info->date) < ($addon_info->set_time * 60)) { if(!$ip_based_info->is_denied) { $ip_based_info->is_denied = true; $ip_based_info->date = time(); $ip_denied_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 올바른 비밀번호일때는 패스 if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_denied_info); if($user_id && $member_info->user_id == $user_id && $member_info->member_srl) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -방어 프로그램 동작 : ".$addon_info->set_time.'분간 로그인이 차단되었습니다. **/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } } header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if(defined('__XE__')) { printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>-1</error><message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message><message_type></message_type></response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } else { printf("<response>\r\n<error>-1</error>\r\n<message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message>\r\n</response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } Context::close(); exit(); } } $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency++; $ip_based_info->date = time(); Context::set('login_defencer_ip_based_info', $ip_based_info); $ip_based_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 비밀번호 옳을 때는 패스. if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_based_info); } }
위에 있는 코드를
if(trim($id_attention)) { return; $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } }
이렇게 전체다 덮어씌우라는건가요?
아니면 if(trim($id_attention)) 이 부분부터 바꿔주라는건가요?
설명이 없으셔서.. 헷갈리네요.
-
키스투엑스이
2014.08.09 20:07
if
(trim(
$id_attention
)) {
이 부분부터 바꿔주세요.
-
사랑해요XE
2014.08.09 20:31
그럼 if(Context::get('act') == 'procMemberLogin') 이 부분은 어떻게 하나요;;?
그대로 둬야하나요? 아니면 다 지워버려야하나요?
if(Context::get('act') == 'procMemberLogin') { if($called_position == 'before_display_content') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $ip_based_info = Context::get('login_defencer_ip_based_info'); if($oModule->getError() == -1) { //로그인 실패시 기록. $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); $member_info = $oMemberModel->getMemberInfoByUserID($user_id); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } if($user_id && $member_info->user_id == $user_id) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -기록된 메시지 : ".$oModule->getMessage().'**/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } $output = str_replace($oModule->getMessage(), $oModule->getMessage()."\r\n".'로그인을 '.$ip_based_info->frequency.'회 시도하였습니다.'."\r\n".$addon_info->frequency.'회 시도하면 차단됩니다.', $output); } } if($called_position == 'before_module_init') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } $ip_based_info = FileHandler::readFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); $ip_based_info = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$ip_based_info)); $ip_based_info = unserialize($ip_based_info); if((time() - $ip_based_info->date) >= ($addon_info->set_time * 120)) { $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency = 0; $ip_based_info->date = time(); FileHandler::removeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); } if($ip_based_info->frequency >= $addon_info->frequency) { if((time() - $ip_based_info->date) < ($addon_info->set_time * 60)) { if(!$ip_based_info->is_denied) { $ip_based_info->is_denied = true; $ip_based_info->date = time(); $ip_denied_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 올바른 비밀번호일때는 패스 if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_denied_info); if($user_id && $member_info->user_id == $user_id && $member_info->member_srl) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -방어 프로그램 동작 : ".$addon_info->set_time.'분간 로그인이 차단되었습니다. **/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } } header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if(defined('__XE__')) { printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>-1</error><message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message><message_type></message_type></response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } else { printf("<response>\r\n<error>-1</error>\r\n<message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message>\r\n</response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } Context::close(); exit(); } } $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency++; $ip_based_info->date = time(); Context::set('login_defencer_ip_based_info', $ip_based_info); $ip_based_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 비밀번호 옳을 때는 패스. if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_based_info); } }
if(trim($id_attention)) { $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } } }
쉽게 이야기해서.. 이 부분만 교체해주고 밑에 부분은 그대로 두는것인지
시작은 알려주셨는데 끝은 안알려주셨네요.. ㅠㅠ
밑에 부분만 냅두고 이것만 교체해주면 되나요?
if(trim($id_attention)) { $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } } }
-
사랑해요XE
2014.08.12 03:30
키스투엑스이님
이거 안되는데 어떻게 방법이 없을까요..?
코어의 문제일라나요.,.?
-
애니즌
2014.08.09 21:14
<?php if(!defined('__ZBXE__') && !defined('__XE__')) exit(); if(Context::getResponseMethod() == "HTML" && Context::get('is_logged') && $called_position == 'after_module_proc') { $member_info = Context::get('logged_info'); $oMemberModel = &getModel('member'); if(trim($member_info->user_id)) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } $id_attention = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$id_attention)); } if(trim($id_attention)) { return; $title = '로그인 실패 기록 알림'; $content = sprintf('<h2>로그인 실패 기록이 있습니다.</h2><p>%s</p><p>*이 알림은 한번만 보입니다.<br />*이 메시지는 쪽지와 이메일로 발송됩니다.<br />발송 시각 : %s</p>',str_replace("\r\n","<br />",$id_attention),date('Y-m-d H:i:s P')); $oCommunicationController = &getController('communication'); $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true); if($member_info->email_address) { $view_url = Context::getRequestUri(); $title = sprintf("%s @ %s",$title,$view_url); $content = sprintf("%s<hr /><p>From : <a href=\"%s\" target=\"_blank\">%s</a><br />To : %s(%s)</p>",$content, $view_url, $view_url, $member_info->user_name, $member_info->user_id); $oMail = new Mail(); $oMail->setTitle($title); $oMail->setContent($content); $oMail->setSender($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->setReceiptor($member_info->user_name.'('.$member_info->nick_name.')', $member_info->email_address); $oMail->send(); } $script = sprintf('<script type="text/javascript">//<![CDATA['."\r\n". 'alert("로그인 실패 기록이 있습니다.\n\n%s\n\n*이 알림은 한번만 보입니다.\n*이 메시지는 쪽지와 이메일로 발송됩니다.");'."\r\n". '</script>',str_replace("\r\n","\\n",$id_attention)); Context::addHtmlHeader($script); FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->user_id)).'.php'); if(defined('__XE__')) { if ($config->identifier == 'email_address') { $id_attention = FileHandler::removeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5(trim($member_info->email_address)).'.php'); } } } } if(Context::get('act') == 'procMemberLogin') { if($called_position == 'before_display_content') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $ip_based_info = Context::get('login_defencer_ip_based_info'); if($oModule->getError() == -1) { //로그인 실패시 기록. $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); $member_info = $oMemberModel->getMemberInfoByUserID($user_id); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } if($user_id && $member_info->user_id == $user_id) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -기록된 메시지 : ".$oModule->getMessage().'**/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } $output = str_replace($oModule->getMessage(), $oModule->getMessage()."\r\n".'로그인을 '.$ip_based_info->frequency.'회 시도하였습니다.'."\r\n".$addon_info->frequency.'회 시도하면 차단됩니다.', $output); } } if($called_position == 'before_module_init') { $addon_info->frequency = intval($addon_info->frequency); $addon_info->set_time = doubleval($addon_info->set_time); if(!$addon_info->frequency) $addon_info->frequency = 5; if(!$addon_info->set_time) $addon_info->set_time = 1; $user_id = trim(Context::get('user_id')); $oMemberModel = &getModel('member'); if(defined('__XE__')) { $config = $oMemberModel->getMemberConfig(); if ($config->identifier == 'email_address') { $member_info = $oMemberModel->getMemberInfoByEmailAddress($user_id); $member_info->user_id = $member_info->email_address; } } $ip_based_info = FileHandler::readFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); $ip_based_info = trim(str_replace(array('<?php /**','**/ ?>'),array('',''),$ip_based_info)); $ip_based_info = unserialize($ip_based_info); if((time() - $ip_based_info->date) >= ($addon_info->set_time * 120)) { $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency = 0; $ip_based_info->date = time(); FileHandler::removeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php'); } if($ip_based_info->frequency >= $addon_info->frequency) { if((time() - $ip_based_info->date) < ($addon_info->set_time * 60)) { if(!$ip_based_info->is_denied) { $ip_based_info->is_denied = true; $ip_based_info->date = time(); $ip_denied_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 올바른 비밀번호일때는 패스 if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_denied_info); if($user_id && $member_info->user_id == $user_id && $member_info->member_srl) { $id_attention = FileHandler::readFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php'); $id_attention = $id_attention."\r\n\r\n"; $id_attention .= '<?php /**'."시간 : ".date('Y-m-d H:i:s P')."\r\n -접속 IP : ".$_SERVER['REMOTE_ADDR']."\r\n -방어 프로그램 동작 : ".$addon_info->set_time.'분간 로그인이 차단되었습니다. **/ ?>'; FileHandler::writeFile('./files/cache/addons/login_defencer/id_attention/id_'.md5($user_id).'.php',$id_attention); } } header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if(defined('__XE__')) { printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?><response><error>-1</error><message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message><message_type></message_type></response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } else { printf("<response>\r\n<error>-1</error>\r\n<message>로그인이 차단되었습니다. Login is not available.\r\n%0.1f 분 후에 다시 로그인 할 수 있습니다. %0.1f minute left.</message>\r\n</response>",(($addon_info->set_time * 60)-(time() - ($ip_based_info->date)))/60,(($addon_info->set_time * 60)-(time() - $ip_based_info->date))/60); } Context::close(); exit(); } } $ip_based_info->userid = urlencode($user_id); $ip_based_info->frequency++; $ip_based_info->date = time(); Context::set('login_defencer_ip_based_info', $ip_based_info); $ip_based_info = '<?php /**'.serialize($ip_based_info).'**/ ?>'; // 비밀번호 옳을 때는 패스. if(!(md5(trim(Context::get('password'))) == $member_info->password && $member_info->user_id == $user_id && $member_info->member_srl)) FileHandler::writeFile('./files/cache/addons/login_defencer/ip_'.$_SERVER['REMOTE_ADDR'].'.php',$ip_based_info); } }
18번째줄에 return; 이거 추가해주면 됩니다... 다른 건 그대로 냅두고요/>/> -
사랑해요XE
2014.08.09 21:22
눈치채지 못했네요 ㄷㄷ
18번째줄에 return; 이거 하나만 추가해주면 되는건가요? 헐...
-
사랑해요XE
2014.08.09 22:48
애니즌님.. 이 방법 안되네요..ㅜㅜ
-
애니즌
2014.08.09 22:52
그럼 다른 거 문제 아닐까요?
일단 저 애드온에서 메시지 보내는 부분이 저 부분인데
그냥 들어오면 나가라고 명령해놓은 겁니다. 즉, 밑에 구문이 실행되질 않지요..ㅇㅅㅇ
-
사랑해요XE
2014.08.09 22:53
헐.. 무엇이 문제인지 도무지 감이 안잡히네요..
분명 이 애드온이 맞는데..
쪽지 보내주고.. 이메일 보내주는..ㅠㅠ
-
애니즌
2014.08.10 00:44
애드온 끄고서 테스트 해보셨어요?
애드온 끄고서도 그런 거면 애드온이 아닌 것 같은데..
그리고 자체 코어 기능에 있을 걸요?? 쪽지로 날라오던거 같던데..
-
사랑해요XE
2014.08.10 02:00
애니즌님! 이게 서버가 업데이트가 늦게되서 그런가봐요..!! 잘됩니다!!
정말 감사드립니다!!
애니즌님 만만세!!!!!!!!!!!!!!
-
사랑해요XE
2014.08.09 22:54
혹시 아래 방법이랑 같이 안해서 그런게 아닐까요..?
member.controller.php 파일 말고
애드온의 login_defencer.addon.php 파일을 여셔서
22번 라인의 $oCommunicationController->sendMessage($member_info->member_srl, $member_info->member_srl, $title, $content, true);
33번 라인의 $oMail->send();
을 주석처리해 보세용..
이것도 아니라면.. member.controller.php 도 같이 수정해줘야하는걸까요..? ㅠ
-
애니즌
2014.08.10 04:04
만일 애드온 꺼도 메시지가 발송된다면 그건 xe 코어 기본 기능이던가 다른 애드온일 겁니다.
-
사랑해요XE
2014.08.12 03:29
이거 다른게 문제인거같네요..
코어 문제같습니다...
오늘 다시 확인해보니 안되네요..
애드온 다운로드 후 php파일에서 mail과 communication 과 같은 함수가 있는 구문을 찾아 지워주심 될 듯 합니다.
혹시 잘 안되시면 답글 달아주세요.