Changeset 11941


Ignore:
Timestamp:
2006-06-20T10:03:20+12:00 (18 years ago)
Author:
mdewsnip
Message:

Changed authenticate_user to return the groups of the authenticated user.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/gliserver.pl

    r11940 r11941  
    106106
    107107    # Only authenticate if it is enabled
    108     return if (!$authentication_enabled);
     108    return "all-collections-editor" if (!$authentication_enabled);
    109109
    110110    if ((!defined $user_password) || ($user_password =~ m/^\s*$/)) {
     
    143143    }
    144144
    145     # If we're not editing a collection then the user doesn't need to be in a particular group
    146     if ($collection eq "") {
    147     return;  # Authentication successful
    148     }
    149 
    150145    # Check group
    151146    my ($user_groups) = ($user_data =~ /\<groups\>(.*)/);
     147    if ($collection eq "") {
     148    # If we're not editing a collection then the user doesn't need to be in a particular group
     149    return $user_groups;  # Authentication successful
     150    }
    152151    foreach my $user_group (split(/\,/, $user_groups)) {
    153152    # Does this user have access to all collections?
    154153    if ($user_group eq "all-collections-editor") {
    155         return;  # Authentication successful
     154        return $user_groups;  # Authentication successful
    156155    }
    157156    # Does this user have access to personal collections, and is this one?
    158157    if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) {
    159         return;  # Authentication successful
     158        return $user_groups;  # Authentication successful
    160159    }
    161160    # Does this user have access to this collection
    162161    if ($user_group eq "$collection-collection-editor") {
    163         return;  # Authentication successful
     162        return $user_groups;  # Authentication successful
    164163    }
    165164    }
Note: See TracChangeset for help on using the changeset viewer.