Changeset 27127


Ignore:
Timestamp:
2013-03-26T13:08:13+13:00 (11 years ago)
Author:
sjm84
Message:

The debug information will no longer be inserted if the user is not an admin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java

    r27090 r27127  
    199199        {
    200200            Document currentDoc = this.converter.getDOM(currentFile);
    201             if (currentDoc == null) {
    202                 // Can happen if an editor creates an auto-save temporary file
    203                 // (such as #header.xsl#) that is not well formed XML
    204                 continue;
     201            if (currentDoc == null)
     202            {
     203                // Can happen if an editor creates an auto-save temporary file
     204                // (such as #header.xsl#) that is not well formed XML
     205                continue;
    205206            }
    206207
     
    634635            root.appendChild(filepath);
    635636
    636             if ((output.equals("xml")) || output.equals("json")) {
    637                 // in the case of "json", calling method responsible for converting to JSON-string
    638                 return theXML.getDocumentElement();
    639             }
    640         }
    641 
     637            if ((output.equals("xml")) || output.equals("json"))
     638            {
     639                // in the case of "json", calling method responsible for converting to JSON-string
     640                return theXML.getDocumentElement();
     641            }
     642        }
    642643
    643644        Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
     
    656657            inlineTemplate = (String) params.get(GSParams.INLINE_TEMPLATE);
    657658
    658             if (params.get(GSParams.DEBUG) != null && (((String) params.get(GSParams.DEBUG)).equals("on") || ((String) params.get(GSParams.DEBUG)).equals("1")))
    659             {
    660                 _debug = true;
     659            if (params.get(GSParams.DEBUG) != null && (((String) params.get(GSParams.DEBUG)).equals("on") || ((String) params.get(GSParams.DEBUG)).equals("1") || ((String) params.get(GSParams.DEBUG)).equals("true")))
     660            {
     661                String[] groups = new UserContext(request).getGroups();
     662
     663                boolean found = false;
     664                for (String g : groups)
     665                {
     666                    if (g.equals("administrator"))
     667                    {
     668                        found = true;
     669                    }
     670                }
     671                if (found)
     672                {
     673                    _debug = true;
     674                }
    661675            }
    662676        }
     
    981995        }
    982996
    983        
    984997        // The transformer will now work out the resulting doctype from any set in the (merged) stylesheets and
    985998        // will set this in the output document it creates. So don't pass in any docWithDocType to the transformer
Note: See TracChangeset for help on using the changeset viewer.