mschaefers
2012-12-04 428b2244aadeb4724e705044d73ac74be724f6e9
Merged and enhanced pull request #55 (disallow forks setting)
5 files modified
23 ■■■■■ changed files
distrib/gitblit.properties 8 ●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/EditRepositoryPage.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/EditTeamPage.java 3 ●●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/EditUserPage.java 2 ●●● patch | view | raw | blame | history
src/com/gitblit/wicket/pages/RepositoryPage.java 8 ●●●●● patch | view | raw | blame | history
distrib/gitblit.properties
@@ -504,6 +504,12 @@
# 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 @@
#
# SINCE 0.5.0
# RESTART REQUIRED
server.shutdownPort = 8081
server.shutdownPort = 8081
src/com/gitblit/wicket/pages/EditRepositoryPage.java
@@ -379,7 +379,7 @@
        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);
src/com/gitblit/wicket/pages/EditTeamPage.java
@@ -38,6 +38,7 @@
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 @@
        // 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 ? ""
src/com/gitblit/wicket/pages/EditUserPage.java
@@ -233,7 +233,7 @@
        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()));
src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -154,7 +154,9 @@
        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 @@
    }
    
    protected boolean allowForkControls() {
        return true;
        return GitBlit.getBoolean(Keys.web.allowForking, true);
    }
    @Override
@@ -597,4 +599,4 @@
            getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
        }
    }
}
}