Bug #1556: Allow to choose between database or LDAP in user creation

FEA: ItEr77S04BugFixing
This commit is contained in:
Manuel Rego Casasnovas 2012-11-16 12:16:14 +01:00
parent 6927955a4a
commit 637d03ff5c
2 changed files with 6 additions and 17 deletions

View file

@ -284,16 +284,7 @@ public class UserCRUDController extends BaseCRUDController<User> implements
//because they are not directly associated to an attribute
passwordBox.setRawValue("");
passwordConfirmationBox.setRawValue("");
hideAuthenticationTypesCombo();
}
private void hideAuthenticationTypesCombo() {
Row comboRow = (Row) editWindow
.getFellowIfAny("authenticationTypeComboRow");
Row labelRow = (Row) editWindow
.getFellowIfAny("authenticationTypeLabelRow");
comboRow.setVisible(false);
labelRow.setVisible(true);
prepareAuthenticationTypesCombo();
}
@Override
@ -323,10 +314,7 @@ public class UserCRUDController extends BaseCRUDController<User> implements
Row comboRow = (Row) editWindow
.getFellowIfAny("authenticationTypeComboRow");
Row labelRow = (Row) editWindow
.getFellowIfAny("authenticationTypeLabelRow");
comboRow.setVisible(true);
labelRow.setVisible(false);
}
@Override
@ -489,6 +477,11 @@ public class UserCRUDController extends BaseCRUDController<User> implements
}
public void setAuthenticationType(Comboitem item) {
if (item == null) {
throw new WrongValueException(
editWindow.getFellowIfAny("authenticationTypeCombo"),
_("cannot be empty"));
}
UserAuthenticationType authenticationType = (UserAuthenticationType) item
.getValue();
User user = getUser();

View file

@ -90,10 +90,6 @@
<combobox id="authenticationTypeCombo" autodrop="true"
onChange="controller.setAuthenticationType(self.selectedItem)" />
</row>
<row id="authenticationTypeLabelRow">
<label value="${i18n:_('Authentication type')}" />
<label value="@{controller.authenticationType}" />
</row>
</rows>
</grid>
</groupbox>