Ignore:
Timestamp:
2023-09-29T20:52:00+13:00 (8 months ago)
Author:
anupama
Message:

Untested. Committing changes for bypassing webswing authentication when already logged in to greenstone.

Location:
main/trunk/greenstone3/web/interfaces/default
Files:
3 edited

Legend:

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

    r38238 r38256  
    616616}
    617617
     618
     619gs.funcions.getLoggedInUser = function()
     620{
     621    var baseURL = gs.xsltParams.library_name + "?a=g&rt=r&ro=1&s=CurrentUser&";
     622}
     623
    618624// Prepare the payload (data package) to transmit to metadataserver.pl over AJAX.
    619625// These next 2 functions prepare both the URL version of the payload and the data object version
  • main/trunk/greenstone3/web/interfaces/default/transform/javascript-global-setup.xsl

    r37805 r38256  
    161161            </script>
    162162        </xsl:if>
     163        <!-- check if we have a JSessionID and fill in any user details we haven't captured in JS vars yet as well as JSessionID -->
     164        <xsl:if test="/page/pageRequest/userContext/@uid">
     165          <script type="text/javascript">
     166            <xsl:text disable-output-escaping="yes">
     167              if (typeof gs.userInformation === "undefined") {
     168                gs.userInformation={};
     169            gs.userInformation.username = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@username"/><xsl:text disable-output-escaping="yes">";
     170            gs.userInformation.groups = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@groups"/><xsl:text disable-output-escaping="yes">";
     171              }
     172              gs.userInformation.uid = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@uid"/><xsl:text disable-output-escaping="yes">";             
     173            </xsl:text>
     174          </script>
     175        </xsl:if>
    163176    </xsl:template>
    164177   
     
    167180        <script type="text/javascript" src="interfaces/{$interface_name}/js/GSMetadata.js"><xsl:text> </xsl:text></script>
    168181        <script type="text/javascript" src="interfaces/{$interface_name}/js/utility_scripts.js"><xsl:text> </xsl:text></script>
    169 
    170182    </xsl:template>
    171183</xsl:stylesheet>
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-gli.xsl

    r37417 r38256  
    132132       webswingInstance0.options.args = "-load " + gs.cgiParams.c + "/gli.col";
    133133       }
     134       if(gs.userInformation.uid) {
     135         webswingInstance0.options.args = " -username " + gs.userInformation.username;
     136         webswingInstance0.options.args = " -groups " + gs.userInformation.groups.replace(/\s/g, '');
     137         webswingInstance0.options.args = " -uid " + gs.userInformation.uid;
     138       }
    134139    function getParam(name) {
    135140        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
Note: See TracChangeset for help on using the changeset viewer.