LucyLee

여분 필드를 활용해서 회원가입 활성 비활성

extend 디렉터리에 user.joindeny.php 를 만들어 주고 아래 내용 붙여넣기 하시면 됩니다.

기본설정 여분필드 1을 사용해서 작동하므로 비어있는 필드값으로 수정해주시면 됩니다.

오류페이지는 그누보드 기본 에러 메시지 함수 호출시 오류가 나므로 자체적인 페이지를 띄웁니다.

적절하게 수정해서 사용해주세요.

 

활성시 로봇으로 가입하는것도 거의 완벽(?)하게 차단됩니다.

 

여분필드의 값이 1일경우 동작하게 됩니다.

 

[code]

<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

/* 기본값 지정 (1:활성, 0:비활성) */
$memberjoin_config_1 = 0; // 회원가입 차단 기능


// 그누보드 환경설정 여분필드 값 로드
if($config['cf_1'] == 1) $memberjoin_config_1 = 1;


if($memberjoin_config_1 == 1 && !$is_member) {
    if( preg_match("/register_form\.php*/i", $_SERVER['SCRIPT_FILENAME']) || preg_match("/register\.php*/i", $_SERVER['SCRIPT_FILENAME']) || preg_match("/register_result\.php*/i", $_SERVER['SCRIPT_FILENAME']) || preg_match("/register_form_update\.php*/i", $_SERVER['SCRIPT_FILENAME']) ) {
        custom_alert("관리자에 의해 회원 가입이 제한 되었습니다.");
        exit;
    }
}

function custom_alert($msg) {
    header("HTTP/1.0 403 Forbidden");
    header('Content-type: text/html; charset=UTF-8');
?>
<!DOCTYPE HTML>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Error</title>

<style>
body, html { padding: 0; margin: 0; width: 100%; height: 100%; overflow: hidden; background-color: rgb(215, 120, 15); color: #fff; }
.error { text-align: center; padding: 16px; position: relative; top: 50%; transform: translateY(-50%); -webkit-transform: translateY(-50%); }
h1 { margin: -50px 0 30px; font-size: calc(5vw + 6px); opacity: 0.8; letter-spacing: 2px; }
p { opacity: 0.8; font-size: 20px; margin: 8px 0 38px 0; font-weight: bold; }
a {color: #ff0; margin:20px 5px; text-decoration:underline; }
.wrapper { font-weight: bold; }
</style>

</head>
<body>

<div class="error">
<h1>HTTP_403</h1>
<p><?php echo $msg; ?></p>
<span class="wrapper">[</span><a href="<?php echo "https://".$_SERVER['HTTP_HOST']; ?>" >처음 화면으로 돌아가기</a><span class="wrapper">]</span>
</div>

</body>
</html>


<?php
    exit;
}

[/code]

|

댓글 15개

좋은 팁 감사 드려요. ^^
감사합니다.
감사합니다.
로봇이 회원가입을 많이 하는데 감사합니다.
9번째줄 if$memberjoin_config_1 == 1 && !$is_member) {

if문 괄호 "(" 빠졌네요
if($memberjoin_config_1 == 1 && !$is_member) {
네 에러부분 수정하였어요 :)
감사합니다....
감사합니다~~^^
이런.. 감사합니다.
적용 해 봤습니다. 가입 막았으면 좋겠네요.

감사합니다.
감사합니다~~^^
그누4에서도 적용이 가능할까요?
G5 로봇가입방지기능
감사합니다. 스팸등록이 많은 사이트에 적용해 보겠습니다.
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
6년 전 조회 5,827
6년 전 조회 4,808
6년 전 조회 7,346
6년 전 조회 6,007
6년 전 조회 3,686
6년 전 조회 5,606
6년 전 조회 5,132
7년 전 조회 3,602
7년 전 조회 3,509
7년 전 조회 2,987
7년 전 조회 7,337
7년 전 조회 4,000
7년 전 조회 4,667
7년 전 조회 4,079
7년 전 조회 5,622
7년 전 조회 4,834
7년 전 조회 3,710
7년 전 조회 5,127
7년 전 조회 3,565
7년 전 조회 8,729
7년 전 조회 1.1만
7년 전 조회 6,626
7년 전 조회 3,671
7년 전 조회 5,025
7년 전 조회 6,373
7년 전 조회 4,815
7년 전 조회 4,008
7년 전 조회 4,428
7년 전 조회 7,826
7년 전 조회 7,072
🐛 버그신고