01: package vqwiki.servlets;
02:
03: import org.apache.log4j.Logger;
04: import vqwiki.WikiBase;
05: import vqwiki.utils.Utilities;
06:
07: import javax.servlet.ServletException;
08: import javax.servlet.http.HttpServletRequest;
09: import javax.servlet.http.HttpServletResponse;
10: import java.io.IOException;
11:
12: /**
13: * @author garethc
14: * Date: 5/03/2003
15: */
16: public class UnlockServlet extends VQWikiServlet {
17:
18: private static final Logger logger = Logger
19: .getLogger(UnlockServlet.class);
20:
21: /**
22: *
23: */
24: protected void doGet(HttpServletRequest request,
25: HttpServletResponse response) throws ServletException,
26: IOException {
27: String topic = request.getParameter("topic");
28: if (!Utilities.isAdmin(request)) {
29: request.setAttribute("redirect", "Wiki?WikiLockList");
30: dispatch("/jsp/login.jsp", request, response);
31: return;
32: }
33: String virtualWiki = (String) request
34: .getAttribute("virtualWiki");
35: logger.debug("Unlocking " + topic);
36: try {
37: WikiBase.getInstance().unlockTopic(virtualWiki, topic);
38: } catch (Exception e) {
39: error(request, response, e);
40: return;
41: }
42: redirect("Wiki?WikiLockList", response);
43: }
44: }
|