]> source.dussan.org Git - gitblit.git/commitdiff
Delete ssh public keys when user is deleted
authorJames Moger <james.moger@gitblit.com>
Thu, 27 Mar 2014 01:51:28 +0000 (21:51 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Apr 2014 22:58:10 +0000 (18:58 -0400)
src/main/java/com/gitblit/GitBlit.java

index 59408a68a119700fcbe73ee9dece899634b104e0..0ffff310022a63a0052971843612b120f34b024c 100644 (file)
@@ -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.
         */