From f77adfe858d7d7d889d5147e0ff5e97a84eca2df Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 14 Aug 2019 20:49:10 +0200 Subject: [PATCH] fixed config issue --- lam/lib/modules/posixAccount.inc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index ba215ac8..a111a820 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -2185,7 +2185,17 @@ class posixAccount extends baseModule implements passwordService { _('Windows domain info') => 'windowsDomain', _('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 $configUserContainer = new htmlResponsiveRow(); $configUserContainer->add(new htmlSubTitle(_("Users")), 12); @@ -2257,7 +2267,7 @@ class posixAccount extends baseModule implements passwordService { $return[] = $configUserContainer; } // host options - if (in_array('host', $scopes)) { + if ($hasHostConfig) { $configHostContainer = new htmlResponsiveRow(); $configHostContainer->add(new htmlSubTitle(_("Hosts")), 12); foreach ($allScopes[get_class($this)] as $typeId) {