a2e61e016375032eb6250cf4d931979100808b80 galt Tue Aug 5 12:45:32 2014 -0700 Adding more flexibility so that if genomeSpace is not configured in hg.conf (or set to blank values), then it will be ignored, and GS will not appear in hgTables pages: mainPage, usage, etc. diff --git src/hg/hgTables/genomeSpace.c src/hg/hgTables/genomeSpace.c index 856adf0..ea3f202 100644 --- src/hg/hgTables/genomeSpace.c +++ src/hg/hgTables/genomeSpace.c @@ -116,30 +116,40 @@ dyStringFree(&dy); return gsResponse; } static char *getGenomeSpaceConfig(char *variable) /* Read genomeSpace config setting or abort if not found */ { char *value = cfgOption2("genomeSpace", variable); if (!value) errAbort("missing genomeSpace setting genomeSpace.%s in hg.conf", variable); return value; } +boolean isGenomeSpaceEnabled() +/* genomeSpace is enabled by the presence of GS config settings. */ +{ +char *iSU = getGenomeSpaceConfig("identityServerUrl"); +char *dmSvr = getGenomeSpaceConfig("dmServer"); +if (isNotEmpty(iSU) && isNotEmpty(dmSvr)) + return TRUE; +return FALSE; +} + char *insertUserPasswordIntoUrl(char *url, char *user, char *password) /* Insert cgi-encoded user and password into url after protocol. Free returned string when done. */ { char resultUrl[1024]; char *encUser = cgiEncode(user); char *encPassword = cgiEncode(password); char *rest = stringIn("://", url); if (!rest) errAbort("expected url [%s] to have ://", url); char *protocol = cloneStringZ(url, rest - url); rest += strlen("://"); safef(resultUrl, sizeof resultUrl, "%s://%s:%s@%s", protocol, encUser, encPassword, rest); freeMem(protocol); freeMem(encUser);