From e45fe5cf63e20020a8285f12a1080ace7aa20a81 Mon Sep 17 00:00:00 2001 From: Javier Moran Rua Date: Sun, 19 Aug 2012 01:52:37 +0200 Subject: [PATCH] Bug #1527: Several interface disabling configurations modified. * Programmed right condition to disable managing roles and profiles of a LDAP user: LDAP enabled and import use of LDAP roles enabled. * Improved informative messages when the profiles and roles cannot be managed in a user. * Corrected erroneos condition to disable the Delete icon beloning to an assigned role. * Coherent placement of the informative warning informing that password cannot be managed. --- .../org/libreplan/web/users/UserCRUDController.java | 7 +++++-- libreplan-webapp/src/main/webapp/users/_editUser.zul | 10 +++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java b/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java index 5db1b241f..3c442a0e6 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/users/UserCRUDController.java @@ -65,6 +65,7 @@ import org.zkoss.zul.api.Groupbox; * * @author Jacobo Aragunde Perez * @author Manuel Rego Casasnovas + * @author Javier Moran Rua */ @SuppressWarnings("serial") public class UserCRUDController extends BaseCRUDController implements @@ -184,6 +185,7 @@ public class UserCRUDController extends BaseCRUDController implements return userModel.getUsers(); } + @Override protected void save() throws ValidationException { userModel.confirmSave(); PasswordUtil.showOrHideDefaultPasswordWarnings(); @@ -352,7 +354,7 @@ public class UserCRUDController extends BaseCRUDController implements removeRole(role); } }); - removeButton.setDisabled(getLdapUserRolesLdapConfiguration() + removeButton.setDisabled(areRolesAndProfilesDisabled() || role.equals(UserRole.ROLE_BOUND_USER) || isUserDefaultAdmin()); row.appendChild(removeButton); @@ -452,7 +454,8 @@ public class UserCRUDController extends BaseCRUDController implements } public boolean areRolesAndProfilesDisabled() { - return isLdapUserLdapConfiguration() || isUserDefaultAdmin(); + return (isLdapUser() && userModel.isLDAPBeingUsed() && userModel + .isLDAPRolesBeingUsed()) || isUserDefaultAdmin(); } public boolean isLdapUserOrDefaultAdmin() { diff --git a/libreplan-webapp/src/main/webapp/users/_editUser.zul b/libreplan-webapp/src/main/webapp/users/_editUser.zul index 2f12f278d..849a61148 100644 --- a/libreplan-webapp/src/main/webapp/users/_editUser.zul +++ b/libreplan-webapp/src/main/webapp/users/_editUser.zul @@ -32,11 +32,11 @@ - - + + @@ -125,7 +125,7 @@ - @@ -146,7 +146,7 @@ -