]> source.dussan.org Git - gitblit.git/commitdiff
Displayname and email address persistence for ConfigUserService
authorJames Moger <james.moger@gitblit.com>
Wed, 25 Apr 2012 21:15:32 +0000 (17:15 -0400)
committerJames Moger <james.moger@gitblit.com>
Wed, 25 Apr 2012 21:15:32 +0000 (17:15 -0400)
src/com/gitblit/ConfigUserService.java

index f8eff9f35e5c43a3a89bb17bfafdcc89f0fc1295..8170be7c0cc60116e906e987e03f261dcc6c2ffb 100644 (file)
@@ -60,6 +60,10 @@ public class ConfigUserService implements IUserService {
        private static final String USER = "user";\r
 \r
        private static final String PASSWORD = "password";\r
+       \r
+       private static final String DISPLAYNAME = "displayName";\r
+       \r
+       private static final String EMAILADDRESS = "emailAddress";\r
 \r
        private static final String REPOSITORY = "repository";\r
 \r
@@ -689,6 +693,12 @@ public class ConfigUserService implements IUserService {
                        if (!StringUtils.isEmpty(model.password)) {\r
                                config.setString(USER, model.username, PASSWORD, model.password);\r
                        }\r
+                       if (!StringUtils.isEmpty(model.displayName)) {\r
+                               config.setString(USER, model.username, DISPLAYNAME, model.displayName);\r
+                       }\r
+                       if (!StringUtils.isEmpty(model.emailAddress)) {\r
+                               config.setString(USER, model.username, EMAILADDRESS, model.emailAddress);\r
+                       }\r
 \r
                        // user roles\r
                        List<String> roles = new ArrayList<String>();\r
@@ -785,7 +795,9 @@ public class ConfigUserService implements IUserService {
                                Set<String> usernames = config.getSubsections(USER);\r
                                for (String username : usernames) {\r
                                        UserModel user = new UserModel(username.toLowerCase());\r
-                                       user.password = config.getString(USER, username, PASSWORD);\r
+                                       user.password = config.getString(USER, username, PASSWORD);                                     \r
+                                       user.displayName = config.getString(USER, username, DISPLAYNAME);\r
+                                       user.emailAddress = config.getString(USER, username, EMAILADDRESS);\r
 \r
                                        // user roles\r
                                        Set<String> roles = new HashSet<String>(Arrays.asList(config.getStringList(\r