From 3490ef1a69af4bc72be03188fd9961ef2183dc2b Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Thu, 01 May 2014 16:14:15 -0400
Subject: [PATCH] Reverted changes to ticket services
---
src/main/java/com/gitblit/wicket/pages/RootPage.java | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/gitblit/wicket/pages/RootPage.java b/src/main/java/com/gitblit/wicket/pages/RootPage.java
index 1a43bf1..c59c189 100644
--- a/src/main/java/com/gitblit/wicket/pages/RootPage.java
+++ b/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,16 @@
// 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()));
+ if (isLoggedIn && app().tickets().isReady()) {
+ pages.add(new PageRegistration("gb.myTickets", MyTicketsPage.class));
+ }
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 (allowLucene) {
pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
}
if (showAdmin) {
@@ -183,7 +188,7 @@
pages.add(new PageRegistration("gb.federation", FederationPage.class));
}
- if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
+ if (!authenticateView || (authenticateView && isLoggedIn)) {
addDropDownMenus(pages);
}
}
@@ -252,7 +257,7 @@
// Set Cookie
if (app().settings().getBoolean(Keys.web.allowCookieAuthentication, false)) {
WebResponse response = (WebResponse) getRequestCycle().getResponse();
- app().session().setCookie(response.getHttpServletResponse(), user);
+ app().authentication().setCookie(response.getHttpServletResponse(), user);
}
if (!session.continueRequest()) {
@@ -536,7 +541,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 +577,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()));
}
--
Gitblit v1.9.1