}
final List<FormComponent< ? >> dependentLdapPosixFormComponentsList = new LinkedList<FormComponent< ? >>();
final List<FormComponent< ? >> dependentLdapSambaFormComponentsList = new LinkedList<FormComponent< ? >>();
if (posixConfigured == true) {
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.uidNumber"), getString("ldap.posixAccount"));
uidNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues, "uidNumber"), 1,
65535);
WicketUtils.setSize(uidNumberField, 6);
fs.add(uidNumberField);
fs.addHelpIcon(gridBuilder.getString("ldap.uidNumber.tooltip"));
dependentLdapPosixFormComponentsList.add(uidNumberField);
if (ldapUserValues.isPosixValuesEmpty() == true) {
final Button createButton = newCreateButton(dependentLdapPosixFormComponentsList, dependentLdapSambaFormComponentsList, true,
sambaConfigured);
fs.add(new SingleButtonPanel(fs.newChildId(), createButton, gridBuilder.getString("create"), SingleButtonPanel.NORMAL));
WicketUtils.addTooltip(createButton, gridBuilder.getString("ldap.uidNumber.createDefault.tooltip"));
}
}
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.gidNumber"), getString("ldap.posixAccount"));
gidNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues, "gidNumber"), 1,
65535);
WicketUtils.setSize(gidNumberField, 6);
fs.add(gidNumberField);
dependentLdapPosixFormComponentsList.add(gidNumberField);
}
}
final LdapSambaAccountsConfig ldapSambaAccountsConfig = ConfigXml.getInstance().getLdapConfig().getSambaAccountsConfig();
if (sambaConfigured == true) {
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaSID"));
final DivTextPanel textPanel = new DivTextPanel(fs.newChildId(), ldapSambaAccountsConfig.getSambaSIDPrefix() + "-");
fs.add(textPanel);
sambaSIDNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues,
"sambaSIDNumber"), 1, 65535);
fs.add(sambaSIDNumberField);
sambaSIDNumberField.setOutputMarkupId(true);
WicketUtils.setSize(sambaSIDNumberField, 5);
fs.addHelpIcon(getString("ldap.sambaSID.tooltip"));
dependentLdapSambaFormComponentsList.add(sambaSIDNumberField);
if (ldapUserValues.getSambaSIDNumber() == null) {
final Button createButton = newCreateButton(dependentLdapPosixFormComponentsList, dependentLdapSambaFormComponentsList, false,
true);
fs.add(new SingleButtonPanel(fs.newChildId(), createButton, gridBuilder.getString("create"), SingleButtonPanel.NORMAL));
WicketUtils.addTooltip(createButton, gridBuilder.getString("ldap.sambaSID.createDefault.tooltip"));
}
}
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaPrimaryGroupSID"), getString("ldap.sambaAccount"));
final DivTextPanel textPanel = new DivTextPanel(fs.newChildId(), ldapSambaAccountsConfig.getSambaSIDPrefix() + "-");
fs.add(textPanel);
sambaPrimaryGroupSIDNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues,
"sambaPrimaryGroupSIDNumber"), 1, 65535);
fs.add(sambaPrimaryGroupSIDNumberField);
sambaPrimaryGroupSIDNumberField.setOutputMarkupId(true);
WicketUtils.setSize(sambaPrimaryGroupSIDNumberField, 5);
fs.addHelpIcon(getString("ldap.sambaPrimaryGroupSID.tooltip"));
dependentLdapSambaFormComponentsList.add(sambaPrimaryGroupSIDNumberField);
}
}
gridBuilder.newSplitPanel(GridSize.COL50);
gridBuilder.newFieldset(getString("user.restrictedUser")).addCheckBox(new PropertyModel<Boolean>(data, "restrictedUser"), null)
.setTooltip(getString("user.restrictedUser.tooltip"));
if (posixConfigured == true) {
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.homeDirectory"), getString("ldap.posixAccount"));
homeDirectoryField = new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(ldapUserValues, "homeDirectory"), 255);
fs.add(homeDirectoryField);
dependentLdapPosixFormComponentsList.add(homeDirectoryField);
}
{
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.loginShell"), getString("ldap.posixAccount"));
loginShellField = new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(ldapUserValues, "loginShell"), 100);
fs.add(loginShellField);
dependentLdapPosixFormComponentsList.add(loginShellField);
}
if (ldapUserValues.isPosixValuesEmpty() == true) {
for (final FormComponent< ? > component : dependentLdapPosixFormComponentsList) {
component.setEnabled(false);
}
}
}
if (sambaConfigured == true) {
final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaNTPassword"), getString("ldap.sambaNTPassword.subtitle"))
.suppressLabelForWarning();
final DivTextPanel sambaNTPassword = new DivTextPanel(fs.newChildId(), "*****");
fs.add(sambaNTPassword);
fs.addHelpIcon(getString("ldap.sambaNTPassword.tooltip"));
if (ldapUserValues.isSambaValuesEmpty() == true) {
for (final FormComponent< ? > component : dependentLdapSambaFormComponentsList) {
component.setEnabled(false);
}
}