public UserFragment(String id, String markupId, MarkupContainer markupProvider) {\r
super(id, markupId, markupProvider);\r
\r
- if (GitBlitWebSession.get().isLoggedIn()) {\r
+ GitBlitWebSession session = GitBlitWebSession.get();\r
+ if (session.isLoggedIn()) { \r
+ UserModel user = session.getUser();\r
+ boolean editCredentials = GitBlit.self().supportsCredentialChanges();\r
+ boolean standardLogin = session.authenticationType.isStandard();\r
+\r
// username, logout, and change password\r
- add(new Label("username", GitBlitWebSession.get().getUser().getDisplayName() + ":"));\r
+ add(new Label("username", user.getDisplayName() + ":"));\r
add(new LinkPanel("loginLink", null, markupProvider.getString("gb.logout"),\r
- LogoutPage.class));\r
- boolean editCredentials = GitBlit.self().supportsCredentialChanges();\r
+ LogoutPage.class).setVisible(standardLogin));\r
+ \r
// quick and dirty hack for showing a separator\r
- add(new Label("separator", "|").setVisible(editCredentials));\r
+ add(new Label("separator", "|").setVisible(standardLogin && editCredentials));\r
add(new BookmarkablePageLink<Void>("changePasswordLink", \r
ChangePasswordPage.class).setVisible(editCredentials));\r
} else {\r