Hi Stuart
Thanks very much for the patch :D
I've downloaded dspace-1.5.2-src-release from Sourceforge and located the
section of the code in the file LDAPHierarchicalAuthentication.java in
/root/dspace-1.5.2-src-release/dspace-api/src/main/java/org/dspace/authenticate
My next problem is down to ignorance on my part. Once I have patched the
above file what do I need to do to incorporate it into our
existing installation of DSpace, without having to perform a fresh
installation? (I have only worked with the dspace-1.5.2-release up to now).
Are the instructions on the page
http://wiki.dspace.org/index.php/Building_DSpace_From_Source relevant ??
Is there a jar I can copy over after compilation that will do the trick?
Any guidance for a relative newbie would be appreciated ;)
Thanks
Clive
On Tue, Apr 28, 2009 at 12:32 AM, Stuart Lewis <[email protected]>wrote:
> Hi Clive,
>
> Try replacing the code in the getSpcialGroups method in
> [dspace-src]/dspace-api/src/main/java/org/dspace/authenticate/DAPHierarchicalAuthentication.java
> with the following:
>
> 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];
> }
>
> Hopefully this should work. You may wish to change the group names which
> are set in the code to be 'all-staff' and 'all-students'.
>
>
>
> Stuart Lewis
> Digital Services Programmer
> Te Tumu Herenga The University of Auckland Library
> Auckland Mail Centre, Private Bag 92019, Auckland 1142, New Zealand
> Ph: 64 9 373-7599 x81928
> http://www.library.auckland.ac.nz/
>
>
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech