From 1be31659e7e92c0fdc32e629d059d2aed5fe3a63 Mon Sep 17 00:00:00 2001
From: Rafael Cavazin <rafaelcavazin@gmail.com>
Date: Sun, 21 Jul 2013 11:12:11 -0400
Subject: [PATCH] Translation of lastest Strings up-do-date. Tradução das últimas Strings até a data atual.

---
 src/main/java/com/gitblit/GitBlit.java |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/gitblit/GitBlit.java b/src/main/java/com/gitblit/GitBlit.java
index 6f2f70c..efdaad1 100644
--- a/src/main/java/com/gitblit/GitBlit.java
+++ b/src/main/java/com/gitblit/GitBlit.java
@@ -84,6 +84,7 @@
 
 import com.gitblit.Constants.AccessPermission;
 import com.gitblit.Constants.AccessRestrictionType;
+import com.gitblit.Constants.AccountType;
 import com.gitblit.Constants.AuthenticationType;
 import com.gitblit.Constants.AuthorizationControl;
 import com.gitblit.Constants.FederationRequest;
@@ -230,6 +231,33 @@
 			new GitBlit();
 		}
 		return gitblit;
+	}
+	
+	/**
+	 * Returns the boot date of the Gitblit server.
+	 * 
+	 * @return the boot date of Gitblit
+	 */
+	public static Date getBootDate() {
+		return self().serverStatus.bootDate;
+	}
+	
+	/**
+	 * Returns the most recent change date of any repository served by Gitblit.
+	 * 
+	 * @return a date
+	 */
+	public static Date getLastActivityDate() {
+		Date date = null;
+		for (String name : self().getRepositoryList()) {
+			Repository r = self().getRepository(name);
+			Date lastChange = JGitUtils.getLastChange(r).when;
+			r.close();
+			if (lastChange != null && (date == null || lastChange.after(date))) {
+				date = lastChange;
+			}
+		}
+		return date;
 	}
 
 	/**
@@ -695,12 +723,12 @@
 	public boolean supportsCredentialChanges(UserModel user) {
 		if (user == null) {
 			return false;
-		} else if (!Constants.EXTERNAL_ACCOUNT.equals(user.password)) {
-			// credentials likely maintained by Gitblit
-			return userService.supportsCredentialChanges();
+		} else if (AccountType.LOCAL.equals(user.accountType)) {
+			// local account, we can change credentials
+			return true;
 		} else {
-			// credentials are externally maintained
-			return false;
+			// external account, ask user service
+			return userService.supportsCredentialChanges();
 		}
 	}
 
@@ -2052,6 +2080,9 @@
 					File repoFolder = new File(getRepositoriesFolder(), originRepo);
 					if (repoFolder.exists()) {
 						model.originRepository = originRepo.toLowerCase();
+						
+						// persist the fork origin
+						updateConfiguration(r, model);
 					}
 				}
 			} catch (URISyntaxException e) {

--
Gitblit v1.9.1