From 6da45ac87e39c2efeeb2849271ac3c555f106ab9 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 26 Mar 2014 21:51:28 -0400 Subject: [PATCH] Delete ssh public keys when user is deleted --- src/main/java/com/gitblit/GitBlit.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java index 59408a68..0ffff310 100644 --- a/src/main/java/com/gitblit/GitBlit.java +++ b/src/main/java/com/gitblit/GitBlit.java @@ -195,6 +195,27 @@ public class GitBlit extends GitblitManager { } } + /** + * Delete the user and all associated public ssh keys. + */ + @Override + public boolean deleteUser(String username) { + boolean success = userManager.deleteUser(username); + if (success) { + getPublicKeyManager().removeAllKeys(username); + } + return success; + } + + @Override + public boolean deleteUserModel(UserModel model) { + boolean success = userManager.deleteUserModel(model); + if (success) { + getPublicKeyManager().removeAllKeys(model.username); + } + return success; + } + /** * Delete the repository and all associated tickets. */ -- 2.39.5