James Moger
2011-11-11 d65f712ea3d8941f4b9145c0630c30c20af80d13
src/com/gitblit/FileUserService.java
@@ -53,6 +53,16 @@
   }
   /**
    * Setup the user service.
    *
    * @param settings
    * @since 0.6.1
    */
   @Override
   public void setup(IStoredSettings settings) {
   }
   /**
    * Does the user service support cookie authentication?
    * 
    * @return true or false
@@ -116,11 +126,20 @@
      UserModel returnedUser = null;
      UserModel user = getUserModel(username);
      if (user.password.startsWith(StringUtils.MD5_TYPE)) {
         // password digest
         String md5 = StringUtils.MD5_TYPE + StringUtils.getMD5(new String(password));
         if (user.password.equalsIgnoreCase(md5)) {
            returnedUser = user;
         }
      } else if (user.password.startsWith(StringUtils.COMBINED_MD5_TYPE)) {
         // username+password digest
         String md5 = StringUtils.COMBINED_MD5_TYPE
               + StringUtils.getMD5(username.toLowerCase() + new String(password));
         if (user.password.equalsIgnoreCase(md5)) {
            returnedUser = user;
         }
      } else if (user.password.equals(new String(password))) {
         // plain-text password
         returnedUser = user;
      }
      return returnedUser;