mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
feat: Added check for demo-mode in admin_robots.php
and admin_sitemap.php
(#2046)
* feat: Added check for demo-mode in `admin_robots.php` and `admin_sitemap.php` * Update ci.yml
This commit is contained in:
parent
c27d4373d6
commit
dd64236da1
3 changed files with 38 additions and 1 deletions
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
|
@ -46,3 +46,32 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: TorrentPier-v2.4
|
name: TorrentPier-v2.4
|
||||||
path: ${{ steps.create-zip.outputs.ZIP_NAME }}
|
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
|
||||||
|
|
|
@ -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)) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue