fix bugs
This commit is contained in:
parent
bba89c952e
commit
f53243e001
5 changed files with 16 additions and 15 deletions
|
@ -13,7 +13,7 @@
|
||||||
</Match>
|
</Match>
|
||||||
<Match>
|
<Match>
|
||||||
<Class name="ch.ethz.seb.sebserver.gbl.api.ExamAPIDiscovery" />
|
<Class name="ch.ethz.seb.sebserver.gbl.api.ExamAPIDiscovery" />
|
||||||
<Bug pattern="UrF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
|
<Bug pattern="UrF" />
|
||||||
</Match>
|
</Match>
|
||||||
<Match>
|
<Match>
|
||||||
<Class name="ch.ethz.seb.sebserver.gui.widget.*" />
|
<Class name="ch.ethz.seb.sebserver.gui.widget.*" />
|
||||||
|
|
|
@ -79,11 +79,11 @@ public final class UserMod implements UserAccount {
|
||||||
public final Set<String> roles;
|
public final Set<String> roles;
|
||||||
|
|
||||||
@NotNull(message = "user:newPassword:notNull")
|
@NotNull(message = "user:newPassword:notNull")
|
||||||
@Size(min = 8, max = 255, message = "user:password:size:{min}:{max}:${validatedValue}")
|
@Size(min = 8, max = 255, message = "user:newPassword:size:{min}:{max}:${validatedValue}")
|
||||||
@JsonProperty(PasswordChange.ATTR_NAME_NEW_PASSWORD)
|
@JsonProperty(PasswordChange.ATTR_NAME_NEW_PASSWORD)
|
||||||
private final String newPassword;
|
private final String newPassword;
|
||||||
|
|
||||||
@NotNull(message = "user:retypedNewPassword:notNull")
|
@NotNull(message = "user:confirmNewPassword:notNull")
|
||||||
@JsonProperty(PasswordChange.ATTR_NAME_CONFIRM_NEW_PASSWORD)
|
@JsonProperty(PasswordChange.ATTR_NAME_CONFIRM_NEW_PASSWORD)
|
||||||
private final String confirmNewPassword;
|
private final String confirmNewPassword;
|
||||||
|
|
||||||
|
|
|
@ -81,12 +81,12 @@ public class PassworFieldBuilder implements InputFieldBuilder {
|
||||||
InputFieldBuilder.createErrorLabel(innerGrid));
|
InputFieldBuilder.createErrorLabel(innerGrid));
|
||||||
|
|
||||||
final Listener valueChangeEventListener = event -> {
|
final Listener valueChangeEventListener = event -> {
|
||||||
|
passwordInputField.clearError();
|
||||||
|
|
||||||
final String pwd = passwordInput.getText();
|
final String pwd = passwordInput.getText();
|
||||||
final String confirm = confirmInput.getText();
|
final String confirm = confirmInput.getText();
|
||||||
|
|
||||||
if (passwordInputField.initValue != null && passwordInputField.initValue.equals(pwd)) {
|
if (passwordInputField.initValue != null && passwordInputField.initValue.equals(pwd)) {
|
||||||
System.out.println("*********************************** ignore Password set");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,6 @@ public class PassworFieldBuilder implements InputFieldBuilder {
|
||||||
|
|
||||||
final String hashedPWD = passwordInputField.getValue();
|
final String hashedPWD = passwordInputField.getValue();
|
||||||
if (hashedPWD != null) {
|
if (hashedPWD != null) {
|
||||||
passwordInputField.clearError();
|
|
||||||
viewContext.getValueChangeListener().valueChanged(
|
viewContext.getValueChangeListener().valueChanged(
|
||||||
viewContext,
|
viewContext,
|
||||||
attribute,
|
attribute,
|
||||||
|
|
|
@ -83,6 +83,8 @@ public class AuthorizationServiceImpl implements AuthorizationService {
|
||||||
.withBasePrivilege(PrivilegeType.WRITE)
|
.withBasePrivilege(PrivilegeType.WRITE)
|
||||||
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
|
.andForRole(UserRole.INSTITUTIONAL_ADMIN)
|
||||||
.withInstitutionalPrivilege(PrivilegeType.WRITE)
|
.withInstitutionalPrivilege(PrivilegeType.WRITE)
|
||||||
|
.andForRole(UserRole.EXAM_ADMIN)
|
||||||
|
.withInstitutionalPrivilege(PrivilegeType.WRITE)
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
// grants for lms setup
|
// grants for lms setup
|
||||||
|
|
|
@ -294,6 +294,15 @@ public class ConfigurationDAOImpl implements ConfigurationDAO {
|
||||||
// get follow-up configuration id
|
// get follow-up configuration id
|
||||||
final ConfigurationRecord followup = getFollowupConfigurationRecord(configurationNodeId);
|
final ConfigurationRecord followup = getFollowupConfigurationRecord(configurationNodeId);
|
||||||
|
|
||||||
|
// delete all values of the follow-up
|
||||||
|
this.configurationValueRecordMapper
|
||||||
|
.deleteByExample()
|
||||||
|
.where(
|
||||||
|
ConfigurationValueRecordDynamicSqlSupport.configurationId,
|
||||||
|
isEqualTo(followup.getId()))
|
||||||
|
.build()
|
||||||
|
.execute();
|
||||||
|
|
||||||
// restore all current values of the follow-up with historic values
|
// restore all current values of the follow-up with historic values
|
||||||
// TODO batch here for better performance
|
// TODO batch here for better performance
|
||||||
historicValues.stream()
|
historicValues.stream()
|
||||||
|
@ -304,16 +313,7 @@ public class ConfigurationDAOImpl implements ConfigurationDAO {
|
||||||
historicValRec.getConfigurationAttributeId(),
|
historicValRec.getConfigurationAttributeId(),
|
||||||
historicValRec.getListIndex(),
|
historicValRec.getListIndex(),
|
||||||
historicValRec.getValue()))
|
historicValRec.getValue()))
|
||||||
.forEach(newValRec -> this.configurationValueRecordMapper
|
.forEach(newValRec -> this.configurationValueRecordMapper.insert(newValRec));
|
||||||
.updateByExample(newValRec)
|
|
||||||
.where(
|
|
||||||
ConfigurationValueRecordDynamicSqlSupport.configurationId,
|
|
||||||
isEqualTo(followup.getId()))
|
|
||||||
.and(
|
|
||||||
ConfigurationValueRecordDynamicSqlSupport.configurationAttributeId,
|
|
||||||
isEqualTo(newValRec.getConfigurationAttributeId()))
|
|
||||||
.build()
|
|
||||||
.execute());
|
|
||||||
|
|
||||||
return followup;
|
return followup;
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue