From 8c9bce97acb5ca21c8b23d9594c24204d13fc436 Mon Sep 17 00:00:00 2001 From: Mrbytes <eguervos@msn.com> Date: Fri, 12 Oct 2012 13:25:53 -0400 Subject: [PATCH] GitBlitWebApp_es.properties: -Up-to-date. -Some minor changes in syntax for better compression. --- src/com/gitblit/RpcServlet.java | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/com/gitblit/RpcServlet.java b/src/com/gitblit/RpcServlet.java index c33bd8a..2a6ba26 100644 --- a/src/com/gitblit/RpcServlet.java +++ b/src/com/gitblit/RpcServlet.java @@ -49,7 +49,7 @@ private static final long serialVersionUID = 1L; - public static final int PROTOCOL_VERSION = 2; + public static final int PROTOCOL_VERSION = 4; public RpcServlet() { super(); @@ -73,10 +73,10 @@ UserModel user = (UserModel) request.getUserPrincipal(); - boolean allowManagement = user != null && user.canAdmin + boolean allowManagement = user != null && user.canAdmin() && GitBlit.getBoolean(Keys.web.enableRpcManagement, false); - boolean allowAdmin = user != null && user.canAdmin + boolean allowAdmin = user != null && user.canAdmin() && GitBlit.getBoolean(Keys.web.enableRpcAdministration, false); Object result = null; @@ -276,7 +276,7 @@ } } else if (RpcRequest.LIST_SETTINGS.equals(reqType)) { // return the server's settings - ServerSettings settings = GitBlit.self().getSettingsModel(); + ServerSettings settings = GitBlit.self().getSettingsModel(); if (allowAdmin) { // return all settings result = settings; @@ -294,12 +294,12 @@ keys.add(Keys.federation.sets); } // build the settings - ServerSettings managementSettings = new ServerSettings(); + ServerSettings managementSettings = new ServerSettings(); for (String key : keys) { managementSettings.add(settings.get(key)); } if (allowManagement) { - settings.pushScripts = settings.pushScripts; + managementSettings.pushScripts = settings.pushScripts; } result = managementSettings; } @@ -319,6 +319,13 @@ } else { response.sendError(notAllowedCode); } + } else if (RpcRequest.CLEAR_REPOSITORY_CACHE.equals(reqType)) { + // clear the repository list cache + if (allowManagement) { + GitBlit.self().resetRepositoryListCache(); + } else { + response.sendError(notAllowedCode); + } } // send the result of the request -- Gitblit v1.9.1