Commit 593ce0be authored by Tom Evans's avatar Tom Evans

OF-800: Fix handling for system properties page

Properly detect and modify encryption settings from the system
properties page. Remove encryption settings for deleted properties.
parent acc93e0d
......@@ -765,6 +765,7 @@ public class JiveGlobals {
properties = JiveProperties.getInstance();
}
properties.remove(name);
setPropertyEncrypted(name, false);
}
/**
......@@ -825,10 +826,10 @@ public class JiveGlobals {
loadSecurityProperties();
}
boolean propertyWasChanged;
if (isPropertyEncrypted(name)) {
propertyWasChanged = securityProperties.removeFromList(ENCRYPTED_PROPERTY_NAMES, name);
} else {
if (encrypt) {
propertyWasChanged = securityProperties.addToList(ENCRYPTED_PROPERTY_NAMES, name);
} else {
propertyWasChanged = securityProperties.removeFromList(ENCRYPTED_PROPERTY_NAMES, name);
}
if (propertyWasChanged) {
resetProperty(name);
......
......@@ -684,6 +684,7 @@ public class XMLProperties {
// .. then write to disk.
saveProperties();
JiveGlobals.setPropertyEncrypted(name, false);
// Generate event.
Map<String, Object> params = Collections.emptyMap();
PropertyEventDispatcher.dispatchEvent(name, PropertyEventDispatcher.EventType.xml_property_deleted, params);
......
......@@ -82,16 +82,6 @@
}
}
if (encrypt) {
if (propName != null) {
JiveGlobals.setPropertyEncrypted(propName, true);
// Log the event
webManager.logEvent("encrypted server property "+propName, null);
response.sendRedirect("server-properties.jsp?encryptsuccess=true");
return;
}
}
Map<String, String> errors = new HashMap<String, String>();
if (save) {
if (propName == null || "".equals(propName.trim()) || propName.startsWith("\"")) {
......@@ -113,16 +103,26 @@
}
}
if (encrypt) {
if (propName != null) {
JiveGlobals.setPropertyEncrypted(propName, true);
// Log the event
webManager.logEvent("encrypted server property "+propName, null);
response.sendRedirect("server-properties.jsp?encryptsuccess=true");
return;
}
}
if (edit) {
propValue = JiveGlobals.getProperty(propName);
}
List<String> properties = JiveGlobals.getPropertyNames();
Collections.sort(properties, new Comparator<String>() {
public int compare(String s1, String s2) {
return s1.toLowerCase().compareTo(s2.toLowerCase());
}
});
if (edit) {
propValue = JiveGlobals.getProperty(propName);
}
%>
<html>
......@@ -426,10 +426,5 @@ function dodelete(propName) {
</form>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
<br><br><br><br><br><br>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment