responsive settings

This commit is contained in:
Roland Gruber 2017-12-02 18:07:33 +01:00
parent 059d987cc9
commit 6be073de49
3 changed files with 45 additions and 72 deletions

View File

@ -541,23 +541,20 @@ class posixGroup extends baseModule implements passwordService {
/**
* Returns a list of elements for the configuration.
*
* @param array $scopes account types (user, group, host)
* @param array $allScopes list of all modules and active scopes
* @return array configuration elements
*/
function get_configOptions($scopes, $allScopes) {
* {@inheritDoc}
* @see baseModule::get_configOptions()
*/
public function get_configOptions($scopes, $allScopes) {
// configuration options
$configContainer = new htmlTable();
$configContainer->addElement(new htmlSubTitle(_("Groups")), true);
$configContainer = new htmlResponsiveRow();
$configContainer->add(new htmlSubTitle(_("Groups")), 12);
$genOptions = array(
_('Fixed range') => 'range',
_('Samba ID pool') => 'sambaPool',
_('Windows domain info') => 'windowsDomain',
_('Magic number') => 'magicNumber'
);
$gidGeneratorSelect = new htmlTableExtendedSelect('posixGroup_gidGenerator', $genOptions, array('range'), _('GID generator'), 'gidGenerator');
$gidGeneratorSelect = new htmlResponsiveSelect('posixGroup_gidGenerator', $genOptions, array('range'), _('GID generator'), 'gidGenerator');
$gidGeneratorSelect->setHasDescriptiveElements(true);
$gidGeneratorSelect->setTableRowsToHide(array(
'range' => array('posixGroup_sambaIDPoolDN', 'posixGroup_windowsIDPoolDN', 'posixGroup_magicNumber'),
@ -571,31 +568,31 @@ class posixGroup extends baseModule implements passwordService {
'windowsDomain' => array('posixGroup_windowsIDPoolDN'),
'magicNumber' => array('posixGroup_magicNumber')
));
$configContainer->addElement($gidGeneratorSelect, true);
$minGidInput = new htmlTableExtendedInputField(_('Minimum GID number'), 'posixGroup_minGID', null, 'minMaxGID');
$configContainer->add($gidGeneratorSelect, 12);
$minGidInput = new htmlResponsiveInputField(_('Minimum GID number'), 'posixGroup_minGID', null, 'minMaxGID');
$minGidInput->setRequired(true);
$configContainer->addElement($minGidInput, true);
$maxGidInput = new htmlTableExtendedInputField(_('Maximum GID number'), 'posixGroup_maxGID', null, 'minMaxGID');
$configContainer->add($minGidInput, 12);
$maxGidInput = new htmlResponsiveInputField(_('Maximum GID number'), 'posixGroup_maxGID', null, 'minMaxGID');
$maxGidInput->setRequired(true);
$configContainer->addElement($maxGidInput, true);
$gidGeneratorDN = new htmlTableExtendedInputField(_('Samba ID pool DN'), 'posixGroup_sambaIDPoolDN', null, 'sambaIDPoolDN');
$configContainer->add($maxGidInput, 12);
$gidGeneratorDN = new htmlResponsiveInputField(_('Samba ID pool DN'), 'posixGroup_sambaIDPoolDN', null, 'sambaIDPoolDN');
$gidGeneratorDN->setRequired(true);
$configContainer->addElement($gidGeneratorDN, true);
$winGeneratorDN = new htmlTableExtendedInputField(_('Windows domain info DN'), 'posixGroup_windowsIDPoolDN', null, 'windowsIDPoolDN');
$configContainer->add($gidGeneratorDN, 12);
$winGeneratorDN = new htmlResponsiveInputField(_('Windows domain info DN'), 'posixGroup_windowsIDPoolDN', null, 'windowsIDPoolDN');
$winGeneratorDN->setRequired(true);
$configContainer->addElement($winGeneratorDN, true);
$magicNumber = new htmlTableExtendedInputField(_('Magic number'), 'posixGroup_magicNumber', null, 'magicNumber');
$configContainer->add($winGeneratorDN, 12);
$magicNumber = new htmlResponsiveInputField(_('Magic number'), 'posixGroup_magicNumber', null, 'magicNumber');
$magicNumber->setRequired(true);
$configContainer->addElement($magicNumber, true);
$configContainer->addElement(new htmlTableExtendedInputField(_('Suffix for GID/group name check'), 'posixGroup_gidCheckSuffix', '', 'gidCheckSuffix'), true);
$configContainer->addElement(new htmlTableExtendedInputCheckbox('posixGroup_hidememberUid', false, _('Disable membership management'), 'hidememberUid'), true);
$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']))) {
$configContainer->addElement(new htmlTableExtendedInputCheckbox('posixGroup_autoSyncGon', false, _('Force sync with group of names'), 'autoSyncGon'), true);
$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
if (!isset($allScopes['posixAccount'])) {
$configContainer->addElement(new htmlTableExtendedSelect('posixAccount_pwdHash', getSupportedHashTypes(), array('SSHA'), _("Password hash type"), 'pwdHash'));
$configContainer->add(new htmlResponsiveSelect('posixAccount_pwdHash', getSupportedHashTypes(), array('SSHA'), _("Password hash type"), 'pwdHash'), 12);
}
return $configContainer;
}

View File

@ -516,26 +516,14 @@ class puppetClient extends baseModule {
}
/**
* Returns a list of configuration options.
*
* Calling this method does not require the existence of an enclosing {@link accountContainer}.<br>
* <br>
* The field names are used as keywords to load and save settings.
* 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))
* @return mixed htmlElement or array of htmlElement
*
* @see htmlElement
*/
* {@inheritDoc}
* @see baseModule::get_configOptions()
*/
public function get_configOptions($scopes, $allScopes) {
$return = parent::get_configOptions($scopes, $allScopes);
$return = new htmlResponsiveRow();
// config options
$configContainer = new htmlTable();
$configContainer->addElement(new htmlTableExtendedInputTextarea('puppetClient_environments', "production\r\ntesting", 30, 5, _('Predefined environments'), 'predefinedEnvironments'), true);
$configContainer->addElement(new htmlTableExtendedInputTextarea('puppetClient_enforceClasses', '', 30, 5, _('Enforce classes'), 'enforceClasses'), true);
$return[] = $configContainer;
$return->add(new htmlResponsiveInputTextarea('puppetClient_environments', "production\r\ntesting", 30, 5, _('Predefined environments'), 'predefinedEnvironments'), 12);
$return->add(new htmlResponsiveInputTextarea('puppetClient_enforceClasses', '', 30, 5, _('Enforce classes'), 'enforceClasses'), 12);
return $return;
}

View File

@ -1869,49 +1869,37 @@ class sambaSamAccount extends baseModule implements passwordService {
if (!in_array('user', $scopes)) {
return $return;
}
$configContainer = new htmlTable();
$configContainer = new htmlResponsiveRow();
// password history
$history = new htmlTable();
$historyOptions = array(
_('yes - ordered ascending') => 'yes_deleteLast',
_('yes - ordered descending') => 'yes_deleteFirst',
_('no') => 'no'
);
$historySelect = new htmlTableExtendedSelect('sambaSamAccount_history', $historyOptions, array('yes_deleteLast'), _("Password history"), 'history');
$historySelect = new htmlResponsiveSelect('sambaSamAccount_history', $historyOptions, array('yes_deleteLast'), _("Password history"), 'history');
$historySelect->setHasDescriptiveElements(true);
$history->addElement($historySelect, true);
$configContainer->addElement($history, true);
$configContainer->add($historySelect, 12);
// disable LM passwords
$disableLM = new htmlTable();
$yesNo = array(_('yes') => 'yes', _('no') => 'no');
$lmYesNoSelect = new htmlTableExtendedSelect('sambaSamAccount_lmHash', $yesNo, array('yes'), _("Disable LM hashes"), 'lmHash');
$lmYesNoSelect = new htmlResponsiveSelect('sambaSamAccount_lmHash', $yesNo, array('yes'), _("Disable LM hashes"), 'lmHash');
$lmYesNoSelect->setHasDescriptiveElements(true);
$disableLM->addElement($lmYesNoSelect, true);
$configContainer->addElement($disableLM, true);
$configContainer->add($lmYesNoSelect, 12);
// hidden options
$configContainer->addElement(new htmlSpacer(null, '10px'), true);
$configContainer->addVerticalSpacer('1rem');
$configHiddenLabelGroup = new htmlGroup();
$configHiddenLabelGroup->addElement(new htmlOutputText(_('Hidden options') . ' '));
$configHiddenLabelGroup->addElement(new htmlHelpLink('hiddenOptions'));
$configContainer->addElement($configHiddenLabelGroup, true);
$hiddenContainer = new htmlTable();
$hiddenContainer->colspan = 5;
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideHomeDrive', false, _('Home drive'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideHomePath', false, _('Home path'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideProfilePath', false, _('Profile path'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideLogonScript', false, _('Logon script'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideSambaPwdLastSet', false, _('Last password change'), null, false));
$hiddenContainer->addNewLine();
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideWorkstations', false, _('Samba workstations'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideLogonHours', false, _('Logon hours'), null, false));
$hiddenContainer->addElement(new htmlOutputText(' '));
$hiddenContainer->addElement(new htmlTableExtendedInputCheckbox('sambaSamAccount_hideTerminalServer', false, _('Terminal server options'), null, false));
$configContainer->addElement($hiddenContainer);
$configContainer->add($configHiddenLabelGroup, 12);
$configContainer->addVerticalSpacer('0.5rem');
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideHomeDrive', false, _('Home drive'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideHomePath', false, _('Home path'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideProfilePath', false, _('Profile path'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideLogonScript', false, _('Logon script'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideSambaPwdLastSet', false, _('Last password change'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideWorkstations', false, _('Samba workstations'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideLogonHours', false, _('Logon hours'), null, true), 12, 4);
$configContainer->add(new htmlResponsiveInputCheckbox('sambaSamAccount_hideTerminalServer', false, _('Terminal server options'), null, true), 12, 4);
$configContainer->add(new htmlOutputText(''), 12, 4);
$return[] = $configContainer;
return $return;
}