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개
게시글 목록
| 번호 | 제목 |
|---|---|
| 24318 | |
| 24317 | |
| 24315 | |
| 24309 | |
| 24294 | |
| 24293 | |
| 24277 | |
| 24262 | |
| 24260 | |
| 24253 | |
| 24251 | |
| 24236 | |
| 24233 | |
| 24228 | |
| 24226 | |
| 24221 | |
| 24214 | |
| 24203 | |
| 24201 | |
| 24199 | |
| 24196 | |
| 24195 | |
| 24194 | |
| 24192 | |
| 24191 | |
| 24187 | |
| 24185 | |
| 24183 | |
| 24172 | |
| 24168 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기