From 4640f1b689684b805f08a5a937e91dfc65ae977f Mon Sep 17 00:00:00 2001 From: Hybris95 <hybris_95@hotmail.com> Date: Thu, 01 May 2014 16:14:14 -0400 Subject: [PATCH] Now only shows the "my tickets" button in the navbar if you are connected. Redirects to the main page if you try going on "/mytickets" when not connected (or if you disconnect while being on "/mytickets"). --- src/main/java/com/gitblit/git/GitblitUploadPackFactory.java | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/gitblit/git/GitblitUploadPackFactory.java b/src/main/java/com/gitblit/git/GitblitUploadPackFactory.java index d4e3ca1..ec85628 100644 --- a/src/main/java/com/gitblit/git/GitblitUploadPackFactory.java +++ b/src/main/java/com/gitblit/git/GitblitUploadPackFactory.java @@ -15,8 +15,6 @@ */ package com.gitblit.git; -import javax.servlet.http.HttpServletRequest; - import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.transport.UploadPack; import org.eclipse.jgit.transport.resolver.ServiceNotAuthorizedException; @@ -24,7 +22,7 @@ import org.eclipse.jgit.transport.resolver.UploadPackFactory; import com.gitblit.manager.IAuthenticationManager; -import com.gitblit.models.UserModel; +import com.gitblit.transport.git.GitDaemonClient; /** * The upload pack factory creates an upload pack which controls what refs are @@ -46,16 +44,9 @@ public UploadPack create(X req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException { - UserModel user = UserModel.ANONYMOUS; int timeout = 0; - if (req instanceof HttpServletRequest) { - // http/https request may or may not be authenticated - user = authenticationManager.authenticate((HttpServletRequest) req); - if (user == null) { - user = UserModel.ANONYMOUS; - } - } else if (req instanceof GitDaemonClient) { + if (req instanceof GitDaemonClient) { // git daemon request is always anonymous GitDaemonClient client = (GitDaemonClient) req; // set timeout from Git daemon -- Gitblit v1.9.1