use type id in $allScopes
This commit is contained in:
parent
07b885a2ad
commit
854231d0e2
|
@ -638,7 +638,7 @@ abstract class baseModule {
|
|||
* We recommend to use the module name as prefix for them (e.g. posixAccount_homeDirectory) to avoid naming conflicts.
|
||||
*
|
||||
* @param array $scopes account types (user, group, host)
|
||||
* @param array $allScopes list of all active account modules and their scopes (module => array(scopes))
|
||||
* @param array $allScopes list of all active account modules and their account type id (module => array(type id))
|
||||
* @return mixed htmlElement or array of htmlElement
|
||||
*
|
||||
* @see baseModule::get_metaData()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
use \LAM\TYPES\TypeManager;
|
||||
use function LAM\TYPES\getScopeFromTypeId;
|
||||
/*
|
||||
$Id$
|
||||
|
||||
|
@ -586,8 +587,18 @@ class posixGroup extends baseModule implements passwordService {
|
|||
$configContainer->add($magicNumber, 12);
|
||||
$configContainer->add(new htmlResponsiveInputField(_('Suffix for GID/group name check'), 'posixGroup_gidCheckSuffix', '', 'gidCheckSuffix'), 12);
|
||||
$configContainer->add(new htmlResponsiveInputCheckbox('posixGroup_hidememberUid', false, _('Disable membership management'), 'hidememberUid'), 12);
|
||||
if ((!empty($allScopes['groupOfNames']) && in_array('group', $allScopes['groupOfNames']))
|
||||
|| (!empty($allScopes['groupOfUniqueNames']) && in_array('group', $allScopes['groupOfUniqueNames']))) {
|
||||
$gonModules = array('groupOfNames', 'groupOfUniqueNames');
|
||||
$gonFound = false;
|
||||
foreach ($gonModules as $gonModule) {
|
||||
if (!empty($allScopes[$gonModule])) {
|
||||
foreach ($allScopes[$gonModule] as $gonTypeId) {
|
||||
if (getScopeFromTypeId($gonTypeId) === 'group') {
|
||||
$gonFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($gonFound) {
|
||||
$configContainer->add(new htmlResponsiveInputCheckbox('posixGroup_autoSyncGon', false, _('Force sync with group of names'), 'autoSyncGon'), 12);
|
||||
}
|
||||
// display password hash option only if posixAccount module is not used
|
||||
|
|
|
@ -134,7 +134,7 @@ $scopes = array();
|
|||
foreach ($types as $type) {
|
||||
$mods = $conf->get_AccountModules($type->getId());
|
||||
for ($i = 0; $i < sizeof($mods); $i++) {
|
||||
$scopes[$mods[$i]][] = $type->getScope();
|
||||
$scopes[$mods[$i]][] = $type->getId();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue