Ignore:
Timestamp:
2017-04-19T21:35:50+12:00 (7 years ago)
Author:
ak19
Message:

Follows Dr Bainbridge's suggestion to prevent URL based calls to set-metadata and remove-meta metadataserver.pl operations. Split metadataaction.pm into modmetadataaction.pm and metadataaction.pm, shifting the methods that modify metadata (set and remove subroutines) into the first. Now GS3 sets an env var that will control whether the meta-modifying subroutines will be available when called. If the env var is set, then metadataaction.pm will include the modmetadataaction.pm file in the begin block. For GS2, it works as before, always including the meta modifying subroutines. Tested on Linux with the GS3 web doc editor vs calling metadataserver.pl to set metadata directly from a URL.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/build/GS2PerlConstructor.java

    r31592 r31602  
    324324       
    325325        // Need to set QUERY_STRING and REQUEST_METHOD=GET in environment
     326        // Also set GS3_AUTHENTICATED, to allow running metadata-server.pl with mod (set and remove) commands
    326327        // http://www.cgi101.com/class/ch3/text.html
    327328        String[] envvars = {
    328329            "QUERY_STRING=" + this.query_string,
    329             "REQUEST_METHOD=GET"
     330            "REQUEST_METHOD=GET",
     331            "GS3_AUTHENTICATED=true" // how do we set the env var without having to assign it a value?
    330332        };
    331333
Note: See TracChangeset for help on using the changeset viewer.