Ignore:
Timestamp:
2023-03-07T11:07:33+13:00 (14 months ago)
Author:
davidb
Message:

In the case of webswing, we want the GS3 logged in username, not the backend system username (which is whatever user is running tomcat, not what we want in this cas); some whitespace also introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r37329 r37419  
    874874    try {
    875875        Document default_lockfile = XMLTools.parseXMLFile("xml/" + LOCK_FILE, true);
     876
    876877        String user_name = System.getProperty("user.name");
     878
     879        if (Gatherer.isWebswing) {
     880        // More helpful to update this to be the username that
     881        // is ogged into GS3 to edit the collection
     882        user_name = Gatherer.webswingAuthenticator.getUsername();       
     883        }
     884       
    877885        Element person_element = (Element) XMLTools.getNodeFromNamed(default_lockfile.getDocumentElement(), "User");
    878886        person_element.appendChild(default_lockfile.createTextNode(user_name));
    879887        person_element = null;
    880888        user_name = null;
     889
    881890        String machine_name = Utility.getMachineName();
    882891        Element machine_element = (Element) XMLTools.getNodeFromNamed(default_lockfile.getDocumentElement(), "Machine");
     
    884893        machine_element = null;
    885894        machine_name = null;
     895
    886896        String date_time = Utility.getDateString();
    887897        Element date_element = (Element) XMLTools.getNodeFromNamed(default_lockfile.getDocumentElement(), "Date");
     
    889899        date_element = null;
    890900        date_time = null;
     901
    891902        XMLTools.writeXMLFile(lock_file, default_lockfile);
    892903    }
Note: See TracChangeset for help on using the changeset viewer.