d3e16537874999b3f3788ecbb5a8ac9980eba585
chinhli
  Tue Jun 5 16:47:41 2012 -0700
Change based on code review feedback (8116) from Brian, plus restrict username length to 32 no longer than 32 characters
diff --git src/hg/lib/wikiLink.c src/hg/lib/wikiLink.c
index c99ea1f..2001d98 100644
--- src/hg/lib/wikiLink.c
+++ src/hg/lib/wikiLink.c
@@ -82,31 +82,30 @@
 }
 
 char *wikiLinkUserLoginUrl(int hgsid)
 /* Return the URL for the wiki user login page. */
 {
 char buf[2048];
 char *retEnc = encodedHgSessionReturnUrl(hgsid);
 if (loginSystemEnabled())
     {
     if (! wikiLinkEnabled())
         errAbort("wikiLinkUserLoginUrl called when login system is not enabled "
            "(specified in hg.conf).");
         safef(buf, sizeof(buf),
       "http://%s/cgi-bin/hgLogin?hgLogin.do.displayLoginPage=1&returnto=%s",
       wikiLinkHost(), retEnc);
-
     } 
 else 
     {
     if (! wikiLinkEnabled())
         errAbort("wikiLinkUserLoginUrl called when wiki is not enabled (specified "
 	     "in hg.conf).");
     safef(buf, sizeof(buf),
         "http://%s/index.php?title=Special:UserloginUCSC&returnto=%s",
         wikiLinkHost(), retEnc);
     }   
 freez(&retEnc);
 return(cloneString(buf));
 }
 
 char *wikiLinkUserLogoutUrl(int hgsid)
@@ -140,38 +139,56 @@
 char *wikiLinkUserSignupUrl(int hgsid)
 /* Return the URL for the user signup  page. */
 {
 char buf[2048];
 char *retEnc = encodedHgSessionReturnUrl(hgsid);
 
 if (loginSystemEnabled())
     {
     if (! wikiLinkEnabled())
         errAbort("wikiLinkUserSignupUrl called when login system is not enabled "
             "(specified in hg.conf).");
         safef(buf, sizeof(buf),
             "http://%s/cgi-bin/hgLogin?hgLogin.do.signupPage=1&returnto=%s",
             wikiLinkHost(), retEnc);
     }
+else
+    {
+    if (! wikiLinkEnabled())
+        errAbort("wikiLinkUserLogoutUrl called when wiki is not enable (specified "
+            "in hg.conf).");
+    safef(buf, sizeof(buf),
+        "http://%s/index.php?title=Special:UserlogoutUCSC&returnto=%s",
+         wikiLinkHost(), retEnc);
+    }
 freez(&retEnc);
 return(cloneString(buf));
 }
 
 char *wikiLinkChangePasswordUrl(int hgsid)
 /* Return the URL for the user change password page. */
 {
 char buf[2048];
 char *retEnc = encodedHgSessionReturnUrl(hgsid);
 
 if (loginSystemEnabled())
     {
     if (! wikiLinkEnabled())
         errAbort("wikiLinkChangePasswordUrl called when login system is not enabled "
             "(specified in hg.conf).");
         safef(buf, sizeof(buf),
             "http://%s/cgi-bin/hgLogin?hgLogin.do.changePasswordPage=1&returnto=%s",
             wikiLinkHost(), retEnc);
     }
+else
+    {
+    if (! wikiLinkEnabled())
+        errAbort("wikiLinkUserLogoutUrl called when wiki is not enable (specified "
+            "in hg.conf).");
+    safef(buf, sizeof(buf),
+        "http://%s/index.php?title=Special:UserlogoutUCSC&returnto=%s",
+         wikiLinkHost(), retEnc);
+    }
 freez(&retEnc);
 return(cloneString(buf));
 }