Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.8.0' into fix/#2116_XS…
Browse files Browse the repository at this point in the history
…S_Vulnerabilities_in_2_8
  • Loading branch information
Limraj committed Nov 14, 2024
2 parents 6a0ead1 + efb2377 commit a016fbd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 3 additions & 4 deletions WebContent/WEB-INF/jsp/systemSettings.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,13 @@
function(response) {
stopImageFader("saveMiscSettingsImg");
if (response.hasMessages)
setUserMessage("miscMessage", response.messages[0].contextualMessage);
showDwrMessages(response.messages);
else {
setUserMessage("miscMessage", "<spring:message code="systemSettings.miscSaved"/>");
}
});
setUserMessage("miscMessage");
hideContextualMessages("settingsMisc");
startImageFader("saveMiscSettingsImg");
}
Expand Down Expand Up @@ -928,7 +929,7 @@
</td>
</tr>
</table>
<table>
<table id="settingsMisc">
<tr>
<td class="formLabelRequired"><spring:message code="systemSettings.uiPerformance"/></td>
<td class="formField">
Expand Down Expand Up @@ -1005,14 +1006,12 @@
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.WEB_RESOURCE_GRAPHICS_PATH %>"/>" type="text" class="formShort" style="width: 300px;"/>
</td>
<td colspan="2" id="uploadsPathMessage" class="formError"></td>
</tr>
<tr>
<td class="formLabelRequired"><spring:message code="systemsettings.webresource.uploads.path"/></td>
<td class="formField">
<input id="<c:out value="<%= SystemSettingsDAO.WEB_RESOURCE_UPLOADS_PATH %>"/>" type="text" class="formShort" style="width: 300px;"/>
</td>
<td colspan="2" id="graphicsPathMessage" class="formError"></td>
</tr>
<tr>
<td class="formLabelRequired"><spring:message code="event.assign.enabled"/></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ public void migrate(Context context) throws Exception {
}

private void migrate(JdbcTemplate jdbcTmp) {
String sql = "ALTER TABLE events ADD COLUMN typeRef3 int not null";
try {
jdbcTmp.update(sql);
} catch (Exception ex) {
if(ex.getMessage() != null && !ex.getMessage().contains("Duplicate"))
throw ex;
LOG.warn(ex.getMessage(), ex);
}

boolean existsTypeRef3Column = jdbcTmp.queryForObject("SELECT (SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`= DATABASE() AND `TABLE_NAME`='events' AND `COLUMN_NAME`='typeRef3') IS NOT NULL;", boolean.class);

if(!existsTypeRef3Column)
jdbcTmp.update( "ALTER TABLE events ADD COLUMN typeRef3 int not null");
}
}

2 changes: 1 addition & 1 deletion src/org/scada_lts/mango/service/SystemSettingsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ public int getDataPointExtendedNameLengthInReportsLimit() {
}
}
public void saveDataPointExtendedNameLengthInReportsLimitMisc(int dataPointExtendedNameLengthInReportsLimit, DwrResponseI18n response) {
if(dataPointExtendedNameLengthInReportsLimit < 0) {
if(dataPointExtendedNameLengthInReportsLimit < 4) {
response.addContextualMessage(SystemSettingsDAO.DATA_POINT_EXTENDED_NAME_LENGTH_IN_REPORTS_LIMIT, "validate.invalidValue");
} else {
saveDataPointExtendedNameLengthInReportsLimitMisc(dataPointExtendedNameLengthInReportsLimit);
Expand Down

0 comments on commit a016fbd

Please sign in to comment.