import org.cacert.gigi.output.template.IterableDataset;
import org.cacert.gigi.output.template.Template;
import org.cacert.gigi.ping.SSLPinger;
+import org.cacert.gigi.util.HTMLEncoder;
import org.cacert.gigi.util.RandomToken;
public class PingConfigForm extends Form {
private SSLType[] sslTypes = new SSLType[MAX_SSL_TESTS];
- private final Template t = new Template(PingConfigForm.class.getResource("PingConfigForm.templ"));
+ private static final Template t = new Template(PingConfigForm.class.getResource("PingConfigForm.templ"));
public PingConfigForm(HttpServletRequest hsr, Domain target) throws GigiApiException {
super(hsr);
}
@Override
- public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException {
+ public boolean submit(HttpServletRequest req) throws GigiApiException {
+ target.clearPings();
if (req.getParameter("emailType") != null && req.getParameter("email") != null) {
try {
String mail = AUTHORATIVE_EMAILS[Integer.parseInt(req.getParameter("email"))];
}
}
Gigi.notifyPinger(null);
- return false;
+ return true;
}
@Override
protected void outputContent(PrintWriter out, Language l, Map<String, Object> vars) {
- out.print("<table class=\"wrapper dataTable\"><tbody>");
+ vars.put("notEmbedded", true);
outputEmbeddableContent(out, l, vars);
- out.print("<tr><td></td><td><input type=\"submit\" value=\"Update\"/></td></tbody></table>");
}
protected void outputEmbeddableContent(PrintWriter out, Language l, Map<String, Object> vars) {
vars.put("tokenName", tokenName);
vars.put("tokenValue", tokenValue);
+ vars.put("openSSLHelp", "<code>" + HTMLEncoder.encodeHTML("-subj \"/CN=<domain>/OU=" + tokenValue + "\"") + "</code>");
vars.put("authEmails", new IterableDataset() {
int i = 0;