From 53952358491f093e1e40fce4f30b1c034d9c98a9 Mon Sep 17 00:00:00 2001
From: Wolfgang <wolfgang@gassler.org>
Date: Fri, 02 Nov 2012 16:56:13 -0400
Subject: [PATCH] first running hook to send pushed file to the bug tracker thebuggenie

---
 src/com/gitblit/AuthenticationFilter.java |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/com/gitblit/AuthenticationFilter.java b/src/com/gitblit/AuthenticationFilter.java
index 277b220..4762c42 100644
--- a/src/com/gitblit/AuthenticationFilter.java
+++ b/src/com/gitblit/AuthenticationFilter.java
@@ -103,7 +103,7 @@
 			String credentials = new String(Base64.decode(base64Credentials),
 					Charset.forName("UTF-8"));
 			// credentials = username:password
-			final String[] values = credentials.split(":");
+			final String[] values = credentials.split(":",2);
 
 			if (values.length == 2) {
 				String username = values[0];
@@ -170,8 +170,9 @@
 		public AuthenticatedRequest(HttpServletRequest req) {
 			super(req);
 			user = new UserModel("anonymous");
+			user.isAuthenticated = false;
 		}
-		
+
 		UserModel getUser() {
 			return user;
 		}
@@ -188,8 +189,11 @@
 		@Override
 		public boolean isUserInRole(String role) {
 			if (role.equals(Constants.ADMIN_ROLE)) {
-				return user.canAdmin;
+				return user.canAdmin();
 			}
+			// Gitblit does not currently use actual roles in the traditional
+			// servlet container sense.  That is the reason this is marked
+			// deprecated, but I may want to revisit this.
 			return user.canAccessRepository(role);
 		}
 

--
Gitblit v1.9.1