Changeset fee755b


Ignore:
Timestamp:
Dec 13, 2015 2:42:12 AM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
97ae1e50
Parents:
4fe2479
Message:

Show family cert on /certs; fix HTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/CertHelper.java

    r4fe2479 rfee755b  
    44import java.io.IOException;
    55
     6import net.i2p.data.DataHelper;
    67import net.i2p.util.FileUtil;
     8import net.i2p.router.crypto.FamilyKeyCrypto;
    79
    810
     
    5052            if (!hasTunnels)
    5153                output(_t("I2PTunnel"), null);
     54
     55            _out.write("<h3>");
     56            _out.write(_t("Local Router Family Certificate"));
     57            _out.write("</h3>\n");
     58            String family = _context.getProperty(FamilyKeyCrypto.PROP_FAMILY_NAME);
     59            if (family != null) {
     60                File f = new File(dir, "family");
     61                f = new File(f, family + ".crt");
     62                output(_t("Family") + ": " + DataHelper.escapeHTML(family), f);
     63            } else {
     64                _out.write("<p>");
     65                _out.write(_t("none"));
     66                _out.write("</p>\n");
     67            }
     68
    5269            // anything else? plugins?
     70
    5371        } catch (IOException ioe) {
    5472            ioe.printStackTrace();
     
    6280    private void output(String name, File file) throws IOException {
    6381        _out.write("<p><h4>");
     82        _out.write(name);
    6483        _out.write("</h4>");
    65         _out.write(name);
    6684        if (file != null && file.exists()) {
    6785            String cert = FileUtil.readTextFile(file.toString(), -1, true);
     
    7492            }
    7593        } else {
    76             _out.write(": ");
     94            _out.write("<p>");
    7795            _out.write(_t("none"));
     96            _out.write("</p>\n");
    7897        }
    79         _out.write("</p>\n");
    8098    }
    8199}
Note: See TracChangeset for help on using the changeset viewer.