Hybris95
2014-04-22 3f5b8f5d9203aa7ffb7fbe9cdbaf9dba3da6cae6
src/main/java/com/gitblit/wicket/pages/RootPage.java
@@ -134,6 +134,8 @@
      boolean authenticateView = app().settings().getBoolean(Keys.web.authenticateViewPages, false);
      boolean authenticateAdmin = app().settings().getBoolean(Keys.web.authenticateAdminPages, true);
      boolean allowAdmin = app().settings().getBoolean(Keys.web.allowAdministration, true);
      boolean allowLucene = app().settings().getBoolean(Keys.web.allowLuceneIndexing, true);
      boolean isLoggedIn = GitBlitWebSession.get().isLoggedIn();
      if (authenticateAdmin) {
         showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();
@@ -151,7 +153,7 @@
      }
      if (authenticateView || authenticateAdmin) {
         if (GitBlitWebSession.get().isLoggedIn()) {
         if (isLoggedIn) {
            UserMenu userFragment = new UserMenu("userPanel", "userMenuFragment", RootPage.this);
            add(userFragment);
         } else {
@@ -167,13 +169,17 @@
      // navigation links
      List<PageRegistration> pages = new ArrayList<PageRegistration>();
      if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
         pages.add(new PageRegistration(GitBlitWebSession.get().isLoggedIn() ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
      if (!authenticateView || (authenticateView && isLoggedIn)) {
         pages.add(new PageRegistration(isLoggedIn ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
               getRootPageParameters()));
         pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class,
               getRootPageParameters()));
         pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters()));
         if (app().settings().getBoolean(Keys.web.allowLuceneIndexing, true)) {
         if(isLoggedIn)
         {
            pages.add(new PageRegistration("gb.mytickets", MyTicketsPage.class, getRootPageParameters()));
         }
         if (allowLucene) {
            pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
         }
         if (showAdmin) {
@@ -183,7 +189,7 @@
            pages.add(new PageRegistration("gb.federation", FederationPage.class));
         }
         if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
         if (!authenticateView || (authenticateView && isLoggedIn)) {
            addDropDownMenus(pages);
         }
      }
@@ -252,7 +258,7 @@
         // Set Cookie
         if (app().settings().getBoolean(Keys.web.allowCookieAuthentication, false)) {
            WebResponse response = (WebResponse) getRequestCycle().getResponse();
            app().session().setCookie(response, user);
            app().authentication().setCookie(response.getHttpServletResponse(), user);
         }
         if (!session.continueRequest()) {
@@ -536,7 +542,7 @@
               String username = RootPage.this.username.getObject();
               char[] password = RootPage.this.password.getObject().toCharArray();
               UserModel user = app().session().authenticate(username, password);
               UserModel user = app().authentication().authenticate(username, password);
               if (user == null) {
                  error(getString("gb.invalidUsernameOrPassword"));
               } else if (user.username.equals(Constants.FEDERATION_USER)) {
@@ -572,12 +578,11 @@
         GitBlitWebSession session = GitBlitWebSession.get();
         UserModel user = session.getUser();
         boolean editCredentials = app().users().supportsCredentialChanges(user);
         boolean editCredentials = app().authentication().supportsCredentialChanges(user);
         boolean standardLogin = session.authenticationType.isStandard();
         if (app().settings().getBoolean(Keys.web.allowGravatar, true)) {
            add(new GravatarImage("username", user.getDisplayName(),
                  user.emailAddress, "navbarGravatar", 20, false, false));
            add(new GravatarImage("username", user, "navbarGravatar", 20, false));
         } else {
            add(new Label("username", user.getDisplayName()));
         }