mirror of
https://github.com/cupcakearmy/plugin-oauth2.git
synced 2024-06-13 17:04:52 +02:00
Better handling of empty group filter
Check if oauth2_key_group_filter is empty before exploding it. Else isGroupInFilter does not catch _if (empty($filter))_ because the $filter array contains 1.
This commit is contained in:
parent
f41ed17bd3
commit
8b6cecd863
|
@ -195,7 +195,12 @@ class GenericOAuth2UserProvider extends Base implements UserProviderInterface
|
|||
$this->logger->debug('OAuth2: '.$this->getUsername().' groups are '. join(',', $groups));
|
||||
|
||||
$filteredGroups = array();
|
||||
$groupFilter = explode(',',$this->configModel->get('oauth2_key_group_filter'));
|
||||
$groupFilter = array();
|
||||
|
||||
$confGroupFilter = $this->configModel->get('oauth2_key_group_filter');
|
||||
if (!empty($confGroupFilter)) {
|
||||
$groupFilter = explode(',',$confGroupFilter);
|
||||
}
|
||||
|
||||
foreach ($groups as $group) {
|
||||
if ( $this->isGroupInFilter($group, $groupFilter)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user