mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
Merge pull request #3203 from tubhh/LDAP_bugfix
LDAP Authentication: use generic exception instead of special SQLException
This commit is contained in:
@@ -141,6 +141,15 @@ public class LDAPAuthentication
|
|||||||
// Prevents anonymous users from being added to this group, and the second check
|
// Prevents anonymous users from being added to this group, and the second check
|
||||||
// ensures they are LDAP users
|
// ensures they are LDAP users
|
||||||
try {
|
try {
|
||||||
|
// without a logged in user, this method should return an empty list
|
||||||
|
if (context.getCurrentUser() == null) {
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
}
|
||||||
|
// if the logged in user does not have a netid, it's not an LDAP user
|
||||||
|
// and this method should return an empty list
|
||||||
|
if (context.getCurrentUser().getNetid() == null) {
|
||||||
|
return Collections.EMPTY_LIST;
|
||||||
|
}
|
||||||
if (!context.getCurrentUser().getNetid().equals("")) {
|
if (!context.getCurrentUser().getNetid().equals("")) {
|
||||||
String groupName = configurationService.getProperty("authentication-ldap.login.specialgroup");
|
String groupName = configurationService.getProperty("authentication-ldap.login.specialgroup");
|
||||||
if ((groupName != null) && (!groupName.trim().equals(""))) {
|
if ((groupName != null) && (!groupName.trim().equals(""))) {
|
||||||
|
Reference in New Issue
Block a user