mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 02:24:18 +00:00
return to SQLException catch and testing for Nullpointers manually
This commit is contained in:
@@ -141,6 +141,14 @@ public class LDAPAuthentication
|
||||
// Prevents anonymous users from being added to this group, and the second check
|
||||
// ensures they are LDAP users
|
||||
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("")) {
|
||||
String groupName = configurationService.getProperty("authentication-ldap.login.specialgroup");
|
||||
if ((groupName != null) && (!groupName.trim().equals(""))) {
|
||||
@@ -156,7 +164,7 @@ public class LDAPAuthentication
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
} catch (SQLException ex) {
|
||||
// The user is not an LDAP user, so we don't need to worry about them
|
||||
}
|
||||
return Collections.EMPTY_LIST;
|
||||
|
Reference in New Issue
Block a user