1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 06:51:33 +02:00

Merge pull request #6541 from Crizz0/ticket/17093-master

[ticket/17093] Add ACP setting to limit access to disabled board
This commit is contained in:
Marc Alexander
2024-02-22 20:01:59 +01:00
committed by GitHub
7 changed files with 254 additions and 3 deletions

View File

@@ -372,7 +372,27 @@ class user extends \phpbb\session
}
// Is board disabled and user not an admin or moderator?
if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
// Check acp setting who has access: only admins "case: 0", plus global moderators "case: 1" and plus moderators "case: 2"
$board_disable_access = (int) $config['board_disable_access'];
switch ($board_disable_access)
{
case 0:
$access_disabled_board = $auth->acl_gets('a_');
break;
case 1:
$access_disabled_board = $auth->acl_gets('a_', 'm_');
break;
case 2:
default:
$access_disabled_board = $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_');
break;
}
if ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$access_disabled_board)
{
if ($this->data['is_bot'])
{