1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-20 23:41:29 +02:00

[ticket/17093] Add new board settings option for disable board access

PHPBB3-17093
This commit is contained in:
Christian Schnegelberger
2023-01-17 19:49:07 +01:00
parent 276d793c7b
commit d86c51f9e3
5 changed files with 65 additions and 1 deletions

View File

@@ -372,7 +372,23 @@ 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"
$disable_board_access = (int) $config['add_disable_board_access_config'];
switch ($disable_board_access) {
case 0:
$access_disabled_board = $auth->acl_gets('a_');
break;
case 1:
$access_disabled_board = $auth->acl_gets('a_') && $auth->acl_getf_global('m_');
break;
default:
case 2:
$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'])
{