| | |
| | | boolean authenticateView = app().settings().getBoolean(Keys.web.authenticateViewPages, false);
|
| | | boolean authenticateAdmin = app().settings().getBoolean(Keys.web.authenticateAdminPages, true);
|
| | | boolean allowAdmin = app().settings().getBoolean(Keys.web.allowAdministration, true);
|
| | | boolean allowLucene = app().settings().getBoolean(Keys.web.allowLuceneIndexing, true);
|
| | | boolean isLoggedIn = GitBlitWebSession.get().isLoggedIn();
|
| | |
|
| | | if (authenticateAdmin) {
|
| | | showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();
|
| | |
| | | }
|
| | |
|
| | | if (authenticateView || authenticateAdmin) {
|
| | | if (GitBlitWebSession.get().isLoggedIn()) {
|
| | | if (isLoggedIn) {
|
| | | UserMenu userFragment = new UserMenu("userPanel", "userMenuFragment", RootPage.this);
|
| | | add(userFragment);
|
| | | } else {
|
| | |
| | |
|
| | | // navigation links
|
| | | List<PageRegistration> pages = new ArrayList<PageRegistration>();
|
| | | if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
|
| | | pages.add(new PageRegistration(GitBlitWebSession.get().isLoggedIn() ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
|
| | | if (!authenticateView || (authenticateView && isLoggedIn)) {
|
| | | pages.add(new PageRegistration(isLoggedIn ? "gb.myDashboard" : "gb.dashboard", MyDashboardPage.class,
|
| | | getRootPageParameters()));
|
| | | pages.add(new PageRegistration("gb.repositories", RepositoriesPage.class,
|
| | | getRootPageParameters()));
|
| | | pages.add(new PageRegistration("gb.activity", ActivityPage.class, getRootPageParameters()));
|
| | | if (app().settings().getBoolean(Keys.web.allowLuceneIndexing, true)) {
|
| | | if(isLoggedIn)
|
| | | {
|
| | | pages.add(new PageRegistration("gb.mytickets", MyTicketsPage.class, getRootPageParameters()));
|
| | | }
|
| | | if (allowLucene) {
|
| | | pages.add(new PageRegistration("gb.search", LuceneSearchPage.class));
|
| | | }
|
| | | if (showAdmin) {
|
| | |
| | | pages.add(new PageRegistration("gb.federation", FederationPage.class));
|
| | | }
|
| | |
|
| | | if (!authenticateView || (authenticateView && GitBlitWebSession.get().isLoggedIn())) {
|
| | | if (!authenticateView || (authenticateView && isLoggedIn)) {
|
| | | addDropDownMenus(pages);
|
| | | }
|
| | | }
|
| | |
| | | // Set Cookie
|
| | | if (app().settings().getBoolean(Keys.web.allowCookieAuthentication, false)) {
|
| | | WebResponse response = (WebResponse) getRequestCycle().getResponse();
|
| | | app().session().setCookie(response, user);
|
| | | app().authentication().setCookie(response.getHttpServletResponse(), user);
|
| | | }
|
| | |
|
| | | if (!session.continueRequest()) {
|
| | |
| | | String username = RootPage.this.username.getObject();
|
| | | char[] password = RootPage.this.password.getObject().toCharArray();
|
| | |
|
| | | UserModel user = app().session().authenticate(username, password);
|
| | | UserModel user = app().authentication().authenticate(username, password);
|
| | | if (user == null) {
|
| | | error(getString("gb.invalidUsernameOrPassword"));
|
| | | } else if (user.username.equals(Constants.FEDERATION_USER)) {
|
| | |
| | |
|
| | | GitBlitWebSession session = GitBlitWebSession.get();
|
| | | UserModel user = session.getUser();
|
| | | boolean editCredentials = app().users().supportsCredentialChanges(user);
|
| | | boolean editCredentials = app().authentication().supportsCredentialChanges(user);
|
| | | boolean standardLogin = session.authenticationType.isStandard();
|
| | |
|
| | | if (app().settings().getBoolean(Keys.web.allowGravatar, true)) {
|
| | | add(new GravatarImage("username", user.getDisplayName(),
|
| | | user.emailAddress, "navbarGravatar", 20, false, false));
|
| | | add(new GravatarImage("username", user, "navbarGravatar", 20, false));
|
| | | } else {
|
| | | add(new Label("username", user.getDisplayName()));
|
| | | }
|