From 63c5be4709d49f564a601b955c3bd4a423f54597 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 20 Jun 2026 11:15:01 -0700 Subject: [PATCH 1/3] Remove "inactive users" link from Project Users grid --- core/src/org/labkey/core/user/UserController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/org/labkey/core/user/UserController.java b/core/src/org/labkey/core/user/UserController.java index 7e493474997..8f108fcbcfd 100644 --- a/core/src/org/labkey/core/user/UserController.java +++ b/core/src/org/labkey/core/user/UserController.java @@ -817,9 +817,13 @@ protected ModelAndView getHtmlView(ShowUsersForm form, BindException errors) users.setTitle("Users"); users.setFrame(WebPartView.FrameType.PORTAL); - JspView toggleInactiveView = new JspView<>("/org/labkey/core/user/toggleInactive.jsp", form); + // GitHub Issue #1232 - inactive users have no permissions so they'll never appear in the "Project Users" grid + if (getContainer().isRoot()) + { + JspView toggleInactiveView = new JspView<>("/org/labkey/core/user/toggleInactive.jsp", form); + users.addView(toggleInactiveView); + } - users.addView(toggleInactiveView); users.addView(createQueryView(form, errors, false, "Users")); return users; From 884a9dec088508b03bc47776eee8702c99ce4ff8 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 20 Jun 2026 18:11:27 -0700 Subject: [PATCH 2/3] Address feedback --- .../org/labkey/core/user/UserController.java | 9 +- ...toggleInactive.jsp => usersGridHeader.jsp} | 169 +++++++++--------- 2 files changed, 84 insertions(+), 94 deletions(-) rename core/src/org/labkey/core/user/{toggleInactive.jsp => usersGridHeader.jsp} (83%) diff --git a/core/src/org/labkey/core/user/UserController.java b/core/src/org/labkey/core/user/UserController.java index 8f108fcbcfd..f5bddcfcff1 100644 --- a/core/src/org/labkey/core/user/UserController.java +++ b/core/src/org/labkey/core/user/UserController.java @@ -816,14 +816,7 @@ protected ModelAndView getHtmlView(ShowUsersForm form, BindException errors) VBox users = new VBox(); users.setTitle("Users"); users.setFrame(WebPartView.FrameType.PORTAL); - - // GitHub Issue #1232 - inactive users have no permissions so they'll never appear in the "Project Users" grid - if (getContainer().isRoot()) - { - JspView toggleInactiveView = new JspView<>("/org/labkey/core/user/toggleInactive.jsp", form); - users.addView(toggleInactiveView); - } - + users.addView(new JspView<>("/org/labkey/core/user/usersGridHeader.jsp", form)); users.addView(createQueryView(form, errors, false, "Users")); return users; diff --git a/core/src/org/labkey/core/user/toggleInactive.jsp b/core/src/org/labkey/core/user/usersGridHeader.jsp similarity index 83% rename from core/src/org/labkey/core/user/toggleInactive.jsp rename to core/src/org/labkey/core/user/usersGridHeader.jsp index 36515f5ec63..e06dae34ec6 100644 --- a/core/src/org/labkey/core/user/toggleInactive.jsp +++ b/core/src/org/labkey/core/user/usersGridHeader.jsp @@ -1,86 +1,83 @@ -<% -/* - * Copyright (c) 2008-2026 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -%> -<%@ page import="org.labkey.api.security.AuthenticationManager" %> -<%@ page import="org.labkey.api.view.ActionURL" %> -<%@ page import="org.labkey.api.view.HttpView" %> -<%@ page import="org.labkey.core.user.LimitActiveUsersSettings" %> -<%@ page import="org.labkey.core.user.UserController" %> -<%@ page extends="org.labkey.api.jsp.JspBase" %> -<% - String inactiveCaption; - String temporaryCaption; - UserController.ShowUsersForm form = (UserController.ShowUsersForm) HttpView.currentModel(); - ActionURL inactiveUrl = getViewContext().cloneActionURL(); - ActionURL temporaryUrl = getViewContext().cloneActionURL(); - - if (!form.isInactive()) - { - inactiveUrl.addParameter("inactive", true); - inactiveCaption = "include inactive users"; - } - else - { - inactiveUrl.deleteParameter("inactive"); - inactiveCaption = "hide inactive users"; - } - - if (!form.isTemporary()) - { - temporaryUrl.addParameter("temporary", true); - temporaryCaption = "show temporary accounts"; - } - else - { - temporaryUrl.deleteParameter("temporary"); - temporaryCaption = "show all accounts"; - } - - boolean showTemporaryLink = getContainer().isRoot() && AuthenticationManager.isAccountExpirationEnabled(); -%> - - <% - LimitActiveUsersSettings settings = new LimitActiveUsersSettings(); - - if (settings.isUserLimit()) - { - %> - - - <% - } - %> - - - - - - <% if (showTemporaryLink) - { - %> - - - - <% - } - %> - -
Number of users that can be added<%=h(getContainer().isRoot() ? " or reactivated" : "")%>: <%=settings.getRemainingUserCount()%>
 
- <%=link(inactiveCaption, inactiveUrl)%> -
- <%=link(temporaryCaption, temporaryUrl)%> -
+<% +/* + * Copyright (c) 2008-2026 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +%> +<%@ page import="org.labkey.api.security.AuthenticationManager" %> +<%@ page import="org.labkey.api.view.ActionURL" %> +<%@ page import="org.labkey.api.view.HttpView" %> +<%@ page import="org.labkey.core.user.LimitActiveUsersSettings" %> +<%@ page import="org.labkey.core.user.UserController" %> +<%@ page extends="org.labkey.api.jsp.JspBase" %> +<% + String inactiveCaption; + String temporaryCaption; + UserController.ShowUsersForm form = (UserController.ShowUsersForm) HttpView.currentModel(); + ActionURL inactiveUrl = getViewContext().cloneActionURL(); + ActionURL temporaryUrl = getViewContext().cloneActionURL(); + + if (!form.isInactive()) + { + inactiveUrl.addParameter("inactive", true); + inactiveCaption = "include inactive users"; + } + else + { + inactiveUrl.deleteParameter("inactive"); + inactiveCaption = "hide inactive users"; + } + + if (!form.isTemporary()) + { + temporaryUrl.addParameter("temporary", true); + temporaryCaption = "show temporary accounts"; + } + else + { + temporaryUrl.deleteParameter("temporary"); + temporaryCaption = "show all accounts"; + } +%> + + <% + LimitActiveUsersSettings settings = new LimitActiveUsersSettings(); + + if (settings.isUserLimit()) + { + %> + + + <% + } + + if (getContainer().isRoot()) + { + %> + + + + <% + if (AuthenticationManager.isAccountExpirationEnabled()) + { + %> + + + + <% + } + } + %> + +
Number of users that can be added<%=h(getContainer().isRoot() ? " or reactivated" : "")%>: <%=settings.getRemainingUserCount()%>
 
<%=link(inactiveCaption, inactiveUrl)%>
<%=link(temporaryCaption, temporaryUrl)%>
From 2f844fd7ebf396e86445b42dcad9e06482ebd31c Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Sat, 20 Jun 2026 18:20:33 -0700 Subject: [PATCH 3/3] Do the root stuff under the isRoot() check --- .../org/labkey/core/user/usersGridHeader.jsp | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/core/src/org/labkey/core/user/usersGridHeader.jsp b/core/src/org/labkey/core/user/usersGridHeader.jsp index e06dae34ec6..83325bd9789 100644 --- a/core/src/org/labkey/core/user/usersGridHeader.jsp +++ b/core/src/org/labkey/core/user/usersGridHeader.jsp @@ -21,35 +21,6 @@ <%@ page import="org.labkey.core.user.LimitActiveUsersSettings" %> <%@ page import="org.labkey.core.user.UserController" %> <%@ page extends="org.labkey.api.jsp.JspBase" %> -<% - String inactiveCaption; - String temporaryCaption; - UserController.ShowUsersForm form = (UserController.ShowUsersForm) HttpView.currentModel(); - ActionURL inactiveUrl = getViewContext().cloneActionURL(); - ActionURL temporaryUrl = getViewContext().cloneActionURL(); - - if (!form.isInactive()) - { - inactiveUrl.addParameter("inactive", true); - inactiveCaption = "include inactive users"; - } - else - { - inactiveUrl.deleteParameter("inactive"); - inactiveCaption = "hide inactive users"; - } - - if (!form.isTemporary()) - { - temporaryUrl.addParameter("temporary", true); - temporaryCaption = "show temporary accounts"; - } - else - { - temporaryUrl.deleteParameter("temporary"); - temporaryCaption = "show all accounts"; - } -%> <% LimitActiveUsersSettings settings = new LimitActiveUsersSettings(); @@ -64,6 +35,35 @@ if (getContainer().isRoot()) { + UserController.ShowUsersForm form = (UserController.ShowUsersForm) HttpView.currentModel(); + + String inactiveCaption; + String temporaryCaption; + + ActionURL inactiveUrl = getViewContext().cloneActionURL(); + ActionURL temporaryUrl = getViewContext().cloneActionURL(); + + if (!form.isInactive()) + { + inactiveUrl.addParameter("inactive", true); + inactiveCaption = "include inactive users"; + } + else + { + inactiveUrl.deleteParameter("inactive"); + inactiveCaption = "hide inactive users"; + } + + if (!form.isTemporary()) + { + temporaryUrl.addParameter("temporary", true); + temporaryCaption = "show temporary accounts"; + } + else + { + temporaryUrl.deleteParameter("temporary"); + temporaryCaption = "show all accounts"; + } %>
<%=link(inactiveCaption, inactiveUrl)%>