From 284a7bd54e9cddb0eabcd77148ee64639010d2ee Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Wed, 26 Oct 2011 17:11:12 -0400 Subject: [PATCH] Return management-level settings if web.enableRpcAdministration=false --- src/com/gitblit/client/GitblitClient.java | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java index 7991423..761283e 100644 --- a/src/com/gitblit/client/GitblitClient.java +++ b/src/com/gitblit/client/GitblitClient.java @@ -48,7 +48,7 @@ public final String account; private final char[] password; - + private volatile boolean allowManagement; private volatile boolean allowAdministration; @@ -87,7 +87,7 @@ try { refreshSettings(); - status = RpcUtils.getStatus(url, account, password); + refreshStatus(); allowAdministration = true; } catch (UnauthorizedException e) { } catch (ForbiddenException e) { @@ -100,7 +100,7 @@ public boolean allowManagement() { return allowManagement; } - + public boolean allowAdministration() { return allowAdministration; } @@ -136,10 +136,15 @@ allUsers.addAll(users); return allUsers; } - + public ServerSettings refreshSettings() throws IOException { settings = RpcUtils.getSettings(url, account, password); return settings; + } + + public ServerStatus refreshStatus() throws IOException { + status = RpcUtils.getStatus(url, account, password); + return status; } public List<FederationModel> refreshFederationRegistrations() throws IOException { @@ -217,4 +222,8 @@ public boolean deleteUser(UserModel user) throws IOException { return RpcUtils.deleteUser(user, url, account, password); } + + public boolean updateSettings(Map<String, String> newSettings) throws IOException { + return RpcUtils.updateSettings(newSettings, url, account, password); + } } -- Gitblit v1.9.1