Changeset 16405
- Timestamp:
- 2008-07-15T12:20:55+12:00 (15 years ago)
- Location:
- greenstone3/trunk/web/WEB-INF/cgi
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/trunk/web/WEB-INF/cgi/gliserver.pl
r16376 r16405 203 203 my $java_classpath; 204 204 my $gsdlos = $ENV{'GSDLOS'}; 205 if ($gsdlos !~ /windows/){205 if ($gsdlos !~ m/windows/){ 206 206 $java_classpath = $java_gsdl3_classpath . ":" . $java_derby_classpath; 207 207 }else{ … … 217 217 my %users_db_data = (); 218 218 foreach my $users_db_entry (split(/-{70}/, $users_db_content)) { 219 if ($users_db_entry =~ /\n?\[(.+)\]\n/) {219 if ($users_db_entry =~ m/\n?\[(.+)\]\n/) { 220 220 $users_db_data{$1} = $users_db_entry; 221 221 } … … 229 229 230 230 # Check password 231 my ($valid_user_password) = ($user_data =~ /\<password\>(.*)/);231 my ($valid_user_password) = ($user_data =~ m/\<password\>(.*)/); 232 232 if ($user_password ne $valid_user_password) { 233 233 $gsdl_cgi->generate_error("Authentication failed: incorrect password."); … … 235 235 236 236 # Check group 237 my ($user_groups) = ($user_data =~ /\<groups\>(.*)/);237 my ($user_groups) = ($user_data =~ m/\<groups\>(.*)/); 238 238 239 239 if ($collection eq "") { … … 248 248 } 249 249 # Does this user have access to personal collections, and is this one? 250 if ($user_group eq "personal-collections-editor" && $collection =~ /^$username\-/) {250 if ($user_group eq "personal-collections-editor" && $collection =~ m/^$username\-/) { 251 251 return $user_groups; # Authentication successful 252 252 } … … 285 285 286 286 # Pick out the owner of the lock file 287 $lock_file_content =~ /\<User\>(.*?)\<\/User\>/;287 $lock_file_content =~ m/\<User\>(.*?)\<\/User\>/; 288 288 my $lock_file_owner = $1; 289 289 … … 317 317 # ACTIONS 318 318 # ---------------------------------------------------------------------------------------------------- 319 # This routine won't get called by GS2, so uses the variable site319 # This routine, which uses the variable site, won't get called by GS2, 320 320 sub user_validation{ 321 321 my ($gsdl_cgi, $username, $timestamp, $site) = @_; … … 323 323 # Users can be in any group to perform this action 324 324 my $user_err = &authenticate_user($gsdl_cgi, $username, "", $site); 325 if (defined $user_err && $user_err!~ /ERROR/){326 if ($user_err!~ /ERROR/){325 if (defined $user_err && $user_err!~ m/ERROR/){ 326 if ($user_err!~ m/ERROR/){ 327 327 #$gsdl_cgi->generate_error("Authentication failed: $username is not valid"); 328 328 $gsdl_cgi->generate_ok($user_err); … … 450 450 451 451 # Make sure we don't try to delete anything outside the collection 452 if ($file =~ /\.\./) {452 if ($file =~ m/\.\./) { 453 453 $gsdl_cgi->generate_error("Illegal file specified."); 454 454 } … … 658 658 659 659 # Make sure we don't try to download anything outside the collection 660 if ($file =~ /\.\./) {660 if ($file =~ m/\.\./) { 661 661 $gsdl_cgi->generate_error("Illegal file specified."); 662 662 } … … 714 714 715 715 # Make sure we don't try to download anything else 716 if ($file =~ /\.\./) {716 if ($file =~ m/\.\./) { 717 717 $gsdl_cgi->generate_error("Illegal file specified."); 718 718 } … … 868 868 869 869 # Make sure we don't try to move anything outside the collection 870 if ($source_file =~ /\.\./ || $target_file =~/\.\./) {870 if ($source_file =~ m/\.\./ || $target_file =~ m/\.\./) { 871 871 $gsdl_cgi->generate_error("Illegal file specified."); 872 872 } … … 912 912 913 913 # Make sure we don't try to create anything outside the collection 914 if ($directory =~ /\.\./) {914 if ($directory =~ m/\.\./) { 915 915 $gsdl_cgi->generate_error("Illegal directory specified."); 916 916 } … … 997 997 my $import_pl = "import.pl"; # import is a reserved word, need to put it in quotes 998 998 999 if (($script =~ /$import_pl|buildcol.pl/) || ($script eq "mkcol.pl")) { # || ($script eq "schedule.pl")999 if (($script =~ m/$import_pl|buildcol.pl/) || ($script eq "mkcol.pl")) { # || ($script eq "schedule.pl") 1000 1000 my $collect_directory = $gsdl_cgi->get_collection_dir($site); 1001 1001 $perl_args = $perl_args . " -collectdir \"$collect_directory\""; … … 1049 1049 1050 1050 # Make sure we don't try to upload anything outside the collection 1051 if ($file =~ /\.\./) {1051 if ($file =~ m/\.\./) { 1052 1052 $gsdl_cgi->generate_error("Illegal file specified."); 1053 1053 } 1054 if ($directory =~ /\.\./) {1054 if ($directory =~ m/\.\./) { 1055 1055 $gsdl_cgi->generate_error("Illegal directory specified."); 1056 1056 } -
greenstone3/trunk/web/WEB-INF/cgi/gsdlCGI.pm
r16385 r16405 32 32 # Check if we're dealing with the upload-coll-file cmd. Because it will be a 33 33 # multipart POST message and must be dealt with by the default CGI() constructor 34 if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ /upload-collection-file/)) {34 if((defined $ENV{'QUERY_STRING'}) && ($ENV{'QUERY_STRING'} =~ m/upload-collection-file/)) { 35 35 $self = new CGI(); 36 36 } … … 302 302 return "linux"; 303 303 } 304 elsif ($os =~ /mswin/i) {304 elsif ($os =~ m/mswin/i) { 305 305 return "windows"; 306 306 } 307 elsif ($os =~ /macos/i) {307 elsif ($os =~ m/macos/i) { 308 308 return "darwin"; 309 309 } … … 333 333 334 334 my $gsdlos = (defined $ENV{'GSDLOS'}) ? $ENV{'GSDLOS'} : $self->get_gsdl_os(); 335 if($gsdlos =~ /windows/) { # remote GS2 server on Windows uses "library.exe"335 if($gsdlos =~ m/windows/) { # remote GS2 server on Windows uses "library.exe" 336 336 $library_url .= ".exe"; 337 337 } … … 405 405 my $gsdl_bin_script = &util::filename_cat($gsdlhome,"bin","script"); 406 406 &util::envvar_append("PATH",$gsdl_bin_script); 407 407 408 408 my $gsdl_bin_os = &util::filename_cat($gsdlhome,"bin",$gsdlos); 409 409 &util::envvar_append("PATH",$gsdl_bin_os);
Note:
See TracChangeset
for help on using the changeset viewer.