mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
Compare commits
15 commits
9ecd1e4dd4
...
546cf61dbd
Author | SHA1 | Date | |
---|---|---|---|
|
546cf61dbd | ||
|
d67493e887 | ||
|
149d0bd227 | ||
|
8c8f7315ea | ||
|
eb12d385a0 | ||
|
b502fe9fbc | ||
|
d318768634 | ||
|
843cb97048 | ||
|
b5f867c3cc | ||
|
ec1f322440 | ||
|
a85c36b15e | ||
|
76ab83893b | ||
|
42108b5e11 | ||
|
8dd6b5373d | ||
|
6c45c1ff6b |
5 changed files with 54 additions and 26 deletions
36
.github/workflows/tests.yml
vendored
36
.github/workflows/tests.yml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 100
|
fetch-depth: 100
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
||||||
|
@ -166,7 +166,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- id: database-type
|
- id: database-type
|
||||||
env:
|
env:
|
||||||
|
@ -192,7 +192,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
||||||
|
@ -218,9 +218,9 @@ jobs:
|
||||||
.github/setup-ldap.sh
|
.github/setup-ldap.sh
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
- name: Setup node dependencies
|
- name: Setup node dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- id: database-type
|
- id: database-type
|
||||||
env:
|
env:
|
||||||
|
@ -329,7 +329,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
||||||
|
@ -350,9 +350,9 @@ jobs:
|
||||||
.github/setup-database.sh $DB $MYISAM
|
.github/setup-database.sh $DB $MYISAM
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
- name: Setup node dependencies
|
- name: Setup node dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- id: database-type
|
- id: database-type
|
||||||
env:
|
env:
|
||||||
|
@ -441,7 +441,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
||||||
|
@ -462,9 +462,9 @@ jobs:
|
||||||
.github/setup-database.sh $DB $MYISAM
|
.github/setup-database.sh $DB $MYISAM
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
- name: Setup node dependencies
|
- name: Setup node dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
@ -491,7 +491,7 @@ jobs:
|
||||||
git config --system core.autocrlf false
|
git config --system core.autocrlf false
|
||||||
git config --system core.eol lf
|
git config --system core.eol lf
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
|
@ -509,7 +509,7 @@ jobs:
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Cache Composer dependencies
|
- name: Cache Composer dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
key: composer-${{ matrix.php }}-${{ hashFiles('phpBB/composer.lock') }}
|
||||||
|
@ -578,9 +578,9 @@ jobs:
|
||||||
Set-MpPreference -DisableRealtimeMonitoring $true
|
Set-MpPreference -DisableRealtimeMonitoring $true
|
||||||
|
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 20
|
||||||
- name: Setup node dependencies
|
- name: Setup node dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ class auth_admin extends \phpbb\auth\auth
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);
|
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%') : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -159,9 +159,9 @@ $lang = array_merge($lang, array(
|
||||||
'ACL_M_MERGE' => 'Can merge topics',
|
'ACL_M_MERGE' => 'Can merge topics',
|
||||||
|
|
||||||
'ACL_M_INFO' => 'Can view post details',
|
'ACL_M_INFO' => 'Can view post details',
|
||||||
'ACL_M_WARN' => 'Can issue warnings<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
|
'ACL_M_WARN' => 'Can issue warnings',
|
||||||
'ACL_M_PM_REPORT' => 'Can close and delete reports of private messages<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
|
'ACL_M_PM_REPORT' => 'Can close and delete reports of private messages',
|
||||||
'ACL_M_BAN' => 'Can manage bans<br /><em>This setting is only assigned globally. It is not forum based.</em>', // This moderator setting is only global (and not local)
|
'ACL_M_BAN' => 'Can manage bans',
|
||||||
));
|
));
|
||||||
|
|
||||||
// Admin Permissions
|
// Admin Permissions
|
||||||
|
|
|
@ -772,6 +772,7 @@ class auth
|
||||||
|
|
||||||
$sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? 'group_id = ' . (int) $group_id : $db->sql_in_set('group_id', array_map('intval', $group_id))) : '';
|
$sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? 'group_id = ' . (int) $group_id : $db->sql_in_set('group_id', array_map('intval', $group_id))) : '';
|
||||||
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
|
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : '';
|
||||||
|
$sql_is_local = $forum_id !== false ? 'AND ao.is_local <> 0' : '';
|
||||||
|
|
||||||
$sql_opts = '';
|
$sql_opts = '';
|
||||||
$hold_ary = $sql_ary = array();
|
$hold_ary = $sql_ary = array();
|
||||||
|
@ -783,9 +784,10 @@ class auth
|
||||||
|
|
||||||
// Grab group settings - non-role specific...
|
// Grab group settings - non-role specific...
|
||||||
$sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
|
$sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option
|
||||||
FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao
|
FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " ao
|
||||||
WHERE a.auth_role_id = 0
|
WHERE a.auth_role_id = 0
|
||||||
AND a.auth_option_id = ao.auth_option_id ' .
|
AND a.auth_option_id = ao.auth_option_id
|
||||||
|
$sql_is_local " .
|
||||||
(($sql_group) ? 'AND a.' . $sql_group : '') . "
|
(($sql_group) ? 'AND a.' . $sql_group : '') . "
|
||||||
$sql_forum
|
$sql_forum
|
||||||
$sql_opts
|
$sql_opts
|
||||||
|
@ -793,9 +795,10 @@ class auth
|
||||||
|
|
||||||
// Now grab group settings - role specific...
|
// Now grab group settings - role specific...
|
||||||
$sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
|
$sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option
|
||||||
FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao
|
FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . " ao
|
||||||
WHERE a.auth_role_id = r.role_id
|
WHERE a.auth_role_id = r.role_id
|
||||||
AND r.auth_option_id = ao.auth_option_id ' .
|
$sql_is_local
|
||||||
|
AND r.auth_option_id = ao.auth_option_id " .
|
||||||
(($sql_group) ? 'AND a.' . $sql_group : '') . "
|
(($sql_group) ? 'AND a.' . $sql_group : '') . "
|
||||||
$sql_forum
|
$sql_forum
|
||||||
$sql_opts
|
$sql_opts
|
||||||
|
|
|
@ -124,4 +124,29 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
|
||||||
$auth->acl($user_data);
|
$auth->acl($user_data);
|
||||||
$this->assertEquals(0, $auth->acl_get($permission));
|
$this->assertEquals(0, $auth->acl_get($permission));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_forum_permissions_misc()
|
||||||
|
{
|
||||||
|
// Open forum moderators permissions page
|
||||||
|
$crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=setting_mod_local&sid=" . $this->sid);
|
||||||
|
|
||||||
|
// Select "Your first forum"
|
||||||
|
$form = $crawler->filter('#select_victim')->form(['forum_id' => [2]]);
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
|
// Select "Global moderators"
|
||||||
|
$form = $crawler->filter('#add_groups')->form(['group_id' => [4]]);
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
|
// Check that global permissions are not displayed
|
||||||
|
$this->add_lang('acp/permissions_phpbb');
|
||||||
|
$page_text = $crawler->text();
|
||||||
|
$this->assertNotContainsLang('ACL_M_BAN', $page_text);
|
||||||
|
$this->assertNotContainsLang('ACL_M_PM_REPORT', $page_text);
|
||||||
|
$this->assertNotContainsLang('ACL_M_WARN', $page_text);
|
||||||
|
|
||||||
|
// Check that other permissions exist
|
||||||
|
$this->assertContainsLang('ACL_M_EDIT', $page_text);
|
||||||
|
$this->assertContainsLang('ACL_M_MOVE', $page_text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue