feat: Added check for demo-mode in admin_robots.php and admin_sitemap.php

This commit is contained in:
Roman Kelesidis 2025-07-16 10:05:38 +03:00
commit 5e2d6f277e
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4
2 changed files with 9 additions and 1 deletions

View file

@ -16,8 +16,12 @@ require __DIR__ . '/pagestart.php';
$robots_file = BB_ROOT . 'robots.txt'; $robots_file = BB_ROOT . 'robots.txt';
// Обработка сохранения
if (isset($_POST['save'])) { if (isset($_POST['save'])) {
// Check for demo mode
if (IN_DEMO_MODE) {
bb_die($lang['CANT_EDIT_IN_DEMO_MODE']);
}
$robots_txt = $_POST['robots_txt'] ?? ''; $robots_txt = $_POST['robots_txt'] ?? '';
if (!is_writable($robots_file) && is_file($robots_file)) { if (!is_writable($robots_file) && is_file($robots_file)) {

View file

@ -33,6 +33,10 @@ if (!$result = DB()->sql_query($sql)) {
} }
if (isset($_POST['submit'])) { if (isset($_POST['submit'])) {
// Check for demo mode
if (IN_DEMO_MODE) {
bb_die($lang['CANT_EDIT_IN_DEMO_MODE']);
}
if (!empty($new_params)) { if (!empty($new_params)) {
bb_update_config($new_params); bb_update_config($new_params);
} }