Changeset 27295 for main/trunk/greenstone2/perllib/cgiactions/baseaction.pm
- Timestamp:
- 2013-05-03T18:25:10+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/baseaction.pm
r27277 r27295 31 31 use inexport; 32 32 33 our $authentication_enabled = 0; 33 our $authentication_enabled = 0; # debugging flag (can debug without authentication when set to 0) 34 34 our $mail_enabled = 0; 35 35 … … 237 237 my $gsdlhome = $ENV{'GSDLHOME'}; 238 238 my $etc_directory = &util::filename_cat($gsdlhome, "etc"); 239 my $users_db_file_path = &util::filename_cat($etc_directory, "users. db");239 my $users_db_file_path = &util::filename_cat($etc_directory, "users.gdb"); 240 240 241 241 # Use db2txt to get the user accounts information … … 246 246 } 247 247 248 # Get the user account information from the users. db database248 # Get the user account information from the users.gdb database 249 249 my %users_db_data = (); 250 250 foreach my $users_db_entry (split(/-{70}/, $users_db_content)) { … … 266 266 } 267 267 268 # The following code which tests whether the user is in the required group 269 # seems to have been copied over from gliserver.pl. 270 # But for metadata-server.pl, when user comments are added through the set-metadata functions, 271 # the user doesn't need to be a specific collection's editor in order to add comments to that collection. 272 # So we no longer check the user is in the group here. 273 268 274 # Check group 269 my ($user_groups) = ($user_data =~ /\<groups\>(.*)/);270 if ($collection eq "") {271 # If we're not editing a collection then the user doesn't need to be in a particular group272 return $user_groups; # Authentication successful273 }274 foreach my $user_group (split(/\,/, $user_groups)) {275 # my ($user_groups) = ($user_data =~ /\<groups\>(.*)/); 276 # if ($collection eq "") { 277 # # If we're not editing a collection then the user doesn't need to be in a particular group 278 # return $user_groups; # Authentication successful 279 # } 280 # foreach my $user_group (split(/\,/, $user_groups)) { 275 281 # Does this user have access to all collections? 276 if ($user_group eq "all-collections-editor") {277 return $user_groups; # Authentication successful278 }282 # if ($user_group eq "all-collections-editor") { 283 # return $user_groups; # Authentication successful 284 # } 279 285 # Does this user have access to personal collections, and is this one? 280 if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) {281 return $user_groups; # Authentication successful282 }286 # if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) { 287 # return $user_groups; # Authentication successful 288 # } 283 289 # Does this user have access to this collection 284 if ($user_group eq "$collection-collection-editor") {285 return $user_groups; # Authentication successful286 }287 }288 289 $gsdl_cgi->generate_error("Authentication failed: user is not in the required group.");290 # if ($user_group eq "$collection-collection-editor") { 291 # return $user_groups; # Authentication successful 292 # } 293 # } 294 # 295 # $gsdl_cgi->generate_error("Authentication failed: user is not in the required group."); 290 296 } 291 297
Note:
See TracChangeset
for help on using the changeset viewer.