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