mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 06:13:58 -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:**
|
**Merged pull requests:**
|
||||||
|
|
||||||
- Release 2.4.4 🦩 ([belomaxorka](https://github.com/belomaxorka))
|
- 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))
|
- 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))
|
- 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))
|
- [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']) {
|
if ($bb_cfg['board_disable']) {
|
||||||
// admin lock
|
// admin lock
|
||||||
send_no_cache_headers();
|
send_no_cache_headers();
|
||||||
if (\TorrentPier\Helpers\CronHelper::isEnabled()) {
|
|
||||||
bb_die('BOARD_DISABLE', 503);
|
bb_die('BOARD_DISABLE', 503);
|
||||||
}
|
|
||||||
} elseif (is_file(BB_DISABLED)) {
|
} elseif (is_file(BB_DISABLED)) {
|
||||||
// trigger lock
|
// trigger lock
|
||||||
TorrentPier\Helpers\CronHelper::releaseDeadlock();
|
TorrentPier\Helpers\CronHelper::releaseDeadlock();
|
||||||
send_no_cache_headers();
|
send_no_cache_headers();
|
||||||
if (\TorrentPier\Helpers\CronHelper::isEnabled()) {
|
bb_die('BOARD_DISABLE_CRON', (\TorrentPier\Helpers\CronHelper::isEnabled() ? 503 : null));
|
||||||
bb_die('BOARD_DISABLE_CRON', 503);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/Ajax.php
10
src/Ajax.php
|
@ -21,13 +21,13 @@ class Ajax
|
||||||
public array $response = [];
|
public array $response = [];
|
||||||
|
|
||||||
public array $valid_actions = [
|
public array $valid_actions = [
|
||||||
// ACTION NAME => [AJAX_AUTH, IN_ADMIN_CP (optional)]
|
// ACTION NAME => [AJAX_AUTH]
|
||||||
'edit_user_profile' => ['admin'],
|
'edit_user_profile' => ['admin'],
|
||||||
'change_user_rank' => ['admin'],
|
'change_user_rank' => ['admin'],
|
||||||
'change_user_opt' => ['admin'],
|
'change_user_opt' => ['admin'],
|
||||||
'manage_user' => ['admin'],
|
'manage_user' => ['admin'],
|
||||||
'manage_admin' => ['admin', true],
|
'manage_admin' => ['admin'],
|
||||||
'sitemap' => ['admin', true],
|
'sitemap' => ['admin'],
|
||||||
|
|
||||||
'mod_action' => ['mod'],
|
'mod_action' => ['mod'],
|
||||||
'topic_tpl' => ['mod'],
|
'topic_tpl' => ['mod'],
|
||||||
|
@ -89,14 +89,12 @@ class Ajax
|
||||||
|
|
||||||
// Exit if board is disabled via ON/OFF trigger or by admin
|
// Exit if board is disabled via ON/OFF trigger or by admin
|
||||||
if ($bb_cfg['board_disable'] || is_file(BB_DISABLED)) {
|
if ($bb_cfg['board_disable'] || is_file(BB_DISABLED)) {
|
||||||
if (!isset($action_params[1]) || $action_params[1] !== true) {
|
|
||||||
if ($bb_cfg['board_disable']) {
|
if ($bb_cfg['board_disable']) {
|
||||||
$this->ajax_die($lang['BOARD_DISABLE']);
|
$this->ajax_die($lang['BOARD_DISABLE']);
|
||||||
} elseif (is_file(BB_DISABLED)) {
|
} elseif (is_file(BB_DISABLED) && $this->action !== 'manage_admin') {
|
||||||
$this->ajax_die($lang['BOARD_DISABLE_CRON']);
|
$this->ajax_die($lang['BOARD_DISABLE_CRON']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Auth check
|
// Auth check
|
||||||
switch ($action_params[0]) {
|
switch ($action_params[0]) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue