mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
(Stuart Lewis) - Fix issue where users without a netid (users not authenticated via LDAP) can't login because an NPE is thrown in the getSpecialGroups method of the LDAPHierarchicalAuthentication class
git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3143 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -140,8 +140,9 @@ public class LDAPHierarchicalAuthentication
|
|||||||
{
|
{
|
||||||
// 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
|
||||||
if ((context.getCurrentUser() != null) &&
|
try
|
||||||
(!context.getCurrentUser().getNetid().equals("")))
|
{
|
||||||
|
if (!context.getCurrentUser().getNetid().equals(""))
|
||||||
{
|
{
|
||||||
if (ldapGroup == null)
|
if (ldapGroup == null)
|
||||||
{ // Oops - the group isn't there.
|
{ // Oops - the group isn't there.
|
||||||
@@ -154,6 +155,10 @@ public class LDAPHierarchicalAuthentication
|
|||||||
return new int[] { ldapGroup.getID() };
|
return new int[] { ldapGroup.getID() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (NullPointerException npe) {
|
||||||
|
// The user is not an LDAP user, so we don't need to worry about them
|
||||||
|
}
|
||||||
return new int[0];
|
return new int[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user