[Bug #1075] disables the autocomplete login form property if the admin password is not on default.
FEA: ItEr74S04BugFixing
This commit is contained in:
parent
4f91435a73
commit
dea3ec3193
7 changed files with 37 additions and 4 deletions
|
|
@ -67,4 +67,12 @@ public class ConfigurationDAO extends GenericDAOHibernate<Configuration, Long>
|
|||
query.setParameter("change", change);
|
||||
query.executeUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void disabledAutocompleteLogin() {
|
||||
String sql = "UPDATE Configuration e SET e.enabled_autocomplete_login = false";
|
||||
Query query = getSession().createQuery(sql);
|
||||
query.executeUpdate();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,4 +46,10 @@ public interface IConfigurationDAO extends IGenericDAO<Configuration, Long> {
|
|||
*/
|
||||
void saveChangedDefaultPassword(String user, boolean change);
|
||||
|
||||
/**
|
||||
* It disables the value in the field enabled_autocomplete_login of the
|
||||
* Configuration
|
||||
*/
|
||||
void disabledAutocompleteLogin();
|
||||
|
||||
}
|
||||
|
|
@ -47,6 +47,7 @@ import org.zkoss.zk.ui.event.SelectEvent;
|
|||
import org.zkoss.zk.ui.util.GenericForwardComposer;
|
||||
import org.zkoss.zul.ArrayGroupsModel;
|
||||
import org.zkoss.zul.Button;
|
||||
import org.zkoss.zul.Checkbox;
|
||||
import org.zkoss.zul.Combobox;
|
||||
import org.zkoss.zul.Constraint;
|
||||
import org.zkoss.zul.Grid;
|
||||
|
|
@ -62,7 +63,6 @@ import org.zkoss.zul.Row;
|
|||
import org.zkoss.zul.RowRenderer;
|
||||
import org.zkoss.zul.Rows;
|
||||
import org.zkoss.zul.Textbox;
|
||||
import org.zkoss.zul.api.Checkbox;
|
||||
import org.zkoss.zul.api.Window;
|
||||
|
||||
|
||||
|
|
@ -757,4 +757,8 @@ public class ConfigurationController extends GenericForwardComposer {
|
|||
public boolean moreScenariosThanMasterCreated() {
|
||||
return configurationModel.moreScenariosThanMasterCreated();
|
||||
}
|
||||
|
||||
public boolean isChangedDefaultPasswdAdmin() {
|
||||
return configurationModel.isChangedDefaultPasswdAdmin();
|
||||
}
|
||||
}
|
||||
|
|
@ -271,7 +271,8 @@ public class ConfigurationModel implements IConfigurationModel {
|
|||
if (configuration == null) {
|
||||
return null;
|
||||
}
|
||||
return configuration.isAutocompleteLogin();
|
||||
return (configuration.isAutocompleteLogin() && (!configuration
|
||||
.getChangedDefaultAdminPassword()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -281,6 +282,12 @@ public class ConfigurationModel implements IConfigurationModel {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isChangedDefaultPasswdAdmin() {
|
||||
return configuration != null ? configuration
|
||||
.getChangedDefaultAdminPassword() : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean getGenerateCodeForWorkReportType() {
|
||||
if (configuration == null) {
|
||||
|
|
|
|||
|
|
@ -146,5 +146,7 @@ public interface IConfigurationModel {
|
|||
|
||||
Boolean isAutocompleteLogin();
|
||||
|
||||
Boolean isChangedDefaultPasswdAdmin();
|
||||
|
||||
void setAutocompleteLogin(Boolean autocompleteLogin);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
package org.navalplanner.web.common;
|
||||
|
||||
import org.navalplanner.business.common.daos.IConfigurationDAO;
|
||||
import org.navalplanner.business.common.entities.Configuration;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
|
@ -52,8 +53,11 @@ public class LoginController extends GenericForwardComposer {
|
|||
* It returns the login value in function of the property autocompleteLogin.
|
||||
*/
|
||||
public String getLoginValue() {
|
||||
return configurationDAO.getConfigurationWithReadOnlyTransaction()
|
||||
.isAutocompleteLogin() ? this.autocompletLoginValue : null;
|
||||
Configuration configuration = configurationDAO
|
||||
.getConfigurationWithReadOnlyTransaction();
|
||||
return ((configuration.isAutocompleteLogin()) && (!configuration
|
||||
.getChangedDefaultAdminPassword())) ? this.autocompletLoginValue
|
||||
: null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -183,6 +183,8 @@
|
|||
checked="@{configurationController.monteCarloMethodTabVisible}" />
|
||||
<checkbox id="enableAutocompleteLogin"
|
||||
label="${i18n:_('enable autocomplete login')}"
|
||||
disabled="@{configurationController.isChangedDefaultPasswdAdmin}"
|
||||
tooltiptext = "${i18n:_('disable/enable autocomplete property in form login, if the admin password is still in default.')}"
|
||||
checked="@{configurationController.autocompleteLogin}"
|
||||
onCheck="configurationController.reloadGeneralConfiguration();" />
|
||||
</row>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue