From f76fee63ed9cb3a30d3c0c092d860b1cb93a481b Mon Sep 17 00:00:00 2001
From: Gerard Smyth <gerard.smyth@gmail.com>
Date: Thu, 08 May 2014 13:09:30 -0400
Subject: [PATCH] Updated the SyndicationServlet to provide an additional option to return details of the tags in the repository instead of the commits. This uses a new 'ot' request parameter to indicate the object type of the content to return, which can be ither TAG or COMMIT. If this is not provided, then COMMIT is assumed to maintain backwards compatability. If tags are returned, then the paging parameters, 'l' and 'pg' are still supported, but searching options are currently ignored.

---
 src/main/java/com/gitblit/wicket/pages/EditUserPage.java |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/main/java/com/gitblit/wicket/pages/EditUserPage.java b/src/main/java/com/gitblit/wicket/pages/EditUserPage.java
index b2d3d3b..b9a8480 100644
--- a/src/main/java/com/gitblit/wicket/pages/EditUserPage.java
+++ b/src/main/java/com/gitblit/wicket/pages/EditUserPage.java
@@ -54,10 +54,6 @@
 	public EditUserPage() {
 		// create constructor
 		super();
-		if (!app().users().supportsAddUser()) {
-			error(MessageFormat.format(getString("gb.userServiceDoesNotPermitAddUser"),
-					app().settings().getString(Keys.realm.userService, "${baseFolder}/users.conf")), true);
-		}
 		isCreate = true;
 		setupPage(new UserModel(""));
 		setStatelessHint(false);
@@ -138,7 +134,7 @@
 				}
 				boolean rename = !StringUtils.isEmpty(oldName)
 						&& !oldName.equalsIgnoreCase(username);
-				if (app().users().supportsCredentialChanges(userModel)) {
+				if (app().authentication().supportsCredentialChanges(userModel)) {
 					if (!userModel.password.equals(confirmPassword.getObject())) {
 						error(getString("gb.passwordsDoNotMatch"));
 						return;
@@ -157,6 +153,9 @@
 									minLength));
 							return;
 						}
+
+						// change the cookie
+						userModel.cookie = StringUtils.getSHA1(userModel.username + password);
 
 						// Optionally store the password MD5 digest.
 						String type = app().settings().getString(Keys.realm.passwordStorage, "md5");
@@ -192,7 +191,11 @@
 				}
 
 				try {
-					app().gitblit().updateUserModel(oldName, userModel, isCreate);
+					if (isCreate) {
+						app().gitblit().addUser(userModel);
+					} else {
+						app().gitblit().reviseUser(oldName, userModel);
+					}
 				} catch (GitBlitException e) {
 					error(e.getMessage());
 					return;
@@ -214,16 +217,16 @@
 		form.add(new SimpleAttributeModifier("autocomplete", "off"));
 
 		// not all user services support manipulating username and password
-		boolean editCredentials = app().users().supportsCredentialChanges(userModel);
+		boolean editCredentials = app().authentication().supportsCredentialChanges(userModel);
 
 		// not all user services support manipulating display name
-		boolean editDisplayName = app().users().supportsDisplayNameChanges(userModel);
+		boolean editDisplayName = app().authentication().supportsDisplayNameChanges(userModel);
 
 		// not all user services support manipulating email address
-		boolean editEmailAddress = app().users().supportsEmailAddressChanges(userModel);
+		boolean editEmailAddress = app().authentication().supportsEmailAddressChanges(userModel);
 
 		// not all user services support manipulating team memberships
-		boolean editTeams = app().users().supportsTeamMembershipChanges(userModel);
+		boolean editTeams = app().authentication().supportsTeamMembershipChanges(userModel);
 
 		// field names reflective match UserModel fields
 		form.add(new TextField<String>("username").setEnabled(editCredentials));
@@ -240,6 +243,8 @@
 		form.add(new CheckBox("canFork").setEnabled(app().settings().getBoolean(Keys.web.allowForking, true)));
 		form.add(new CheckBox("canCreate"));
 		form.add(new CheckBox("excludeFromFederation"));
+		form.add(new CheckBox("disabled"));
+
 		form.add(new RegistrantPermissionsPanel("repositories",	RegistrantType.REPOSITORY, repos, permissions, getAccessPermissions()));
 		form.add(teams.setEnabled(editTeams));
 

--
Gitblit v1.9.1