X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2FGigi.java;h=6ddb54684e92f02c163c22fdb7d3b287f7a14d47;hp=d33d546d9558cf02882f21365ce030c4e80eb31b;hb=321275b98020a0bc4e26369296cc60fb85c15c23;hpb=7a5f2a2674900b80847ab77bb1ace1b53215f4b9 diff --git a/src/club/wpia/gigi/Gigi.java b/src/club/wpia/gigi/Gigi.java index d33d546d..6ddb5468 100644 --- a/src/club/wpia/gigi/Gigi.java +++ b/src/club/wpia/gigi/Gigi.java @@ -51,6 +51,7 @@ import club.wpia.gigi.pages.MainPage; import club.wpia.gigi.pages.OneFormPage; import club.wpia.gigi.pages.Page; import club.wpia.gigi.pages.PasswordResetPage; +import club.wpia.gigi.pages.PolicyPage; import club.wpia.gigi.pages.RootCertPage; import club.wpia.gigi.pages.StaticPage; import club.wpia.gigi.pages.Verify; @@ -154,6 +155,7 @@ public final class Gigi extends HttpServlet { putPage("/roots", new RootCertPage(truststore), mainMenu); putPage(StatisticsRoles.PATH, new StatisticsRoles(), mainMenu); putPage("/about", new AboutPage(), mainMenu); + putPage("/policy", new PolicyPage(), mainMenu); putPage(RegisterPage.PATH, new RegisterPage(), mainMenu); putPage(CertStatusRequestPage.PATH, new CertStatusRequestPage(), mainMenu); putPage(KeyCompromisePage.PATH, new KeyCompromisePage(), mainMenu); @@ -189,7 +191,15 @@ public final class Gigi extends HttpServlet { putPage(SupportOrgDomainPage.PATH + "*", new SupportOrgDomainPage(), null); putPage(ChangePasswordPage.PATH, new ChangePasswordPage(), account); putPage(History.PATH, new History(false), account); - putPage(FindAgentAccess.PATH, new OneFormPage("Access to Find Agent", FindAgentAccess.class), account); + + putPage(FindAgentAccess.PATH, new OneFormPage("Access to Find Agent", FindAgentAccess.class) { + + @Override + public boolean isPermitted(AuthorizationContext ac) { + return super.isPermitted(ac) && !ServerConstants.isCommunityCA(); + } + }, account); + putPage(History.SUPPORT_PATH, new History(true), null); putPage(UserTrainings.PATH, new UserTrainings(false), account); putPage(MyDetails.PATH, new MyDetails(), account); @@ -214,7 +224,13 @@ public final class Gigi extends HttpServlet { } try { - putPage("/wot/rules", new StaticPage("Verification Rules", VerifyPage.class.getResourceAsStream("Rules.templ")), wot); + putPage("/wot/rules", new StaticPage("Verification Rules", VerifyPage.class.getResourceAsStream("Rules.templ")) { + + @Override + public boolean isPermitted(AuthorizationContext ac) { + return super.isPermitted(ac) && !ServerConstants.isCommunityCA(); + } + }, wot); } catch (UnsupportedEncodingException e) { throw new ServletException(e); } @@ -310,12 +326,10 @@ public final class Gigi extends HttpServlet { } try { - final FileChannel knownPasswordHashesFile = FileChannel.open( - FileSystems.getDefault().getPath(knownPasswordHashesPath)); + final FileChannel knownPasswordHashesFile = FileChannel.open(FileSystems.getDefault().getPath(knownPasswordHashesPath)); return new DelegatingPasswordChecker(new PasswordChecker[] { - new PasswordStrengthChecker(), - new PasswordHashChecker(knownPasswordHashesFile, sha1) - }); + new PasswordStrengthChecker(), new PasswordHashChecker(knownPasswordHashesFile, sha1) + }); } catch (IOException e) { if (knownPasswordHashesRequired) { throw new RuntimeException("Error while opening password hash database, refusing startup", e);