여분 필드를 활용해서 회원가입 활성 비활성
페이지 정보
관련링크
본문
extend 디렉터리에 user.joindeny.php 를 만들어 주고 아래 내용 붙여넣기 하면 된다.
기본설정 여분필드 값 1을 사용해서 작동하므로 비어있는 필드값으로 수정해주면 된다.
오류페이지는 그누보드 기본 에러 메시지 함수 호출시 오류가 나므로 자체적인 페이지를 띄운다.
적절하게 수정해서 사용해주세요.
활성시 로봇으로 가입하는것도 거의 완벽(?)하게 차단 할 수 있다.
여분필드의 값이 1일경우 동작한다..
<?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;
}
루시웹 보조 관리자 계정
0
댓글목록
등록된 댓글이 없습니다.