]> source.dussan.org Git - gitblit.git/commitdiff
Moved #externalAccount string to common constants class
authorJames Moger <james.moger@gitblit.com>
Mon, 17 Jun 2013 19:50:04 +0000 (15:50 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 17 Jun 2013 19:50:04 +0000 (15:50 -0400)
src/main/java/com/gitblit/Constants.java
src/main/java/com/gitblit/GitblitUserService.java
src/main/java/com/gitblit/LdapUserService.java
src/main/java/com/gitblit/RedmineUserService.java
src/main/java/com/gitblit/SalesforceUserService.java

index cd0fea6c9f0435f9c2a5421878130aa40574c221..5ed0a256d4db66dbc7a7481c0a32410cfb951f70 100644 (file)
@@ -43,6 +43,8 @@ public class Constants {
        public static final String NOT_FEDERATED_ROLE = "#notfederated";\r
        \r
        public static final String NO_ROLE = "#none";\r
+       \r
+       public static final String EXTERNAL_ACCOUNT = "#externalAccount";\r
 \r
        public static final String PROPERTIES_FILE = "gitblit.properties";\r
 \r
index fe35db9486735c9cd3d8ea88e91aae440828948f..658404b5e7f883ef4884aa5ac0d02a9f78643dbc 100644 (file)
@@ -52,8 +52,6 @@ public class GitblitUserService implements IUserService {
 \r
        protected IUserService serviceImpl;\r
        \r
-       protected final String ExternalAccount = "#externalAccount";\r
-\r
        private final Logger logger = LoggerFactory.getLogger(GitblitUserService.class);\r
 \r
        public GitblitUserService() {\r
@@ -324,7 +322,7 @@ public class GitblitUserService implements IUserService {
        protected void setAccountType(UserModel user) {\r
                if (user != null) {\r
                        if (!StringUtils.isEmpty(user.password)\r
-                                       && !ExternalAccount.equalsIgnoreCase(user.password)\r
+                                       && !Constants.EXTERNAL_ACCOUNT.equalsIgnoreCase(user.password)\r
                                        && !"StoredInLDAP".equalsIgnoreCase(user.password)) {\r
                                user.accountType = AccountType.LOCAL;\r
                        } else {\r
index 2867b88fda7c72ba08c7686140c7a832df488a6c..39d564dd8fd1b6faf90dd6e14faa7f0aea103c88 100644 (file)
@@ -129,7 +129,7 @@ public class LdapUserService extends GitblitUserService {
                                 logger.debug("detecting removed LDAP users...");\r
 \r
                                 for (UserModel userModel : super.getAllUsers()) {\r
-                                    if (ExternalAccount.equals(userModel.password)) {\r
+                                    if (Constants.EXTERNAL_ACCOUNT.equals(userModel.password)) {\r
                                         if (! ldapUsers.containsKey(userModel.username)) {\r
                                             logger.info("deleting removed LDAP user " + userModel.username + " from backing user service");\r
                                             super.deleteUser(userModel.username);\r
@@ -344,7 +344,7 @@ public class LdapUserService extends GitblitUserService {
                setAdminAttribute(user);\r
                \r
                // Don't want visibility into the real password, make up a dummy\r
-               user.password = ExternalAccount;\r
+               user.password = Constants.EXTERNAL_ACCOUNT;\r
                user.accountType = getAccountType();\r
                \r
                // Get full name Attribute\r
index 2728e0040d294146a076c3f85eb49a412e118480..d677e3e46c6fb59ed60c9b0f414ae9ff0f6a2224 100644 (file)
@@ -135,7 +135,7 @@ public class RedmineUserService extends GitblitUserService {
         user.accountType = getAccountType();\r
         user.displayName = current.user.firstname + " " + current.user.lastname;\r
         user.emailAddress = current.user.mail;\r
-        user.password = ExternalAccount;\r
+        user.password = Constants.EXTERNAL_ACCOUNT;\r
         if (!StringUtils.isEmpty(current.user.login)) {\r
                // only admin users can get login name\r
                // evidently this is an undocumented behavior of Redmine\r
index 4a6a1bae11a155af931bbe1f8b1e3cf4e381541e..989b487808b74bfca966db55702c9bb91f45fde0 100644 (file)
@@ -96,7 +96,7 @@ public class SalesforceUserService extends GitblitUserService {
 
        private void setUserAttributes(UserModel user, GetUserInfoResult info) {
                // Don't want visibility into the real password, make up a dummy
-               user.password = ExternalAccount;
+               user.password = Constants.EXTERNAL_ACCOUNT;
                user.accountType = getAccountType();
 
                // Get full name Attribute