Use anonymous usermodel in a few places
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public static final UserModel ANONYMOUS = new UserModel("anonymous", false);
|
| | | public static final UserModel ANONYMOUS = new UserModel();
|
| | |
|
| | | // field names are reflectively mapped in EditUser page
|
| | | public String username;
|
| | |
| | | this.isAuthenticated = true;
|
| | | }
|
| | |
|
| | | private UserModel(String username, boolean authenticated) {
|
| | | this.username = username;
|
| | | this.isAuthenticated = authenticated;
|
| | | private UserModel() {
|
| | | this.username = "anonymous";
|
| | | this.isAuthenticated = false;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | add(new Label("pageName", pageName).setRenderBodyOnly(true));
|
| | |
|
| | | UserModel user = GitBlitWebSession.get().getUser();
|
| | | if (user == null) {
|
| | | user = UserModel.ANONYMOUS;
|
| | | }
|
| | |
|
| | | // indicate origin repository
|
| | | RepositoryModel model = getRepositoryModel();
|
| | |
| | | }
|
| | |
|
| | | // fork controls
|
| | | if (!allowForkControls() || user == null) {
|
| | | if (!allowForkControls() || user == null || !user.isAuthenticated) {
|
| | | // must be logged-in to fork, hide all fork controls
|
| | | add(new ExternalLink("forkLink", "").setVisible(false));
|
| | | add(new ExternalLink("myForkLink", "").setVisible(false));
|