X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2FGigi.java;h=aa892a5d653bc657ac791445a80a6abcdb94db0e;hb=62b9a6519d6304820fdfa739ef9281e1cdaccb7d;hp=e4190154773deb80e68ec9c5462ef76b827d8ad7;hpb=e22be4ce369ba8ebb045cc326db935820167d25f;p=gigi.git diff --git a/src/club/wpia/gigi/Gigi.java b/src/club/wpia/gigi/Gigi.java index e4190154..aa892a5d 100644 --- a/src/club/wpia/gigi/Gigi.java +++ b/src/club/wpia/gigi/Gigi.java @@ -7,7 +7,6 @@ import java.math.BigInteger; import java.nio.channels.FileChannel; import java.nio.file.FileSystems; import java.nio.file.NoSuchFileException; -import java.nio.file.Path; import java.security.KeyStore; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -58,6 +57,7 @@ import club.wpia.gigi.pages.Verify; import club.wpia.gigi.pages.account.ChangePasswordPage; import club.wpia.gigi.pages.account.FindAgentAccess; import club.wpia.gigi.pages.account.History; +import club.wpia.gigi.pages.account.MyContracts; import club.wpia.gigi.pages.account.MyDetails; import club.wpia.gigi.pages.account.UserTrainings; import club.wpia.gigi.pages.account.certs.CertificateAdd; @@ -189,13 +189,22 @@ 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); putPage(UserTrainings.SUPPORT_PATH, new UserTrainings(true), null); putPage(Points.SUPPORT_PATH, new Points(true), null); putPage(Certificates.SUPPORT_PATH + "/*", new Certificates(true), null); + putPage(MyContracts.PATH, new MyContracts(), null); putPage(PasswordResetPage.PATH, new PasswordResetPage(), null); putPage(LogoutPage.PATH, new LogoutPage(), null); @@ -213,7 +222,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); } @@ -309,12 +324,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);