From c3b5232d16734d07e64b5a90ac98376dbc0a572c Mon Sep 17 00:00:00 2001 From: Manuel Rego Casasnovas Date: Wed, 20 Jun 2012 12:47:49 +0200 Subject: [PATCH] Remove default user with login user and password user FEA: ItEr76S30PermissionsEnhancements --- .../business/common/entities/Configuration.java | 11 ----------- .../src/main/resources/db.changelog-1.2.xml | 7 +++++++ .../business/common/entities/Configuration.hbm.xml | 2 -- .../libreplan/web/common/TemplateController.java | 12 ++++-------- .../org/libreplan/web/security/SecurityUtils.java | 6 +++--- .../java/org/libreplan/web/users/PasswordUtil.java | 8 -------- .../web/users/bootstrap/MandatoryUser.java | 7 ------- .../src/main/webapp/common/layout/template.zul | 6 +----- .../src/main/webapp/js/defaultPasswordWarnings.js | 14 +++++++------- 9 files changed, 22 insertions(+), 51 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/common/entities/Configuration.java b/libreplan-business/src/main/java/org/libreplan/business/common/entities/Configuration.java index d71b7c9f4..c46b7cc90 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/common/entities/Configuration.java +++ b/libreplan-business/src/main/java/org/libreplan/business/common/entities/Configuration.java @@ -73,8 +73,6 @@ public class Configuration extends BaseEntity { private Boolean changedDefaultAdminPassword = false; - private Boolean changedDefaultUserPassword = false; - private Boolean changedDefaultWsreaderPassword = false; private Boolean changedDefaultWswriterPassword = false; @@ -323,15 +321,6 @@ public class Configuration extends BaseEntity { : changedDefaultAdminPassword; } - public void setChangedDefaultUserPassword(Boolean changedDefaultUserPassword) { - this.changedDefaultUserPassword = changedDefaultUserPassword; - } - - public Boolean getChangedDefaultUserPassword() { - return changedDefaultUserPassword != null ? changedDefaultUserPassword - : false; - } - public void setChangedDefaultWsreaderPassword( Boolean changedDefaultWsreaderPassword) { this.changedDefaultWsreaderPassword = changedDefaultWsreaderPassword; diff --git a/libreplan-business/src/main/resources/db.changelog-1.2.xml b/libreplan-business/src/main/resources/db.changelog-1.2.xml index 1d0d703ea..2abb8a759 100644 --- a/libreplan-business/src/main/resources/db.changelog-1.2.xml +++ b/libreplan-business/src/main/resources/db.changelog-1.2.xml @@ -571,4 +571,11 @@ + + Drop column code in configuration table + + + diff --git a/libreplan-business/src/main/resources/org/libreplan/business/common/entities/Configuration.hbm.xml b/libreplan-business/src/main/resources/org/libreplan/business/common/entities/Configuration.hbm.xml index 47236ab44..4a97740ae 100644 --- a/libreplan-business/src/main/resources/org/libreplan/business/common/entities/Configuration.hbm.xml +++ b/libreplan-business/src/main/resources/org/libreplan/business/common/entities/Configuration.hbm.xml @@ -45,8 +45,6 @@ column="monte_carlo_method_tab_visible" /> - (), Configuration.isExampleUsersDisabled()) { - @Override - public boolean hasChangedDefaultPassword() { - return getConfiguration().getChangedDefaultUserPassword(); - } - }, ADMIN(Arrays.asList(UserRole.ROLE_SUPERUSER, UserRole.ROLE_READ_ALL_PROJECTS, UserRole.ROLE_EDIT_ALL_PROJECTS, diff --git a/libreplan-webapp/src/main/webapp/common/layout/template.zul b/libreplan-webapp/src/main/webapp/common/layout/template.zul index ce97ed667..848406ee4 100644 --- a/libreplan-webapp/src/main/webapp/common/layout/template.zul +++ b/libreplan-webapp/src/main/webapp/common/layout/template.zul @@ -36,7 +36,6 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?> contextPath = Executions.getCurrent().getContextPath(); templateCtrl = templateController; idAdminUser = templateController.getIdAdminUser(); - idUser = templateController.getIdUser(); idWsreader = templateController.getIdWsreaderUser(); idWswriter = templateController.getIdWswriterUser(); idWssubcontracting = templateController.getIdWssubcontractingUser(); @@ -102,7 +101,7 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?> - ${i18n:_('user')}: ${desktop.execution.userPrincipal.name} + ${i18n:_('user')}: ${templateController.username} [${i18n:_('Log out')}] @@ -143,9 +142,6 @@ signature="java.lang.Boolean isDefaultPasswordsControl()"?> class="footer-messages-area" style="display:${templateCtrl.defaultPasswdVisible}">
- [user] [wsreader] diff --git a/libreplan-webapp/src/main/webapp/js/defaultPasswordWarnings.js b/libreplan-webapp/src/main/webapp/js/defaultPasswordWarnings.js index 87e6f671d..8d4d1866a 100644 --- a/libreplan-webapp/src/main/webapp/js/defaultPasswordWarnings.js +++ b/libreplan-webapp/src/main/webapp/js/defaultPasswordWarnings.js @@ -1,7 +1,7 @@ /* * This file is part of LibrePlan * - * Copyright (C) 2011 Igalia, S.L. + * Copyright (C) 2011-2012 Igalia, S.L. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -17,22 +17,22 @@ * along with this program. If not, see . */ -function showOrHideDefaultPasswordWarnings(adminNotDefaultPassword, - userNotDefaultPassword, wsreaderNotDefaultPassword, - wswriterNotDefaultPassword, wssubcontractingNotDefaultPassword) { +function showOrHideDefaultPasswordWarnings( + adminNotDefaultPassword, + wsreaderNotDefaultPassword, + wswriterNotDefaultPassword, + wssubcontractingNotDefaultPassword) { setDisplayNoneOrInline(document.getElementById("warningDefaultPasswdadmin"), adminNotDefaultPassword); var otherDefaultPassword = adminNotDefaultPassword && - (!userNotDefaultPassword || !wsreaderNotDefaultPassword || + (!wsreaderNotDefaultPassword || !wswriterNotDefaultPassword || !wssubcontractingNotDefaultPassword); setDisplayNoneOrInline(document.getElementById("warningDefaultPasswdOthers"), !otherDefaultPassword); if (otherDefaultPassword) { - setDisplayNoneOrInline(document.getElementById("warningDefaultPasswduser"), - userNotDefaultPassword); setDisplayNoneOrInline(document.getElementById("warningDefaultPasswdwsreader"), wsreaderNotDefaultPassword); setDisplayNoneOrInline(document.getElementById("warningDefaultPasswdwswriter"),