Changeset 30014

Show
Ignore:
Timestamp:
10.07.2015 21:58:49 (4 years ago)
Author:
ak19
Message:

Forgot to commit. Only if we're doing a set operation with the onine editor do we rewrite the URL, which makes it go through authentication.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/javascript-global-functions.js

    r29876 r30014  
    428428    // <gs3server>/cgi-bin/metadata-server.pl?a=set-archives-metadata&c=smallcol&site=localsite&d=HASH01454f31011f6b6b26eaf8d7&metaname=Title&metavalue=Moo&prevmetavalue=Blabla&metamode=override 
    429429    // To: 
    430     // <gs3server>/library?a=g&rt=r&ro=1&s=SetMetadata&s1.collection=smallcol&s1.site=localsite&s1.d=HASH01454f31011f6b6b26eaf8d7&s1.metaname=Title&s1.metavalue=Moo&s1.prevmetavalue=Blabla&s1.metamode=override 
    431  
    432     url = url.replace("&c=",  "&collection="); // c is a special param name for GS2Construct 
    433     url = url.replace(/(&|\?)([^=]*=)/g, "$1"+"s1.$2"); // prefix param names with "s1." 
    434     url = url.replace("cgi-bin/metadata-server.pl?",  gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=SetMetadata&"); 
     430    // <gs3server>/library?a=g&rt=r&ro=1&s=SetMetadata&s1.a=set-archives-metadata&s1.collection=smallcol&s1.site=localsite&s1.d=HASH01454f31011f6b6b26eaf8d7&s1.metaname=Title&s1.metavalue=Moo&s1.prevmetavalue=Blabla&s1.metamode=override 
     431 
     432    // if we're doing a set- metdata operation, then we'll be changing the URL to make sure we go through GS3's authentication 
     433    if(url.indexOf("set-") != -1) { 
     434    url = url.replace("&c=",  "&collection="); // c is a special param name for GS2Construct 
     435    url = url.replace(/(&|\?)([^=]*=)/g, "$1"+"s1.$2"); // prefix param names with "s1." 
     436    url = url.replace("cgi-bin/metadata-server.pl?",  gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=SetMetadata&"); 
     437 
     438    console.log("@@@@@ URL is " + url); 
     439    } // otherwise, such as for get- metadata operation, we proceed as before, which will not require authentication 
    435440 
    436441    $.ajax(url)