mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 23:43:06 +00:00
(Stuart Lewis) - Fix issue where users are not getting added to the ldap special group correctly, and adjusted some of the logging levels
git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3144 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -73,21 +73,7 @@ public class LDAPHierarchicalAuthentication
|
|||||||
private static Logger log = Logger.getLogger(LDAPHierarchicalAuthentication.class);
|
private static Logger log = Logger.getLogger(LDAPHierarchicalAuthentication.class);
|
||||||
|
|
||||||
/** LDAP all members group */
|
/** LDAP all members group */
|
||||||
Group ldapGroup;
|
private Group ldapGroup;
|
||||||
|
|
||||||
public void init()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String groupName = ConfigurationManager.getProperty("ldap.login.specialgroup");
|
|
||||||
if ((groupName != null) && (!groupName.trim().equals("")))
|
|
||||||
{
|
|
||||||
ldapGroup = Group.findByName(new Context(), groupName);
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Let a real auth method return true if it wants.
|
* Let a real auth method return true if it wants.
|
||||||
@@ -144,8 +130,13 @@ public class LDAPHierarchicalAuthentication
|
|||||||
{
|
{
|
||||||
if (!context.getCurrentUser().getNetid().equals(""))
|
if (!context.getCurrentUser().getNetid().equals(""))
|
||||||
{
|
{
|
||||||
|
String groupName = ConfigurationManager.getProperty("ldap.login.specialgroup");
|
||||||
|
if ((groupName != null) && (!groupName.trim().equals("")))
|
||||||
|
{
|
||||||
|
ldapGroup = Group.findByName(new Context(), groupName);
|
||||||
if (ldapGroup == null)
|
if (ldapGroup == null)
|
||||||
{ // Oops - the group isn't there.
|
{
|
||||||
|
// Oops - the group isn't there.
|
||||||
log.warn(LogManager.getHeader(context,
|
log.warn(LogManager.getHeader(context,
|
||||||
"ldap_specialgroup",
|
"ldap_specialgroup",
|
||||||
"Group defined in ldap.login.specialgroup does not exist"));
|
"Group defined in ldap.login.specialgroup does not exist"));
|
||||||
@@ -156,7 +147,8 @@ public class LDAPHierarchicalAuthentication
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (NullPointerException npe) {
|
}
|
||||||
|
catch (Exception npe) {
|
||||||
// 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 new int[0];
|
return new int[0];
|
||||||
@@ -468,7 +460,7 @@ public class LDAPHierarchicalAuthentication
|
|||||||
// Ambiguous user, can't continue
|
// Ambiguous user, can't continue
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
log.warn(LogManager.getHeader(context, "got DN", resultDN));
|
log.debug(LogManager.getHeader(context, "got DN", resultDN));
|
||||||
return resultDN;
|
return resultDN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user