| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public static final int PROTOCOL_VERSION = 2;
|
| | | public static final int PROTOCOL_VERSION = 4;
|
| | |
|
| | | public RpcServlet() {
|
| | | super();
|
| | |
| | | }
|
| | | } 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;
|
| | |
| | | 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;
|
| | | }
|
| | |
| | | } 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
|