From: Art Cancro Date: Tue, 11 Jan 2011 04:41:27 +0000 (-0500) Subject: Require logged-in in order to revert a wiki page X-Git-Tag: v8.11~976 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=d5dc38b6b434613c6bb6eacf67b182bcf5126ca7 Require logged-in in order to revert a wiki page --- diff --git a/citadel/modules/wiki/serv_wiki.c b/citadel/modules/wiki/serv_wiki.c index f3b6ce102..81825c689 100644 --- a/citadel/modules/wiki/serv_wiki.c +++ b/citadel/modules/wiki/serv_wiki.c @@ -484,6 +484,14 @@ void wiki_rev(char *pagename, char *rev, char *operation) return; } + if (!strcasecmp(operation, "revert")) { + r = CtdlDoIHavePermissionToPostInThisRoom(temp, sizeof temp, NULL, POST_LOGGED_IN, 0); + if (r != 0) { + cprintf("%d %s\n", r, temp); + return; + } + } + /* Begin by fetching the current version of the page. We're going to patch * backwards through the diffs until we get the one we want. */ diff --git a/webcit/wiki.c b/webcit/wiki.c index c5bb3086c..152954e22 100644 --- a/webcit/wiki.c +++ b/webcit/wiki.c @@ -201,7 +201,7 @@ void tmplput_display_wiki_history(StrBuf *Target, WCTemplputParams *TP) ChrPtr(rev_uuid), _("(show)") ); - wc_printf("%s", + wc_printf("%s", bstr("page"), ChrPtr(rev_uuid), _("(revert)")