From: James Moger Date: Thu, 27 Mar 2014 01:51:28 +0000 (-0400) Subject: Delete ssh public keys when user is deleted X-Git-Tag: v1.5.0~68^2~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6da45ac87e39c2efeeb2849271ac3c555f106ab9;p=gitblit.git Delete ssh public keys when user is deleted --- 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. */