feat: Added check for demo-mode in admin_robots.php and admin_sitemap.php (#2046)
Some checks failed
Continuous Integration / Nightly builds 📦 (push) Has been cancelled
Continuous Integration / 🎉 Deploy (push) Has been cancelled
PHPMD / Run PHPMD scanning (push) Has been cancelled

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

* Update ci.yml
This commit is contained in:
Roman Kelesidis 2025-07-16 10:10:39 +03:00 committed by GitHub
commit dd64236da1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 38 additions and 1 deletions

View file

@ -46,3 +46,32 @@ jobs:
with:
name: TorrentPier-v2.4
path: ${{ steps.create-zip.outputs.ZIP_NAME }}
deploy:
name: 🎉 Deploy
runs-on: ubuntu-22.04
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: 🔩 Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- name: 🖇 Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: 📂 Sync files
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
server-dir: ${{ secrets.FTP_DIR }}
protocol: ${{ secrets.FTP_PROTOCOL }}
port: ${{ secrets.FTP_PORT }}
exclude: |
**/.git*
**/.git*/**
.env

View file

@ -16,8 +16,12 @@ require __DIR__ . '/pagestart.php';
$robots_file = BB_ROOT . 'robots.txt';
// Обработка сохранения
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'] ?? '';
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'])) {
// Check for demo mode
if (IN_DEMO_MODE) {
bb_die($lang['CANT_EDIT_IN_DEMO_MODE']);
}
if (!empty($new_params)) {
bb_update_config($new_params);
}