mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 22:03:49 -07:00
Fixed broken "Disable Board" function (#1529)
* Fixed broken "Disable Board" function * Update CHANGELOG.md
This commit is contained in:
parent
082d553a29
commit
a90653e7e2
3 changed files with 10 additions and 15 deletions
|
@ -6,6 +6,7 @@
|
|||
**Merged pull requests:**
|
||||
|
||||
- Release 2.4.4 🦩 ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Fixed broken "Disable Board" function [\#1529](https://github.com/torrentpier/torrentpier/pull/1529) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Create tech stack docs (techstack.yml and techstack.md) [\#1521](https://github.com/torrentpier/torrentpier/pull/1521), [\#1522](https://github.com/torrentpier/torrentpier/pull/1522) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Fixed seed bonus accrual [\#1518](https://github.com/torrentpier/torrentpier/pull/1518) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- [BETA] Added emojis support 😄😁 [\#1514](https://github.com/torrentpier/torrentpier/pull/1514) ([belomaxorka](https://github.com/belomaxorka))
|
||||
|
|
|
@ -459,15 +459,11 @@ if (($bb_cfg['board_disable'] || is_file(BB_DISABLED)) && !defined('IN_ADMIN') &
|
|||
if ($bb_cfg['board_disable']) {
|
||||
// admin lock
|
||||
send_no_cache_headers();
|
||||
if (\TorrentPier\Helpers\CronHelper::isEnabled()) {
|
||||
bb_die('BOARD_DISABLE', 503);
|
||||
}
|
||||
bb_die('BOARD_DISABLE', 503);
|
||||
} elseif (is_file(BB_DISABLED)) {
|
||||
// trigger lock
|
||||
TorrentPier\Helpers\CronHelper::releaseDeadlock();
|
||||
send_no_cache_headers();
|
||||
if (\TorrentPier\Helpers\CronHelper::isEnabled()) {
|
||||
bb_die('BOARD_DISABLE_CRON', 503);
|
||||
}
|
||||
bb_die('BOARD_DISABLE_CRON', (\TorrentPier\Helpers\CronHelper::isEnabled() ? 503 : null));
|
||||
}
|
||||
}
|
||||
|
|
16
src/Ajax.php
16
src/Ajax.php
|
@ -21,13 +21,13 @@ class Ajax
|
|||
public array $response = [];
|
||||
|
||||
public array $valid_actions = [
|
||||
// ACTION NAME => [AJAX_AUTH, IN_ADMIN_CP (optional)]
|
||||
// ACTION NAME => [AJAX_AUTH]
|
||||
'edit_user_profile' => ['admin'],
|
||||
'change_user_rank' => ['admin'],
|
||||
'change_user_opt' => ['admin'],
|
||||
'manage_user' => ['admin'],
|
||||
'manage_admin' => ['admin', true],
|
||||
'sitemap' => ['admin', true],
|
||||
'manage_admin' => ['admin'],
|
||||
'sitemap' => ['admin'],
|
||||
|
||||
'mod_action' => ['mod'],
|
||||
'topic_tpl' => ['mod'],
|
||||
|
@ -89,12 +89,10 @@ class Ajax
|
|||
|
||||
// Exit if board is disabled via ON/OFF trigger or by admin
|
||||
if ($bb_cfg['board_disable'] || is_file(BB_DISABLED)) {
|
||||
if (!isset($action_params[1]) || $action_params[1] !== true) {
|
||||
if ($bb_cfg['board_disable']) {
|
||||
$this->ajax_die($lang['BOARD_DISABLE']);
|
||||
} elseif (is_file(BB_DISABLED)) {
|
||||
$this->ajax_die($lang['BOARD_DISABLE_CRON']);
|
||||
}
|
||||
if ($bb_cfg['board_disable']) {
|
||||
$this->ajax_die($lang['BOARD_DISABLE']);
|
||||
} elseif (is_file(BB_DISABLED) && $this->action !== 'manage_admin') {
|
||||
$this->ajax_die($lang['BOARD_DISABLE_CRON']);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue