From ce2a408256dcd81690f812dee95b0797e8880824 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 11 Jul 2012 17:07:46 -0400
Subject: [PATCH] Fixed bug in ConfigUserService when user has nothing other than an account name
---
src/com/gitblit/AuthenticationFilter.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/com/gitblit/AuthenticationFilter.java b/src/com/gitblit/AuthenticationFilter.java
index 277b220..50a67a0 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];
@@ -171,7 +171,7 @@
super(req);
user = new UserModel("anonymous");
}
-
+
UserModel getUser() {
return user;
}
@@ -190,6 +190,9 @@
if (role.equals(Constants.ADMIN_ROLE)) {
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