کتاب مقدس آنلاین: تفاوت میان نسخهها
ظاهر
بدون خلاصۀ ویرایش |
بدون خلاصۀ ویرایش |
||
| خط ۳۶۸: | خط ۳۶۸: | ||
<script> | <script> | ||
// 🔒 سیستم حفاظتی - بررسی دامنه مجاز | // 🔒 سیستم حفاظتی - بررسی دامنه مجاز | ||
const ALLOWED_DOMAINS = [ | const ALLOWED_DOMAINS = [ | ||
| خط ۳۷۷: | خط ۳۷۶: | ||
]; | ]; | ||
// تابع بررسی مجاز بودن دامنه | |||
function isDomainAllowed() { | function isDomainAllowed() { | ||
const currentDomain = window.location.hostname; | const currentDomain = window.location.hostname; | ||
return ALLOWED_DOMAINS.some(domain => | console.log('🔍 بررسی دامنه:', currentDomain); | ||
currentDomain === domain || | |||
// اگر روی فایل محلی هستیم، اجازه بده | |||
); | if (!currentDomain || currentDomain === '' || currentDomain === 'null') { | ||
console.log('✅ فایل محلی - مجاز'); | |||
return true; | |||
} | |||
const isAllowed = ALLOWED_DOMAINS.some(domain => { | |||
const match = currentDomain === domain || currentDomain.endsWith('.' + domain); | |||
if (match) { | |||
console.log(`✅ دامنه ${currentDomain} مجاز است`); | |||
} | |||
return match; | |||
}); | |||
if (!isAllowed) { | |||
console.log(`❌ دامنه ${currentDomain} غیرمجاز است`); | |||
} | |||
return isAllowed; | |||
} | } | ||
// تابع نمایش پیام دسترسی غیرمجاز | |||
function showAccessDenied() { | function showAccessDenied() { | ||
const wrapper = document.getElementById('content-wrapper'); | const wrapper = document.getElementById('content-wrapper'); | ||
| خط ۳۹۷: | خط ۴۱۵: | ||
} | } | ||
// تابع اصلی بارگذاری برنامه | |||
function loadApplication() { | function loadApplication() { | ||
console.log('🚀 شروع بارگذاری با بررسی امنیتی...'); | |||
if (!isDomainAllowed()) { | if (!isDomainAllowed()) { | ||
console.log('❌ دسترسی غیرمجاز - نمایش پیام خطا'); | |||
showAccessDenied(); | showAccessDenied(); | ||
return; | return; | ||
} | } | ||
console.log('✅ دامنه مجاز - بارگذاری برنامه اصلی'); | |||
// اگر دامنه مجاز باشد، برنامه اصلی بارگذاری میشود | // اگر دامنه مجاز باشد، برنامه اصلی بارگذاری میشود | ||
initializeBibleApp(); | initializeBibleApp(); | ||