John Crygier
2012-05-07 022ebb4010ecf91ef5049f0386ef398f1d7fb32b
src/com/gitblit/GitBlit.java
@@ -388,6 +388,22 @@
   /**
    * 
    * @return true if the user service supports display name changes
    */
   public boolean supportsDisplayNameChanges() {
      return userService.supportsDisplayNameChanges();
   }
   /**
    *
    * @return true if the user service supports email address changes
    */
   public boolean supportsEmailAddressChanges() {
      return userService.supportsEmailAddressChanges();
   }
   /**
    *
    * @return true if the user service supports team membership changes
    */
   public boolean supportsTeamMembershipChanges() {
@@ -480,6 +496,18 @@
         userCookie.setPath("/");
         response.addCookie(userCookie);
      }
   }
   /**
    * Logout a user.
    *
    * @param user
    */
   public void logout(UserModel user) {
      if (userService == null) {
         return;
      }
      userService.logout(user);
   }
   /**
@@ -829,6 +857,12 @@
               "gitblit", null, "mailingList")));
         model.indexedBranches = new ArrayList<String>(Arrays.asList(config.getStringList(
               "gitblit", null, "indexBranch")));
         // Custom defined properties
         model.customFields = new HashMap<String, String>();
         for (String aProperty : config.getNames(Constants.CUSTOM_FIELDS_PROP_SECTION, Constants.CUSTOM_FIELDS_PROP_SUBSECTION)) {
            model.customFields.put(aProperty, config.getString(Constants.CUSTOM_FIELDS_PROP_SECTION, Constants.CUSTOM_FIELDS_PROP_SUBSECTION, aProperty));
         }
      }
      model.HEAD = JGitUtils.getHEADRef(r);
      model.availableRefs = JGitUtils.getAvailableHeadTargets(r);
@@ -1075,6 +1109,11 @@
      updateList(config, "postReceiveScript", repository.postReceiveScripts);
      updateList(config, "mailingList", repository.mailingLists);
      updateList(config, "indexBranch", repository.indexedBranches);
      // User Defined Properties
      for (Entry<String, String> singleProperty : repository.customFields.entrySet()) {
         config.setString(Constants.CUSTOM_FIELDS_PROP_SECTION, Constants.CUSTOM_FIELDS_PROP_SUBSECTION, singleProperty.getKey(), singleProperty.getValue());
      }
      try {
         config.save();
@@ -1768,6 +1807,10 @@
    */
   private ServerSettings loadSettingModels() {
      ServerSettings settingsModel = new ServerSettings();
      settingsModel.supportsCredentialChanges = userService.supportsCredentialChanges();
      settingsModel.supportsDisplayNameChanges = userService.supportsDisplayNameChanges();
      settingsModel.supportsEmailAddressChanges = userService.supportsEmailAddressChanges();
      settingsModel.supportsTeamMembershipChanges = userService.supportsTeamMembershipChanges();
      try {
         // Read bundled Gitblit properties to extract setting descriptions.
         // This copy is pristine and only used for populating the setting