mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
[DS-827] - Autoregister in LDAPHierarchicalAuthentication is incompatible with ldap.netid_email_domain option + patch to fix tabindex in LDAP login form
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6455 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -191,11 +191,19 @@ public class LDAPAuthentication
|
||||
log.info(LogManager.getHeader(context,
|
||||
"autoregister", "netid=" + netid));
|
||||
|
||||
if ((ldap.ldapEmail!=null)&&(!ldap.ldapEmail.equals("")))
|
||||
// If there is no email and the email domain is set, add it to the netid
|
||||
String email = ldap.ldapEmail;
|
||||
if (((email == null) || ("".equals(email))) &&
|
||||
(!"".equals(ConfigurationManager.getProperty("ldap.netid_email_domain"))))
|
||||
{
|
||||
email = netid + ConfigurationManager.getProperty("ldap.netid_email_domain");
|
||||
}
|
||||
|
||||
if ((email != null) && (!"".equals(email)))
|
||||
{
|
||||
try
|
||||
{
|
||||
eperson = EPerson.findByEmail(context, ldap.ldapEmail);
|
||||
eperson = EPerson.findByEmail(context, email);
|
||||
if (eperson!=null)
|
||||
{
|
||||
log.info(LogManager.getHeader(context,
|
||||
@@ -217,14 +225,10 @@ public class LDAPAuthentication
|
||||
{
|
||||
context.setIgnoreAuthorization(true);
|
||||
eperson = EPerson.create(context);
|
||||
if ((ldap.ldapEmail!=null)&&(!ldap.ldapEmail.equals("")))
|
||||
{
|
||||
eperson.setEmail(ldap.ldapEmail);
|
||||
}
|
||||
else
|
||||
{
|
||||
eperson.setEmail(netid);
|
||||
}
|
||||
if ((email != null) && (!"".equals(email)))
|
||||
{
|
||||
eperson.setEmail(email);
|
||||
}
|
||||
if ((ldap.ldapGivenName!=null)&&(!ldap.ldapGivenName.equals("")))
|
||||
{
|
||||
eperson.setFirstName(ldap.ldapGivenName);
|
||||
|
Reference in New Issue
Block a user