From 27ae9095639bb228a1b7ff86a3ebe4264abf05be Mon Sep 17 00:00:00 2001
From: mschaefers <mschaefers@scoop-gmbh.de>
Date: Thu, 29 Nov 2012 12:33:09 -0500
Subject: [PATCH] feature: when using LdapUserService one can configure Gitblit to fetch all users from ldap that can possibly login. This allows to see newly generated LDAP users instantly in Gitblit. By now an LDAP user had to log in once to appear in GitBlit.

---
 src/com/gitblit/client/GitblitWorker.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/com/gitblit/client/GitblitWorker.java b/src/com/gitblit/client/GitblitWorker.java
index 45baf03..93c35d6 100644
--- a/src/com/gitblit/client/GitblitWorker.java
+++ b/src/com/gitblit/client/GitblitWorker.java
@@ -16,6 +16,7 @@
 package com.gitblit.client;
 
 import java.awt.Component;
+import java.awt.Cursor;
 import java.io.IOException;
 import java.text.MessageFormat;
 
@@ -24,7 +25,9 @@
 
 import com.gitblit.Constants.RpcRequest;
 import com.gitblit.GitBlitException.ForbiddenException;
+import com.gitblit.GitBlitException.NotAllowedException;
 import com.gitblit.GitBlitException.UnauthorizedException;
+import com.gitblit.GitBlitException.UnknownRequestException;
 
 public abstract class GitblitWorker extends SwingWorker<Boolean, Void> {
 
@@ -35,6 +38,7 @@
 	public GitblitWorker(Component parent, RpcRequest request) {
 		this.parent = parent;
 		this.request = request;
+		parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 	}
 
 	protected RpcRequest getRequestType() {
@@ -47,6 +51,7 @@
 	}
 
 	protected void done() {
+		parent.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
 		try {
 			Boolean success = get();
 			if (success) {
@@ -59,6 +64,10 @@
 				Utils.explainForbidden(parent, request);
 			} else if (t instanceof UnauthorizedException) {
 				Utils.explainUnauthorized(parent, request);
+			} else if (t instanceof NotAllowedException) {
+				Utils.explainNotAllowed(parent, request);
+			} else if (t instanceof UnknownRequestException) {
+				Utils.explainNotAllowed(parent, request);
 			} else {
 				Utils.showException(parent, t);
 			}

--
Gitblit v1.9.1