]> WPIA git - gigi.git/blob - src/org/cacert/gigi/pages/admin/support/SupportUserHistory.java
add: devel-convenience TestEmailProvider can have a secondary mail
[gigi.git] / src / org / cacert / gigi / pages / admin / support / SupportUserHistory.java
1 package org.cacert.gigi.pages.admin.support;
2
3 import java.io.IOException;
4
5 import javax.servlet.http.HttpServletRequest;
6 import javax.servlet.http.HttpServletResponse;
7
8 import org.cacert.gigi.dbObjects.Group;
9 import org.cacert.gigi.dbObjects.User;
10 import org.cacert.gigi.pages.Page;
11 import org.cacert.gigi.util.AuthorizationContext;
12
13 public class SupportUserHistory extends Page {
14
15     public static final String PATH = "/support/user/*/history";
16
17     private static final int intStart = PATH.indexOf('*');
18
19     public SupportUserHistory() {
20         super("Support user history");
21     }
22
23     @Override
24     public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
25         String info = req.getPathInfo();
26         int id = Integer.parseInt(info.substring(intStart, info.length() - PATH.length() + intStart + 1));
27         User u = User.getById(id);
28         if (u == null) {
29             resp.sendError(404);
30             return;
31         }
32         // TODO get Admin log
33     }
34
35     @Override
36     public boolean isPermitted(AuthorizationContext ac) {
37         return ac != null && ac.isInGroup(Group.SUPPORTER);
38     }
39 }