Skip to content
Snippets Groups Projects
Commit 8dda1b31 authored by Mike McKay's avatar Mike McKay
Browse files

XNAT-4520 Converted old 0/1 boolean properties to t/f when bringing them in to...

XNAT-4520 Converted old 0/1 boolean properties to t/f when bringing them in to make the requireLogin property work correctly after 1.6 to 1.7 upgrade.
parent 53f38d9a
No related branches found
No related tags found
No related merge requests found
......@@ -118,9 +118,9 @@ public class XnatAppInfo {
_foundPreferences.put("adminEmail", rs.getString("site_admin_email"));
_foundPreferences.put("siteUrl", rs.getString("site_url"));
_foundPreferences.put("smtp_host", rs.getString("smtp_host"));
_foundPreferences.put("requireLogin", rs.getString("require_login"));
_foundPreferences.put("userRegistration", rs.getString("enable_new_registrations"));
_foundPreferences.put("enableCsrfToken", rs.getString("enable_csrf_token"));
_foundPreferences.put("requireLogin", translateIntToBoolean(rs.getString("require_login")));
_foundPreferences.put("userRegistration", translateIntToBoolean(rs.getString("enable_new_registrations")));
_foundPreferences.put("enableCsrfToken", translateIntToBoolean(rs.getString("enable_csrf_token")));
_foundPreferences.put("archivePath", rs.getString("archivepath"));
_foundPreferences.put("prearchivePath", rs.getString("prearchivepath"));
_foundPreferences.put("cachePath", rs.getString("cachepath"));
......@@ -138,6 +138,17 @@ public class XnatAppInfo {
}
}
private String translateIntToBoolean(String oldProperty){
String translation = oldProperty;
if(oldProperty.equals("0")){
translation="false";
}
else if(oldProperty.equals("1")){
translation="true";
}
return translation;
}
public Map<String, String> getFoundPreferences() {
if (_foundPreferences.size() == 0) {
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment