fixed config issue

This commit is contained in:
Roland Gruber 2019-08-14 20:49:10 +02:00
parent 71283f3b53
commit f77adfe858
1 changed files with 12 additions and 2 deletions

View File

@ -2185,7 +2185,17 @@ class posixAccount extends baseModule implements passwordService {
_('Windows domain info') => 'windowsDomain', _('Windows domain info') => 'windowsDomain',
_('Magic number') => 'magicNumber' _('Magic number') => 'magicNumber'
); );
if (in_array('user', $scopes)) { $hasUserConfig = false;
$hasHostConfig = false;
foreach ($scopes as $typeId) {
if (getScopeFromTypeId($typeId) === 'user') {
$hasUserConfig = true;
}
elseif (getScopeFromTypeId($typeId) === 'host') {
$hasHostConfig = true;
}
}
if ($hasUserConfig) {
// user options // user options
$configUserContainer = new htmlResponsiveRow(); $configUserContainer = new htmlResponsiveRow();
$configUserContainer->add(new htmlSubTitle(_("Users")), 12); $configUserContainer->add(new htmlSubTitle(_("Users")), 12);
@ -2257,7 +2267,7 @@ class posixAccount extends baseModule implements passwordService {
$return[] = $configUserContainer; $return[] = $configUserContainer;
} }
// host options // host options
if (in_array('host', $scopes)) { if ($hasHostConfig) {
$configHostContainer = new htmlResponsiveRow(); $configHostContainer = new htmlResponsiveRow();
$configHostContainer->add(new htmlSubTitle(_("Hosts")), 12); $configHostContainer->add(new htmlSubTitle(_("Hosts")), 12);
foreach ($allScopes[get_class($this)] as $typeId) { foreach ($allScopes[get_class($this)] as $typeId) {