@@ -504,6 +504,12 @@ web.compressedDownloads = zip gz | |||
# SINCE 0.9.0 | |||
web.allowLuceneIndexing = true | |||
# Allows an authenticated user to create forks of a repository | |||
# | |||
# set this to false if you want to disable all fork controls on the web site | |||
# | |||
web.allowForking = true | |||
# Controls the length of shortened commit hash ids | |||
# | |||
# SINCE 1.2.0 | |||
@@ -1179,4 +1185,4 @@ server.requireClientCertificates = false | |||
# | |||
# SINCE 0.5.0 | |||
# RESTART REQUIRED | |||
server.shutdownPort = 8081 | |||
server.shutdownPort = 8081 |
@@ -379,7 +379,7 @@ public class EditRepositoryPage extends RootSubPage { | |||
form.add(new TextField<String>("description")); | |||
form.add(new DropDownChoice<String>("owner", GitBlit.self().getAllUsernames()) | |||
.setEnabled(GitBlitWebSession.get().canAdmin() && !repositoryModel.isPersonalRepository())); | |||
form.add(new CheckBox("allowForks")); | |||
form.add(new CheckBox("allowForks").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true))); | |||
DropDownChoice<AccessRestrictionType> accessRestriction = new DropDownChoice<AccessRestrictionType>("accessRestriction", Arrays | |||
.asList(AccessRestrictionType.values()), new AccessRestrictionRenderer()); | |||
form.add(accessRestriction); |
@@ -38,6 +38,7 @@ import org.apache.wicket.model.util.ListModel; | |||
import com.gitblit.GitBlit; | |||
import com.gitblit.GitBlitException; | |||
import com.gitblit.Keys; | |||
import com.gitblit.Constants.RegistrantType; | |||
import com.gitblit.models.RegistrantAccessPermission; | |||
import com.gitblit.models.TeamModel; | |||
@@ -216,7 +217,7 @@ public class EditTeamPage extends RootSubPage { | |||
// field names reflective match TeamModel fields | |||
form.add(new TextField<String>("name")); | |||
form.add(new CheckBox("canAdmin")); | |||
form.add(new CheckBox("canFork")); | |||
form.add(new CheckBox("canFork").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true))); | |||
form.add(new CheckBox("canCreate")); | |||
form.add(users.setEnabled(editMemberships)); | |||
mailingLists = new Model<String>(teamModel.mailingLists == null ? "" |
@@ -233,7 +233,7 @@ public class EditUserPage extends RootSubPage { | |||
form.add(new TextField<String>("displayName").setEnabled(editDisplayName)); | |||
form.add(new TextField<String>("emailAddress").setEnabled(editEmailAddress)); | |||
form.add(new CheckBox("canAdmin")); | |||
form.add(new CheckBox("canFork")); | |||
form.add(new CheckBox("canFork").setEnabled(GitBlit.getBoolean(Keys.web.allowForking, true))); | |||
form.add(new CheckBox("canCreate")); | |||
form.add(new CheckBox("excludeFromFederation")); | |||
form.add(new RegistrantPermissionsPanel("repositories", RegistrantType.REPOSITORY, repos, permissions, getAccessPermissions())); |
@@ -154,7 +154,9 @@ public abstract class RepositoryPage extends BasePage { | |||
pages.put("branches", new PageRegistration("gb.branches", BranchesPage.class, params)); | |||
pages.put("tags", new PageRegistration("gb.tags", TagsPage.class, params)); | |||
pages.put("tree", new PageRegistration("gb.tree", TreePage.class, params)); | |||
pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params)); | |||
if (GitBlit.getBoolean(Keys.web.allowForking, true)) { | |||
pages.put("forks", new PageRegistration("gb.forks", ForksPage.class, params)); | |||
} | |||
// conditional links | |||
Repository r = getRepository(); | |||
@@ -191,7 +193,7 @@ public abstract class RepositoryPage extends BasePage { | |||
} | |||
protected boolean allowForkControls() { | |||
return true; | |||
return GitBlit.getBoolean(Keys.web.allowForking, true); | |||
} | |||
@Override | |||
@@ -597,4 +599,4 @@ public abstract class RepositoryPage extends BasePage { | |||
getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl)); | |||
} | |||
} | |||
} | |||
} |