- Implemented multiple repository owners\r
- Chinese translation\r
- Added weblogic.xml to WAR for deployment on WebLogic (issue 199)\r
+ - Support username substitution in web.otherUrls (issue 213)\r
- Option to force client-side basic authentication instead of form-based authentication if web.authenticateViewPages=true (issue 222)\r
\r
contributors:\r
web.forwardSlashCharacter = /\r
\r
# Show other URLs on the summary page for accessing your git repositories\r
-# Use spaces to separate urls. {0} is the token for the repository name.\r
+# Use spaces to separate urls.\r
+#\r
+# {0} is the token for the repository name\r
+# {1} is the token for the username\r
+#\r
+# The username is only practical if you have setup your other git serving\r
+# solutions accounts to have the same username as the Gitblit account.\r
+#\r
# e.g.\r
-# web.otherUrls = ssh://localhost/git/{0} git://localhost/git/{0}\r
+# web.otherUrls = ssh://localhost/git/{0} git://localhost/git/{0} https://{1}@localhost/r/{0}\r
#\r
# SPACE-DELIMITED\r
# SINCE 0.5.0\r
* advertise alternative urls for Git client repository access.\r
* \r
* @param repositoryName\r
+ * @param userName\r
* @return list of non-gitblit clone urls\r
*/\r
- public List<String> getOtherCloneUrls(String repositoryName) {\r
+ public List<String> getOtherCloneUrls(String repositoryName, String username) {\r
List<String> cloneUrls = new ArrayList<String>();\r
for (String url : settings.getStrings(Keys.web.otherUrls)) {\r
- cloneUrls.add(MessageFormat.format(url, repositoryName));\r
+ cloneUrls.add(MessageFormat.format(url, repositoryName, username));\r
}\r
return cloneUrls;\r
}\r
import com.gitblit.GitBlit;\r
import com.gitblit.Keys;\r
import com.gitblit.models.RepositoryModel;\r
+import com.gitblit.models.UserModel;\r
import com.gitblit.utils.ArrayUtils;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.GitblitRedirectException;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.RepositoryUrlPanel;\r
// add the Gitblit repository url\r
repositoryUrls.add(getRepositoryUrl(repository));\r
}\r
- repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName));\r
+ UserModel user = GitBlitWebSession.get().getUser();\r
+ repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName, user == null ? "" : user.username));\r
\r
String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.get(0);\r
add(new Label("repository", repositoryName));\r
import com.gitblit.utils.JGitUtils;\r
import com.gitblit.utils.MarkdownUtils;\r
import com.gitblit.utils.StringUtils;\r
+import com.gitblit.wicket.GitBlitWebSession;\r
import com.gitblit.wicket.WicketUtils;\r
import com.gitblit.wicket.panels.BranchesPanel;\r
import com.gitblit.wicket.panels.LinkPanel;\r
\r
Repository r = getRepository();\r
RepositoryModel model = getRepositoryModel();\r
+ UserModel user = GitBlitWebSession.get().getUser();\r
\r
List<Metric> metrics = null;\r
Metric metricsTotal = null;\r
} else {\r
add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));\r
}\r
- repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName));\r
+ repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(repositoryName, user == null ? "" : user.username));\r
\r
String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.remove(0);\r
add(new RepositoryUrlPanel("repositoryCloneUrl", primaryUrl));\r
// add the Gitblit repository url\r
repositoryUrls.add(BasePage.getRepositoryUrl(entry));\r
}\r
- repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(entry.name));\r
+ repositoryUrls.addAll(GitBlit.self().getOtherCloneUrls(entry.name, user == null ? "" : user.username));\r
\r
String primaryUrl = ArrayUtils.isEmpty(repositoryUrls) ? "" : repositoryUrls.remove(0);\r
add(new RepositoryUrlPanel("repositoryCloneUrl", primaryUrl));\r