Changeset 27295
- Timestamp:
- 2013-05-03T18:25:10+12:00 (11 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/common-src/cgi-bin/metadata-server.pl
r24872 r27295 55 55 $gsdl_cgi->checked_chdir($gsdlhome); 56 56 57 # Encrypt the password 58 $gsdl_cgi->encrypt_password(); 59 57 60 require cgiactions::metadataaction; 58 61 -
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 -
main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
r27261 r27295 250 250 # Authenticate user if it is enabled 251 251 if ($baseaction::authentication_enabled) { 252 # Ensure the user is allowed to edit this collection 253 &authenticate_user($gsdl_cgi, $username, $collect);252 # Ensure the user is allowed to edit this collection 253 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 254 254 } 255 255 … … 309 309 # Authenticate user if it is enabled 310 310 if ($baseaction::authentication_enabled) { 311 312 311 # Ensure the user is allowed to edit this collection 312 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 313 313 } 314 314 … … 444 444 # Authenticate user if it is enabled 445 445 if ($baseaction::authentication_enabled) { 446 # Ensure the user is allowed to edit this collection447 446 # Ensure the user is allowed to edit this collection 447 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 448 448 } 449 449 … … 614 614 615 615 if ($baseaction::authentication_enabled) { 616 # Ensure the user is allowed to edit this collection 617 &authenticate_user($gsdl_cgi, $username, $collect);616 # Ensure the user is allowed to edit this collection 617 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 618 618 } 619 619 … … 847 847 848 848 if ($baseaction::authentication_enabled) { 849 # Ensure the user is allowed to edit this collection 850 &authenticate_user($gsdl_cgi, $username, $collect);849 # Ensure the user is allowed to edit this collection 850 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 851 851 } 852 852 … … 889 889 890 890 if ($baseaction::authentication_enabled) { 891 # Ensure the user is allowed to edit this collection 892 #&authenticate_user($gsdl_cgi, $username, $collect); 893 $self->authenticate_user($username, $collect); 891 # Ensure the user is allowed to edit this collection 892 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 894 893 } 895 894 … … 963 962 if ($baseaction::authentication_enabled) { 964 963 # Ensure the user is allowed to edit this collection 965 &authenticate_user($gsdl_cgi, $username, $collect);964 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 966 965 } 967 966 … … 1079 1078 1080 1079 if ($baseaction::authentication_enabled) { 1081 # Ensure the user is allowed to edit this collection 1082 &authenticate_user($gsdl_cgi, $username, $collect);1080 # Ensure the user is allowed to edit this collection 1081 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 1083 1082 } 1084 1083 … … 1192 1191 1193 1192 if ($baseaction::authentication_enabled) { 1194 # Ensure the user is allowed to edit this collection 1195 &authenticate_user($gsdl_cgi, $username, $collect);1193 # Ensure the user is allowed to edit this collection 1194 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 1196 1195 } 1197 1196 … … 1685 1684 1686 1685 if ($baseaction::authentication_enabled) { 1687 # Ensure the user is allowed to edit this collection 1688 &authenticate_user($gsdl_cgi, $username, $collect);1686 # Ensure the user is allowed to edit this collection 1687 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 1689 1688 } 1690 1689 … … 1782 1781 if ($baseaction::authentication_enabled) 1783 1782 { 1784 # Ensure the user is allowed to edit this collection1785 &authenticate_user($gsdl_cgi, $username, $collect);1783 # Ensure the user is allowed to edit this collection 1784 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 1786 1785 } 1787 1786 … … 2220 2219 2221 2220 if ($baseaction::authentication_enabled) { 2222 2223 2221 # Ensure the user is allowed to edit this collection 2222 $self->authenticate_user($username, $collect); 2224 2223 } 2225 2224 … … 2244 2243 2245 2244 if ($baseaction::authentication_enabled) { 2246 # Ensure the user is allowed to edit this collection 2247 &authenticate_user($gsdl_cgi, $username, $collect);2245 # Ensure the user is allowed to edit this collection 2246 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 2248 2247 } 2249 2248 … … 2527 2526 2528 2527 if ($baseaction::authentication_enabled) { 2529 # Ensure the user is allowed to edit this collection2530 2528 # Ensure the user is allowed to edit this collection 2529 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 2531 2530 } 2532 2531 … … 2695 2694 2696 2695 if ($baseaction::authentication_enabled) { 2697 # Ensure the user is allowed to edit this collection 2698 &authenticate_user($gsdl_cgi, $username, $collect);2696 # Ensure the user is allowed to edit this collection 2697 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 2699 2698 } 2700 2699 … … 2722 2721 2723 2722 if ($baseaction::authentication_enabled) { 2724 # Ensure the user is allowed to edit this collection 2725 &authenticate_user($gsdl_cgi, $username, $collect);2723 # Ensure the user is allowed to edit this collection 2724 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 2726 2725 } 2727 2726 … … 2842 2841 2843 2842 if ($baseaction::authentication_enabled) { 2844 # Ensure the user is allowed to edit this collection 2845 &authenticate_user($gsdl_cgi, $username, $collect);2843 # Ensure the user is allowed to edit this collection 2844 $self->authenticate_user($username, $collect); #&authenticate_user($gsdl_cgi, $username, $collect); 2846 2845 } 2847 2846
Note:
See TracChangeset
for help on using the changeset viewer.