From d5dc38b6b434613c6bb6eacf67b182bcf5126ca7 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 10 Jan 2011 23:41:27 -0500 Subject: [PATCH] Require logged-in in order to revert a wiki page --- citadel/modules/wiki/serv_wiki.c | 8 ++++++++ webcit/wiki.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) 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)") -- 2.30.2