From fdefa2b1fd7e3a4349a4ee72599f5d390166be30 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 25 Apr 2012 17:15:32 -0400 Subject: [PATCH] Displayname and email address persistence for ConfigUserService --- src/com/gitblit/ConfigUserService.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/com/gitblit/ConfigUserService.java b/src/com/gitblit/ConfigUserService.java index f8eff9f3..8170be7c 100644 --- a/src/com/gitblit/ConfigUserService.java +++ b/src/com/gitblit/ConfigUserService.java @@ -60,6 +60,10 @@ public class ConfigUserService implements IUserService { private static final String USER = "user"; private static final String PASSWORD = "password"; + + private static final String DISPLAYNAME = "displayName"; + + private static final String EMAILADDRESS = "emailAddress"; private static final String REPOSITORY = "repository"; @@ -689,6 +693,12 @@ public class ConfigUserService implements IUserService { if (!StringUtils.isEmpty(model.password)) { config.setString(USER, model.username, PASSWORD, model.password); } + if (!StringUtils.isEmpty(model.displayName)) { + config.setString(USER, model.username, DISPLAYNAME, model.displayName); + } + if (!StringUtils.isEmpty(model.emailAddress)) { + config.setString(USER, model.username, EMAILADDRESS, model.emailAddress); + } // user roles List roles = new ArrayList(); @@ -785,7 +795,9 @@ public class ConfigUserService implements IUserService { Set usernames = config.getSubsections(USER); for (String username : usernames) { UserModel user = new UserModel(username.toLowerCase()); - user.password = config.getString(USER, username, PASSWORD); + user.password = config.getString(USER, username, PASSWORD); + user.displayName = config.getString(USER, username, DISPLAYNAME); + user.emailAddress = config.getString(USER, username, EMAILADDRESS); // user roles Set roles = new HashSet(Arrays.asList(config.getStringList( -- 2.39.5