diff --git a/src/main/java/org/nrg/xnat/services/XnatAppInfo.java b/src/main/java/org/nrg/xnat/services/XnatAppInfo.java index 4d3b80bb09fb856cbd8dfeb3ae4c5ea87c5fd620..c08e6454094a7b78e6f2e1e316dd76e2b6f6eb47 100644 --- a/src/main/java/org/nrg/xnat/services/XnatAppInfo.java +++ b/src/main/java/org/nrg/xnat/services/XnatAppInfo.java @@ -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;