# SINCE 0.9.0\r
web.allowLuceneIndexing = true\r
\r
+# Allows an authenticated user to create forks of a repository\r
+#\r
+# set this to false if you want to disable all fork controls on the web site\r
+#\r
+web.allowForking = true\r
+\r
# Controls the length of shortened commit hash ids\r
#\r
# SINCE 1.2.0\r
#\r
# SINCE 0.5.0\r
# RESTART REQUIRED\r
-server.shutdownPort = 8081
\ No newline at end of file
+server.shutdownPort = 8081\r
form.add(new TextField<String>("description"));\r
form.add(new DropDownChoice<String>("owner", GitBlit.self().getAllUsernames())\r
.setEnabled(GitBlitWebSession.get().canAdmin() && !repositoryModel.isPersonalRepository()));\r
- form.add(new CheckBox("allowForks"));\r
+ form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));\r
DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction", Arrays\r
.asList(AccessRestrictionType.values()), new AccessRestrictionRenderer());\r
form.add(accessRestriction);\r
\r
import com.gitblit.GitBlit;\r
import com.gitblit.GitBlitException;\r
+import com.gitblit.Keys;\r
import com.gitblit.Constants.RegistrantType;\r
import com.gitblit.models.RegistrantAccessPermission;\r
import com.gitblit.models.TeamModel;\r
// field names reflective match TeamModel fields\r
form.add(new TextField<String>("name"));\r
form.add(new CheckBox("canAdmin"));\r
- form.add(new CheckBox("canFork"));\r
+ form.add(new CheckBox("canFork").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));\r
form.add(new CheckBox("canCreate"));\r
form.add(users.setEnabled(editMemberships));\r
mailingLists = new Model<String>(teamModel.mailingLists == null ? ""\r
form.add(new TextField<String>("displayName").setEnabled(editDisplayName));\r
form.add(new TextField<String>("emailAddress").setEnabled(editEmailAddress));\r
form.add(new CheckBox("canAdmin"));\r
- form.add(new CheckBox("canFork"));\r
+ form.add(new CheckBox("canFork").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true)));\r
form.add(new CheckBox("canCreate"));\r
form.add(new CheckBox("excludeFromFederation"));\r
form.add(new RegistrantPermissionsPanel("repositories", RegistrantType.REPOSITORY, repos, permissions, getAccessPermissions()));\r
pages.put("branches", new PageRegistration("gb.branches", BranchesPage.class, params));\r
pages.put("tags", new PageRegistration("gb.tags", TagsPage.class, params));\r
pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params));\r
- pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params));\r
+ if (GitBlit.getBoolean(Keys.web.allowForking, true)) {\r
+ pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params));\r
+ }\r
\r
// conditional links\r
Repository r = getRepository();\r
}\r
\r
protected boolean allowForkControls() {\r
- return true;\r
+ return GitBlit.getBoolean(Keys.web.allowForking, true);\r
}\r
\r
@Override\r
getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));\r
}\r
}\r
-}
+}\r