Changeset 4990


Ignore:
Timestamp:
04/16/14 12:11:14 (10 years ago)
Author:
Menzo Windhouwer
Message:

M mod-ISOcat-control-access/control/credentials.js

  • skip the found Shibboleth header when going to the actual request
  • disabled some debugging statements

M mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/Explorer.js
M mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/DCViewer.js

  • use a general resetView method to prevent redundancy
Location:
cats/ISOcat/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cats/ISOcat/trunk/mod-ISOcat-control-access/control/credentials.js

    r4036 r4990  
    1616cred = null;
    1717shib = null;
     18shdr = null;
    1819
    1920// first try HTTP Basic authentication
     
    4546shres = context.issueSubRequest(shreq);
    4647if (shres != null) {
    47     java.lang.System.out.println("DBG:credentials.js:shib headers["+shres.getAspects()+"]");
     48    //java.lang.System.out.println("DBG:credentials.js:shib headers["+shres.getAspects()+"]");
    4849    if (shres.hasAspect(DOMXDAAspect)) {
    4950        shres = shres.getAspect(DOMXDAAspect);
    50         java.lang.System.out.println("DBG:credentials.js:XDA["+shres+"]");
     51        //java.lang.System.out.println("DBG:credentials.js:XDA["+shres+"]");
    5152        if (shres != null) {
    5253            shres = shres.getXDA();
    5354            if (shres.isTrue("/nvp/header")) {
    5455                shres = shres.getText("/nvp/header",true);
    55                 java.lang.System.out.println("DBG:credentials.js:shib headers["+shres+"]");
     56                //java.lang.System.out.println("DBG:credentials.js:shib headers["+shres+"]");
    5657                if (shres != "") {
    5758                    shibHeaders = shres;
     
    6162    }
    6263}
    63 java.lang.System.out.println("DBG:credentials.js:shib headers["+shibHeaders+"]");
     64//java.lang.System.out.println("DBG:credentials.js:shib headers["+shibHeaders+"]");
    6465shibHeaders = shibHeaders.split(" ");
    6566for (i in shibHeaders) {
     
    6768        var auth = req.getArgument(shibHeaders[i]);
    6869        auth = auth.replace("data:text/plain,","");
    69         java.lang.System.out.println("DBG:credentials.js:principal["+shibHeaders[i]+"]["+auth+"]");
     70        //java.lang.System.out.println("DBG:credentials.js:principal["+shibHeaders[i]+"]["+auth+"]");
    7071        if (auth != "") {
    7172            shib = auth;
     73            shdr = shibHeaders[i];
    7274            break;
    7375        }
     
    148150}
    149151
     152java.lang.System.out.println("DBG:credentials.js:shiboleth principal["+shdr+"]["+shib+"]");
    150153//java.lang.System.out.println("DBG:credentials.js:authorization credentials["+cred+"]");
    151 //java.lang.System.out.println("DBG:credentials.js:shiboleth principal["+shib+"]");
    152154
    153155for(iter = req.getArguments(); iter.hasNext(); ) {
     
    155157    if (arg.equals("Authorization")) {
    156158        continue;
    157     } else if (arg.equals("eduPersonPrincipalName")) {
    158         continue;
    159     } else if (arg.equals("eduPersonTargetedID")) {
     159    } else if (shdr!=null && arg.equals(shdr)) {
    160160        continue;
    161161    } else if (arg.equals("principal")) {
  • cats/ISOcat/trunk/mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/DCViewer.js

    r4948 r4990  
    327327    };
    328328   
    329     DCViewer_prototype.loaded = function (objEvent) {
    330         var req = objEvent.target;
    331         var doc = req.getResponseXML();
    332        
    333         if ((req.getStatus() != 200) || (doc == null)) {
    334             org.isocat.gui.DCViewer.log.info("DC request failed[" + req.getStatus() + "][" + doc + "][" + req.getResponseText() + "]");
    335             org.isocat.APP.alert("DC loading failed", "The DC couldn't be loaded! You might not have the right to access it (anymore).", null, "OK");
    336            
    337             // hide the loading overlay
    338             org.isocat.gui.Loading.load(this.view).hide();
    339             org.isocat.gui.DCViewer.log.info("hiding loading overlay?");
    340            
    341             this.reset();
    342             return;
    343         }
    344        
    345         org.isocat.gui.DCViewer.log.info("DC request succeeded[" + req.getStatus() + "]");
    346        
    347         var div = doc.selectSingleNode("//div[@class='main']");
    348         this.anchors(div, true);
    349        
    350         this.viewer.setText(div.toString(), true);
    351         this.viewer.getRendered().scrollTop = 0;
    352         this.viewer.getRendered().scrollLeft = 0;
    353        
     329    DCViewer_prototype.resetView = function () {
    354330        // close some sections
    355331        $('.dc-' + this.dc.id + '-adminrec').toggle();
    356332        $('.dc-' + this.dc.id + '-langsec').toggle();
    357333        $('.dc-' + this.dc.id + '-langsec-en').addClass('dc-' + this.dc.id + '-langsec');
     334    };
     335   
     336    DCViewer_prototype.loaded = function (objEvent) {
     337        var req = objEvent.target;
     338        var doc = req.getResponseXML();
     339       
     340        if ((req.getStatus() != 200) || (doc == null)) {
     341            org.isocat.gui.DCViewer.log.info("DC request failed[" + req.getStatus() + "][" + doc + "][" + req.getResponseText() + "]");
     342            org.isocat.APP.alert("DC loading failed", "The DC couldn't be loaded! You might not have the right to access it (anymore).", null, "OK");
     343           
     344            // hide the loading overlay
     345            org.isocat.gui.Loading.load(this.view).hide();
     346            org.isocat.gui.DCViewer.log.info("hiding loading overlay?");
     347           
     348            this.reset();
     349            return;
     350        }
     351       
     352        org.isocat.gui.DCViewer.log.info("DC request succeeded[" + req.getStatus() + "]");
     353       
     354        var div = doc.selectSingleNode("//div[@class='main']");
     355        this.anchors(div, true);
     356       
     357        this.viewer.setText(div.toString(), true);
     358        this.viewer.getRendered().scrollTop = 0;
     359        this.viewer.getRendered().scrollLeft = 0;
     360       
     361        this.resetView();
    358362       
    359363        // hide the loading overlay
  • cats/ISOcat/trunk/mod-ISOcat-interface-gi/interface/JSXAPPS/ISOcat/js/org/isocat/gui/Explorer.js

    r4970 r4990  
    382382                        view.controller.setWindow(window);// close some sections
    383383                       
    384                         $('.dc-'+dc.id+'-adminrec').toggle();
    385                     $('.dc-'+dc.id+'-langsec').toggle();
    386                     $('.dc-'+dc.id+'-langsec-en').addClass('dc-'+dc.id+'-langsec');
     384                        view.controller.resetView();
    387385                       
    388386                        this.loadDataCategoryView();
Note: See TracChangeset for help on using the changeset viewer.