Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/org/labkey/targetedms/TargetedMSController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4461,13 +4461,20 @@ public String getDataRegionNameSmallMolecule()
@NotNull
private static HtmlView getLoginView(ViewContext context, Container container)
{
ActionURL registerUrl = new ActionURL("login", "register", container);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened a PR to expose this via LoginUrls. Please switch to use that.

LabKey/platform#7372

registerUrl.addReturnUrl(context.getActionURL());

return new HtmlView(DOM.createHtmlFragment(
DOM.DIV(cl("alert alert-info"),
"Please ",
DOM.A(at(style, "font-weight: bold;",
href, PageFlowUtil.urlProvider(LoginUrls.class).getLoginURL(container, context.getActionURL())),
"login"),
" to view this data")));
"Login"),
" to view this data.",
DOM.BR(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest conditionalizing this with a check to AuthenticationManager.isRegistrationEnabled(). Otherwise, on other servers it would send the user to a 404.

"Don't have an account? ",
DOM.A(at(style, "font-weight: bold;",
href, registerUrl),
"Register"))));
}

@RequiresPermission(ReadPermission.class)
Expand Down