mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +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);
|
||||
|
||||
/** LDAP all members group */
|
||||
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) {
|
||||
}
|
||||
}
|
||||
private Group ldapGroup;
|
||||
|
||||
/**
|
||||
* Let a real auth method return true if it wants.
|
||||
@@ -144,8 +130,13 @@ public class LDAPHierarchicalAuthentication
|
||||
{
|
||||
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)
|
||||
{ // Oops - the group isn't there.
|
||||
{
|
||||
// Oops - the group isn't there.
|
||||
log.warn(LogManager.getHeader(context,
|
||||
"ldap_specialgroup",
|
||||
"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
|
||||
}
|
||||
return new int[0];
|
||||
@@ -468,7 +460,7 @@ public class LDAPHierarchicalAuthentication
|
||||
// Ambiguous user, can't continue
|
||||
|
||||
} else {
|
||||
log.warn(LogManager.getHeader(context, "got DN", resultDN));
|
||||
log.debug(LogManager.getHeader(context, "got DN", resultDN));
|
||||
return resultDN;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user