Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from kitodo:master #259

Merged
merged 6 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ public List<User> loadData(int first, int pageSize, String sortField, SortOrder
* if no unique user can be found
*/
public User getByLdapLoginOrLogin(String login) {
List<User> users = getByLoginQuery(login, "from User where ldapLogin = :login");
users.addAll(getByLoginQuery(login, "from User where login = :login"));
List<User> users = getByLoginQuery(login, "from User where ldapLogin = :login or login = :login");
return uniqueResult(users, login);
}

Expand All @@ -175,6 +174,8 @@ public User getByLdapLoginOrLogin(String login) {
* @param login
* The login.
* @return The user.
* @throws UsernameNotFoundException
* if no unique user can be found
*/
public User getByLogin(String login) {
List<User> users = getByLoginQuery(login, "from User where login = :login");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@
<p:treeNode type="#{StructurePanel.VIEW_NODE_TYPE}"
icon="ui-icon-document">
<h:outputText value="#{empty logicalNode.label ? msgs['dataEditor.withoutType'] : logicalNode.label}"
title="#{logicalNode.undefined ? msgs['dataEditor.undefinedStructure'] : ''}"
rendered="#{DataEditorForm.structurePanel.titleMetadata eq 'type'}"/>
title="#{logicalNode.undefined ? msgs['dataEditor.undefinedStructure'] : ''}"/>
<h:outputText value="#{DataEditorForm.structurePanel.getMultipleAssignmentsIndex(logicalNode) + 1}"
rendered="#{logicalNode.assignedSeveralTimes}"
styleClass="assigned-several-times"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,16 @@ public void shouldGetAuthenticatedUser() throws DAOException {
assertEquals("Returned authenticated user was wrong", "kowal", authenticatedUser.getLogin());
SecurityTestUtils.cleanSecurityContext();
}

@Test
public void returnCorrectUserIndependentOfLoginOrLdapLoginByLogin() {
User user = userService.getByLdapLoginOrLogin("verylast");
assertEquals("Returned user was wrong", "User, Very last", user.getFullName());
}

@Test
public void returnCorrectUserIndependentOfLoginOrLdapLoginByLdapLogin() {
User user = userService.getByLdapLoginOrLogin("doraLDP");
assertEquals("Returned user was wrong", "Dora, Anna", user.getFullName());
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ from system library in Java 11+ -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>5.17.2</version>
<version>5.17.6</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
Expand Down