6f270166d1c473036966ff0e27f0405b1f7f93c4 hiram Mon Jun 25 10:31:48 2012 -0700 enforce read-only wikiTrack diff --git src/hg/hgGene/wikiTrack.c src/hg/hgGene/wikiTrack.c index df7f417..f746d1a 100644 --- src/hg/hgGene/wikiTrack.c +++ src/hg/hgGene/wikiTrack.c @@ -4,30 +4,32 @@ #include "hash.h" #include "linefile.h" #include "dystring.h" #include "spDb.h" #include "web.h" #include "hgConfig.h" #include "hgGene.h" #include "htmlPage.h" #include "hgColors.h" #include "hdb.h" #include "binRange.h" #include "wikiLink.h" #include "wikiTrack.h" +/* enforce read-only 2012-06-22 */ +#ifdef NOT static char *hgGeneUrl() { static char retBuf[1024]; safef(retBuf, ArraySize(retBuf), "cgi-bin/hgGene?%s=1&%s", hggDoWikiTrack, cartSidUrlString(cart)); return retBuf; } static char *wikiTrackUserLoginUrl() /* Return the URL for the wiki user login page. */ { char *retEnc = encodedReturnUrl(hgGeneUrl); char buf[2048]; safef(buf, sizeof(buf), @@ -38,30 +40,31 @@ } static void offerLogin() /* display login prompts to the wiki when user isn't already logged in */ { char *wikiHost = wikiLinkHost(); char *loginUrl = wikiTrackUserLoginUrl(); printf("<P>Please login to add annotations to this UCSC gene.</P>\n"); printf("<P>The login page is handled by our " "<A HREF=\"http://%s/\" TARGET=_BLANK>wiki system</A>:\n", wikiHost); printf("<A HREF=\"%s\"><B>click here to login.</B></A><BR>\n", loginUrl); printf("The wiki also serves as a forum for users " "to share knowledge and ideas.\n</P>\n"); freeMem(loginUrl); } +#endif static struct bed *bedItem(char *chr, int start, int end, char *name, int plusCount, int negativeCount) { struct bed *bb; AllocVar(bb); bb->chrom = chr; /* do not need to clone chr string, it is already a clone */ bb->chromStart = start; bb->chromEnd = end; bb->name = cloneString(name); if ((0 == negativeCount) && (plusCount > 0)) safecpy(bb->strand, sizeof(bb->strand), "+"); else if ((0 == plusCount) && (negativeCount > 0)) safecpy(bb->strand, sizeof(bb->strand), "-"); else @@ -414,31 +417,34 @@ /* safety check, both of these lists should be non-zero */ int locusLocationCount = slCount(clusterList); int rawListCount = slCount(allIsoforms); if ((0 == rawListCount) || (0 == locusLocationCount)) { hPrintf("<EM>(Feature under development, not available for " "all genome browsers yet)</EM><BR>\n"); hPrintf("hgGene.doWikiTrack: can not find any genes " "of gene symbol %s<BR>\n",curGeneName); cartWebEnd(); return; } if (isEmpty(userName)) - offerLogin(); + { + ; /* enforce read-only 2012-06-22 */ + /* offerLogin(); */ + } else if (emailVerified(TRUE)) /* prints message when not verified */ { hPrintf("<FORM ID=\"hgg_wikiAddComment\" NAME=\"hgg_wikiAddComment\" " "METHOD=\"POST\" ACTION=\"../cgi-bin/hgGene\">\n\n"); cartSaveSession(cart); cgiMakeHiddenVar(hggDoWikiTrack, "1"); cgiMakeHiddenVar(hggDoWikiAddComment, "1"); cgiMakeHiddenVar("db", database); cgiMakeHiddenVar("hgg_gene", curGeneId); webPrintLinkTableStart(); /* first row is a title line */ char label[256]; safef(label, ArraySize(label), "'%s' adding comments to gene %s\n", userName, curGeneName); webPrintWideLabelCell(label, 2);