public Collection<Message> doUpgrade() throws Exception { final SecurityType sec = AppConfig.getsConfig().getConfig().getSecurity(); // Let's just be anal if (sec.isSetCrowd()) { final CrowdAuthConfigType crowdAuth = sec.getCrowd(); final Properties props = PropertiesUtil.loadFromString(crowdAuth.getCrowdProperties()); final String crowdUrl = props.getProperty(PROPERTIES_FILE_SECURITY_SERVER_URL); if (crowdUrl.startsWith("https")) { props.setProperty(PROPERTIES_FILE_SECURITY_SERVER_URL, crowdUrl.replaceFirst("https", "http")); crowdAuth.setCrowdProperties(PropertiesUtil.saveToString(props)); sec.setCrowd(crowdAuth); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().getUserManager().reload(AppConfig.getsConfig().getConfig()); } } return null; }
public Collection<Message> doUpgrade() throws Exception { final SecurityType sec = AppConfig.getsConfig().getConfig().getSecurity(); // Let's just be anal if (sec.isSetCrowd()) { final CrowdAuthConfigType crowdAuth = sec.getCrowd(); final Properties props = PropertiesUtil.loadFromString(crowdAuth.getCrowdProperties()); final String crowdTokenKey = props.getProperty(PROPERTIES_FILE_CROWD_TOKEN_KEY); // If it's already something else, maybe we shouldn't change it? if (crowdTokenKey == null) { props.setProperty(PROPERTIES_FILE_CROWD_TOKEN_KEY, CROWD_TOKEN_KEY); crowdAuth.setCrowdProperties(PropertiesUtil.saveToString(props)); sec.setCrowd(crowdAuth); AppConfig.getsConfig().saveConfig(); AppConfig.getsConfig().getUserManager().reload(AppConfig.getsConfig().getConfig()); } } return null; }
if (this.cfg.getSecurity().isSetCrowd()) CrowdAuthConfigType crowdCfg = this.cfg.getSecurity().getCrowd(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_CROWD_USER_MANAGEMENT); if (this.cfg.getSecurity().isSetBuiltIn()) userMgmtProps.setValue(FISHEYE_BUILTIN_SIGNUP_ENABLED, String.valueOf(this.cfg.getSecurity().getBuiltIn().getSignup().getEnabled())); if (this.cfg.getSecurity().isSetLdap()) LdapConfigType ldapCfg = this.cfg.getSecurity().getLdap(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_LDAP_USER_MANAGEMENT); userMgmtProps.setValue(LDAP_URL, ldapCfg.getUrl()); if (this.cfg.getSecurity().isSetCustom() && this.cfg.getSecurity().getCustom() != null) CustomSecurityConfigType customCfg = this.cfg.getSecurity().getCustom(); userMgmtProps.setValue(USER_MGMT_TYPE, FISHEYE_CUSTOM_USER_MANAGEMENT); userMgmtProps.setValue(CUSTOM_SECURITY_CLASS, customCfg.getClassname()); if (this.cfg.getSecurity().isSetAjp() && this.cfg.getSecurity().getCustom() != null) CustomSecurityConfigType ajpCfg = this.cfg.getSecurity().getCustom(); userMgmtProps.setValue(AUTO_ADD_USERS, String.valueOf(ajpCfg.getAutoAdd())); userMgmtProps.setValue(CACHE_TTL, ajpCfg.getPositiveCacheTtl()); if (this.cfg.getSecurity().isSetHostAuth() && this.cfg.getSecurity().getHostAuth() != null)