新版-极致cms本地域名授权

程潇
4月19日发布

新版-极致cms本地域名授权

<?php
define('APP_PATH', __DIR__ . '/');
define('ADMIN_MODEL','admins');

// ===================== MD5 加密域名授权配置 =====================
// 步骤:把你的域名转成 MD5 后填在这里(支持多个)
// 在线转 MD5:https://md5.cn/
$allowedDomainsMd5 = [
    '21232f297a57a5a743894a0e4a801fc3', // 默认:admin(测试用)
    'e10adc3949ba59abbe56e057f20f883e', // 默认:123456(测试用)
    // 在这里添加你的域名 MD5,例如:md5('www.你的域名.com')
];

// 获取当前访问域名
$currentDomain = strtolower($_SERVER['HTTP_HOST'] ?? '');
// 当前域名 MD5
$currentDomainMd5 = md5($currentDomain);

// 验证 MD5 是否在授权列表
if (!in_array($currentDomainMd5, $allowedDomainsMd5)) {
    // 未授权 → 显示拒绝页面
    ?>
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <title>访问被拒绝</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
                font-family: "Microsoft YaHei", sans-serif;
            }
            body {
                background-color: #f5f7fa;
                display: flex;
                align-items: center;
                justify-content: center;
                min-height: 100vh;
                padding: 20px;
            }
            .container {
                background: #fff;
                padding: 50px 40px;
                border-radius: 12px;
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
                text-align: center;
                max-width: 550px;
                width: 100%;
            }
            .icon-error {
                font-size: 60px;
                color: #f5a623;
                margin-bottom: 20px;
            }
            h1 {
                font-size: 26px;
                color: #333;
                margin-bottom: 16px;
            }
            .message {
                font-size: 15px;
                color: #666;
                line-height: 1.7;
                margin-bottom: 25px;
            }
            .domain-info {
                font-size: 14px;
                color: #999;
                margin-bottom: 30px;
                padding: 10px;
                background: #f8f9fa;
                border-radius: 6px;
                display: inline-block;
            }
            .action-button {
                display: inline-block;
                padding: 12px 28px;
                background: #409eff;
                color: #fff;
                text-decoration: none;
                border-radius: 6px;
                font-size: 15px;
                margin-bottom: 35px;
                transition: background 0.2s;
            }
            .action-button:hover {
                background: #337ecc;
            }
            .footer {
                font-size: 12px;
                color: #bbb;
            }
        </style>
    </head>
    <body>
        <div class="container">
            <div class="icon-error">⚠️</div>
            <h1>访问被拒绝</h1>
            <p class="message">
                此程序副本未经授权,可能为盗版或非法分发版本。<br>
                为保障您的信息安全和服务稳定性,请联系官方获取合法授权。
            </p>
            <div class="domain-info">当前域名: <?php echo htmlspecialchars($currentDomain); ?></div>
            <a href="" target="_blank" class="action-button">请联系管理员获取授权</a>
            <div class="footer">
                © <?php echo date('Y'); ?> FrPHP Framework. All rights reserved.
            </div>
        </div>
    </body>
    </html>
    <?php
    exit;
}

// 授权通过,加载框架
require(APP_PATH . 'frphp/fr.php');
喜欢就支持一下吧
点赞 0 分享 收藏
评论 抢沙发
OωO
取消