responsive settings

This commit is contained in:
Roland Gruber 2017-12-02 17:51:59 +01:00
parent c61c2dac54
commit 059d987cc9
1 changed files with 48 additions and 52 deletions

View File

@ -1917,9 +1917,9 @@ class posixAccount extends baseModule implements passwordService {
); );
if (in_array('user', $scopes)) { if (in_array('user', $scopes)) {
// user options // user options
$configUserContainer = new htmlTable(); $configUserContainer = new htmlResponsiveRow();
$configUserContainer->addElement(new htmlSubTitle(_("Users")), true); $configUserContainer->add(new htmlSubTitle(_("Users")), 12);
$uidGeneratorSelect = new htmlTableExtendedSelect('posixAccount_uidGeneratorUsers', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); $uidGeneratorSelect = new htmlResponsiveSelect('posixAccount_uidGeneratorUsers', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator');
$uidGeneratorSelect->setHasDescriptiveElements(true); $uidGeneratorSelect->setHasDescriptiveElements(true);
$uidGeneratorSelect->setTableRowsToHide(array( $uidGeneratorSelect->setTableRowsToHide(array(
'range' => array('posixAccount_sambaIDPoolDNUsers', 'posixAccount_windowsIDPoolDNUsers', 'posixAccount_magicNumberUser'), 'range' => array('posixAccount_sambaIDPoolDNUsers', 'posixAccount_windowsIDPoolDNUsers', 'posixAccount_magicNumberUser'),
@ -1933,30 +1933,30 @@ class posixAccount extends baseModule implements passwordService {
'windowsDomain' => array('posixAccount_windowsIDPoolDNUsers'), 'windowsDomain' => array('posixAccount_windowsIDPoolDNUsers'),
'magicNumber' => array('posixAccount_magicNumberUser') 'magicNumber' => array('posixAccount_magicNumberUser')
)); ));
$configUserContainer->addElement($uidGeneratorSelect, true); $configUserContainer->add($uidGeneratorSelect, 12);
$uidUsersGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNUsers', null, 'sambaIDPoolDN'); $uidUsersGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNUsers', null, 'sambaIDPoolDN');
$uidUsersGeneratorDN->setRequired(true); $uidUsersGeneratorDN->setRequired(true);
$configUserContainer->addElement($uidUsersGeneratorDN, true); $configUserContainer->add($uidUsersGeneratorDN, 12);
$uidUsersGeneratorWinDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNUsers', null, 'windowsIDPoolDN'); $uidUsersGeneratorWinDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNUsers', null, 'windowsIDPoolDN');
$uidUsersGeneratorWinDN->setRequired(true); $uidUsersGeneratorWinDN->setRequired(true);
$configUserContainer->addElement($uidUsersGeneratorWinDN, true); $configUserContainer->add($uidUsersGeneratorWinDN, 12);
$minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minUID', null, 'minMaxUser'); $minUid = new htmlResponsiveInputField(_('Minimum UID number'), 'posixAccount_minUID', null, 'minMaxUser');
$minUid->setRequired(true); $minUid->setRequired(true);
$configUserContainer->addElement($minUid, true); $configUserContainer->add($minUid, 12);
$maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxUID', null, 'minMaxUser'); $maxUid = new htmlResponsiveInputField(_('Maximum UID number'), 'posixAccount_maxUID', null, 'minMaxUser');
$maxUid->setRequired(true); $maxUid->setRequired(true);
$configUserContainer->addElement($maxUid, true); $configUserContainer->add($maxUid, 12);
$magicNumberUser = new htmlTableExtendedInputField(_('Magic number'), 'posixAccount_magicNumberUser', null, 'magicNumber'); $magicNumberUser = new htmlResponsiveInputField(_('Magic number'), 'posixAccount_magicNumberUser', null, 'magicNumber');
$magicNumberUser->setRequired(true); $magicNumberUser->setRequired(true);
$configUserContainer->addElement($magicNumberUser, true); $configUserContainer->add($magicNumberUser, 12);
$configUserContainer->addElement(new htmlTableExtendedInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixUser', '', 'uidCheckSuffix'), true); $configUserContainer->add(new htmlResponsiveInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixUser', '', 'uidCheckSuffix'), 12);
$return[] = $configUserContainer; $return[] = $configUserContainer;
} }
// host options // host options
if (in_array('host', $scopes)) { if (in_array('host', $scopes)) {
$configHostContainer = new htmlTable(); $configHostContainer = new htmlResponsiveRow();
$configHostContainer->addElement(new htmlSubTitle(_("Hosts")), true); $configHostContainer->add(new htmlSubTitle(_("Hosts")), 12);
$uidHostGeneratorSelect = new htmlTableExtendedSelect('posixAccount_uidGeneratorHosts', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator'); $uidHostGeneratorSelect = new htmlResponsiveSelect('posixAccount_uidGeneratorHosts', $generatorOptions, array('range'), _('UID generator'), 'uidGenerator');
$uidHostGeneratorSelect->setHasDescriptiveElements(true); $uidHostGeneratorSelect->setHasDescriptiveElements(true);
$uidHostGeneratorSelect->setTableRowsToHide(array( $uidHostGeneratorSelect->setTableRowsToHide(array(
'range' => array('posixAccount_sambaIDPoolDNHosts', 'posixAccount_windowsIDPoolDNHosts', 'posixAccount_magicNumberHost'), 'range' => array('posixAccount_sambaIDPoolDNHosts', 'posixAccount_windowsIDPoolDNHosts', 'posixAccount_magicNumberHost'),
@ -1970,60 +1970,56 @@ class posixAccount extends baseModule implements passwordService {
'windowsDomain' => array('posixAccount_windowsIDPoolDNHosts'), 'windowsDomain' => array('posixAccount_windowsIDPoolDNHosts'),
'magicNumber' => array('posixAccount_magicNumberHost') 'magicNumber' => array('posixAccount_magicNumberHost')
)); ));
$configHostContainer->addElement($uidHostGeneratorSelect, true); $configHostContainer->add($uidHostGeneratorSelect, 12);
$uidHostsGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNHosts', null, 'sambaIDPoolDN'); $uidHostsGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixAccount_sambaIDPoolDNHosts', null, 'sambaIDPoolDN');
$uidHostsGeneratorDN->setRequired(true); $uidHostsGeneratorDN->setRequired(true);
$configHostContainer->addElement($uidHostsGeneratorDN, true); $configHostContainer->add($uidHostsGeneratorDN, 12);
$uidHostsGeneratorWinDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNHosts', null, 'windowsIDPoolDN'); $uidHostsGeneratorWinDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixAccount_windowsIDPoolDNHosts', null, 'windowsIDPoolDN');
$uidHostsGeneratorWinDN->setRequired(true); $uidHostsGeneratorWinDN->setRequired(true);
$configHostContainer->addElement($uidHostsGeneratorWinDN, true); $configHostContainer->add($uidHostsGeneratorWinDN, 12);
$minUid = new htmlTableExtendedInputField(_('Minimum UID number'), 'posixAccount_minMachine', null, 'minMaxHost'); $minUid = new htmlResponsiveInputField(_('Minimum UID number'), 'posixAccount_minMachine', null, 'minMaxHost');
$minUid->setRequired(true); $minUid->setRequired(true);
$configHostContainer->addElement($minUid, true); $configHostContainer->add($minUid, 12);
$maxUid = new htmlTableExtendedInputField(_('Maximum UID number'), 'posixAccount_maxMachine', null, 'minMaxHost'); $maxUid = new htmlResponsiveInputField(_('Maximum UID number'), 'posixAccount_maxMachine', null, 'minMaxHost');
$maxUid->setRequired(true); $maxUid->setRequired(true);
$configHostContainer->addElement($maxUid, true); $configHostContainer->add($maxUid, 12);
$magicNumberHost = new htmlTableExtendedInputField(_('Magic number'), 'posixAccount_magicNumberHost', null, 'magicNumber'); $magicNumberHost = new htmlResponsiveInputField(_('Magic number'), 'posixAccount_magicNumberHost', null, 'magicNumber');
$magicNumberHost->setRequired(true); $magicNumberHost->setRequired(true);
$configHostContainer->addElement($magicNumberHost, true); $configHostContainer->add($magicNumberHost, 12);
$configHostContainer->addElement(new htmlTableExtendedInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixHost', '', 'uidCheckSuffix'), true); $configHostContainer->add(new htmlResponsiveInputField(_('Suffix for UID/user name check'), 'posixAccount_uidCheckSuffixHost', '', 'uidCheckSuffix'), 12);
$return[] = $configHostContainer; $return[] = $configHostContainer;
} }
// common options // common options
$configOptionsContainer = new htmlTable(); $configOptionsContainer = new htmlResponsiveRow();
$configOptionsContainer->addElement(new htmlSubTitle(_('Options')), true); $configOptionsContainer->add(new htmlSubTitle(_('Options')), 12);
$configOptionsContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', getSupportedHashTypes(), $configOptionsContainer->add(new htmlResponsiveSelect('posixAccount_pwdHash', getSupportedHashTypes(),
array('SSHA'), _("Password hash type"), 'pwdHash'), true); array('SSHA'), _("Password hash type"), 'pwdHash'), 12);
$configOptionsContainer->addElement(new htmlTableExtendedInputTextarea('posixAccount_shells', implode("\r\n", $this->getShells()), 30, 4, _('Login shells'), 'loginShells'), true); $configOptionsContainer->add(new htmlResponsiveInputTextarea('posixAccount_shells', implode("\r\n", $this->getShells()), 30, 4, _('Login shells'), 'loginShells'), 12);
$hiddenOptionsContainer = new htmlGroup(); $hiddenOptionsContainerHead = new htmlGroup();
$hiddenOptionsContainer->colspan = 5;
$hiddenOptionsContainerHead = new htmlTable();
$hiddenOptionsContainerHead->addElement(new htmlOutputText(_('Hidden options'))); $hiddenOptionsContainerHead->addElement(new htmlOutputText(_('Hidden options')));
$hiddenOptionsContainerHead->addElement(new htmlHelpLink('hiddenOptions')); $hiddenOptionsContainerHead->addElement(new htmlHelpLink('hiddenOptions'));
$hiddenOptionsContainer->addElement($hiddenOptionsContainerHead); $configOptionsContainer->addLabel($hiddenOptionsContainerHead, 12);
$configContainerOptions = new htmlTable(); $configOptionsContainer->addField(new htmlOutputText(''));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hidegecos', false, _('Gecos'), null, false)); $configOptionsContainer->addVerticalSpacer('0.5rem');
$configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hidegecos', false, _('Gecos'), null, false), 12);
if (isset($_SESSION['conf_config'])) { if (isset($_SESSION['conf_config'])) {
$confActiveGONModules = array_merge($_SESSION['conf_config']->get_AccountModules('group'), $_SESSION['conf_config']->get_AccountModules('gon')); $confActiveGONModules = array_merge($_SESSION['conf_config']->get_AccountModules('group'), $_SESSION['conf_config']->get_AccountModules('gon'));
if (in_array('groupOfNames', $confActiveGONModules) || in_array('groupOfMembers', $confActiveGONModules) || in_array('groupOfUniqueNames', $confActiveGONModules)) { if (in_array('groupOfNames', $confActiveGONModules) || in_array('groupOfMembers', $confActiveGONModules) || in_array('groupOfUniqueNames', $confActiveGONModules)) {
$configContainerOptions->addElement(new htmlOutputText(' ')); $configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hidegon', false, _('Groups of names'), null, false), 12);
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hidegon', false, _('Groups of names'), null, false)); $configOptionsContainer->add(new htmlResponsiveInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false), 12);
$configContainerOptions->addElement(new htmlOutputText(' '));
$configContainerOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_hideposixGroups', false, _('Unix groups'), null, false));
} }
} }
$hiddenOptionsContainer->addElement($configContainerOptions); $configOptionsContainer->addVerticalSpacer('1rem');
$configOptionsContainer->addElement($hiddenOptionsContainer, true); $advancedOptions = new htmlResponsiveRow();
$advancedOptions = new htmlTable(); $advancedOptions->add(new htmlResponsiveInputCheckbox('posixAccount_primaryGroupAsSecondary', false, _('Set primary group as memberUid'), 'primaryGroupAsSecondary'), 12);
$advancedOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_primaryGroupAsSecondary', false, _('Set primary group as memberUid'), 'primaryGroupAsSecondary'), true);
$isWindows = array_key_exists('windowsUser', $allScopes); $isWindows = array_key_exists('windowsUser', $allScopes);
if ($isWindows) { if ($isWindows) {
$advancedOptions->addElement(new htmlTableExtendedInputCheckbox('posixAccount_noObjectClass', false, _('Do not add object class'), 'noObjectClass'), true); $advancedOptions->add(new htmlResponsiveInputCheckbox('posixAccount_noObjectClass', false, _('Do not add object class'), 'noObjectClass'), 12);
} }
$advancedOptions->addElement(new htmlTableExtendedInputField(_('User name suggestion'), 'posixAccount_userNameSuggestion', '@givenname@%sn%', 'userNameSuggestion')); $advancedOptions->add(new htmlResponsiveInputField(_('User name suggestion'), 'posixAccount_userNameSuggestion', '@givenname@%sn%', 'userNameSuggestion'), 12);
$advancedOptionsAccordion = new htmlAccordion('posixAccountAdvancedOptions', array(_('Advanced options') => $advancedOptions), false); $advancedOptionsAccordion = new htmlAccordion('posixAccountAdvancedOptions', array(_('Advanced options') => $advancedOptions), false);
$advancedOptionsAccordion->colspan = 5; $advancedOptionsAccordion->colspan = 5;
$configOptionsContainer->addElement($advancedOptionsAccordion); $configOptionsContainer->add($advancedOptionsAccordion, 12);
$return[] = $configOptionsContainer; $return[] = $configOptionsContainer;
return $return; return $return;