mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +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
|
// 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(""))) {
|
||||||
@@ -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
|
// The user is not an LDAP user, so we don't need to worry about them
|
||||||
}
|
}
|
||||||
return Collections.EMPTY_LIST;
|
return Collections.EMPTY_LIST;
|
||||||
|
Reference in New Issue
Block a user