import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.cacert.gigi.dbObjects.CertificateOwner;
import org.cacert.gigi.dbObjects.User;
import org.cacert.gigi.output.template.OutputableArrayIterable;
+import org.cacert.gigi.pages.LoginPage;
import org.cacert.gigi.pages.Page;
import org.cacert.gigi.util.AuthorizationContext;
-public class UserHistory extends Page {
+public class History extends Page {
public static final String SUPPORT_PATH = "/support/user/*/history";
private boolean support;
- public UserHistory(boolean support) {
- super(support ? "Support user history" : "History");
+ public History(boolean support) {
+ super(support ? "Support History" : "History");
this.support = support;
}
@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
- User u;
+ CertificateOwner u;
if (support) {
String info = req.getPathInfo();
int id = Integer.parseInt(info.substring(intStart, info.length() - SUPPORT_PATH.length() + intStart + 1));
return;
}
} else {
- u = getUser(req);
+ u = LoginPage.getAuthorizationContext(req).getTarget();
}
String[] adminLog = u.getAdminLog();
HashMap<String, Object> vars = new HashMap<>();