private KeyStore truststore;
+ private boolean testing;
+
public Gigi(Properties conf, KeyStore truststore) {
if (instance != null) {
throw new IllegalStateException("Multiple Gigi instances!");
}
+ testing = conf.getProperty("testing") != null;
instance = this;
DatabaseConnection.init(conf);
this.truststore = truststore;
putPage(MyPoints.PATH, new MyPoints("My Points"), "CAcert Web of Trust");
putPage(RequestTTPPage.PATH, new RequestTTPPage(), "CAcert Web of Trust");
putPage(TTPAdminPage.PATH + "/*", new TTPAdminPage(), "Admin");
- putPage(CreateOrgPage.DEFAULT_PATH, new CreateOrgPage(), "Admin");
- putPage(ViewOrgPage.DEFAULT_PATH + "/*", new ViewOrgPage(), "Admin");
+ putPage(CreateOrgPage.DEFAULT_PATH, new CreateOrgPage(), "Organisation Admin");
+ putPage(ViewOrgPage.DEFAULT_PATH + "/*", new ViewOrgPage(), "Organisation Admin");
+ if (testing) {
+ try {
+ Class<?> manager = Class.forName("org.cacert.gigi.pages.Manager");
+ Page p = (Page) manager.getMethod("getInstance").invoke(null);
+ String pa = (String) manager.getField("PATH").get(null);
+ putPage(pa + "/*", p, "Gigi test server");
+ } catch (ReflectiveOperationException e) {
+ e.printStackTrace();
+ }
+ }
+
putPage("/wot/rules", new StaticPage("CAcert Web of Trust Rules", AssurePage.class.getResourceAsStream("Rules.templ")), "CAcert Web of Trust");
baseTemplate = new Template(Gigi.class.getResource("Gigi.templ"));
rootMenu = new Menu("Main");