group sync

This commit is contained in:
Roland Gruber 2018-11-17 20:43:59 +01:00
parent bb9f1f0eff
commit 92115264fb
1 changed files with 4 additions and 9 deletions

View File

@ -1804,14 +1804,12 @@ class windowsUser extends baseModule implements passwordService {
$typeManager = new TypeManager(); $typeManager = new TypeManager();
$syncTypes = $typeManager->getConfiguredTypesForScopes(array('group', 'gon', 'user')); $syncTypes = $typeManager->getConfiguredTypesForScopes(array('group', 'gon', 'user'));
$syncActive = false; $syncActive = false;
$syncUnixActive = false;
$syncGonActive = false; $syncGonActive = false;
$possibleGonSyncModules = array('groupOfNames', 'groupOfMembers', 'groupOfUniqueNames'); $possibleGonSyncModules = array('groupOfNames', 'groupOfMembers', 'groupOfUniqueNames');
foreach ($syncTypes as $syncType) { foreach ($syncTypes as $syncType) {
$modules = $syncType->getModules(); $modules = $syncType->getModules();
foreach ($possibleGonSyncModules as $possibleModule) { foreach ($possibleGonSyncModules as $possibleModule) {
if (in_array($possibleModule, $modules)) { if (in_array($possibleModule, $modules)) {
$syncActive = true;
$syncGonActive = true; $syncGonActive = true;
break; break;
} }
@ -1819,7 +1817,6 @@ class windowsUser extends baseModule implements passwordService {
} }
if (in_array('posixAccount', $this->getAccountContainer()->get_type()->getModules())) { if (in_array('posixAccount', $this->getAccountContainer()->get_type()->getModules())) {
$syncActive = true; $syncActive = true;
$syncUnixActive = true;
} }
$syncActive = $syncActive && !$this->isBooleanConfigOptionSet('windowsUser_syncGroups'); $syncActive = $syncActive && !$this->isBooleanConfigOptionSet('windowsUser_syncGroups');
if ($syncActive) { if ($syncActive) {
@ -1829,12 +1826,10 @@ class windowsUser extends baseModule implements passwordService {
$return->addElement($syncOptionTable, true); $return->addElement($syncOptionTable, true);
$return->addVerticalSpace('1rem'); $return->addVerticalSpace('1rem');
$syncButtons = new htmlGroup(); $syncButtons = new htmlGroup();
if ($syncUnixActive) { $u2wButton = new htmlAccountPageButton(get_class($this), 'group', 'syncU2W', _('Sync Unix to Windows'));
$u2wButton = new htmlAccountPageButton(get_class($this), 'group', 'syncU2W', _('Sync Unix to Windows')); $u2wButton->setIconClass('unixButton');
$u2wButton->setIconClass('unixButton'); $syncButtons->addElement($u2wButton);
$syncButtons->addElement($u2wButton); $syncButtons->addElement(new htmlSpacer('2rem', null));
$syncButtons->addElement(new htmlSpacer('2rem', null));
}
if ($syncGonActive) { if ($syncGonActive) {
$g2wButton = new htmlAccountPageButton(get_class($this), 'group', 'syncG2W', _('Sync group of names to Windows')); $g2wButton = new htmlAccountPageButton(get_class($this), 'group', 'syncG2W', _('Sync group of names to Windows'));
$g2wButton->setIconClass('groupButton'); $g2wButton->setIconClass('groupButton');