Hi Stuart

You kindly helped me customise the special groups code in
/home/dspace/dspace-1.6.2-src-release/dspace-api/src/main/java/org/dspace/authenticate/LDAPHierarchicalAuthentication.java
to differentiate between staff and student login.

I have just downloaded and built dspace 1.7.0 from source and the LDAP
authentication won't now work on our test server.

Before I start looking for silly errors in dspace.cfg can you please
confirm that the patch below should work properly with 1.7.0

Thanks very much

Clive


/*
* New code written by Stuart Lewis and added by Clive Gould on 28th April 2009
*/

public int[] getSpecialGroups(Context context, HttpServletRequest request)
{
try
{
if (!context.getCurrentUser().getNetid().equals(""))
{
Group staffGroup = Group.findByName(context, "all-staff");
Group studentsGroup = Group.findByName(context, "all-students");

// Does the username start with a '1'?
if ((studentsGroup != null) &&
context.getCurrentUser().getNetid().startsWith("1")))
{
// Add them to the students group
return new int[] { studentsGroup.getID() };
}
else if (staffGroup != null)
{
// Add them to the staff group
return new int[] { staffGroup.getID() };
}
}
}
catch (Exception npe) {
// The user is not an LDAP user, so we don't need to worry about them
}
return new int[0];
}

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to