Ignore:
Timestamp:
2019-07-23T13:45:16+12:00 (5 years ago)
Author:
kjdon
Message:

made it optional whether the user gets shown the terms and conditions (verify) every time, or just once. In collectionConfig.xml, in security element, set humanVerify=once to make it show the verify page only once (per session), otherwise set to 'true' or 'always', which will show the page everytime.

File:
1 edited

Legend:

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

    r33241 r33347  
    534534    // if got here have no groups that we need to belong to
    535535    // do we have human verify thing?
    536     if (verifiable_file && !securityResponse.getAttribute(GSXML.VERIFY_ATT).equals("") ) {
     536    if (verifiable_file) {
     537      String verify = securityResponse.getAttribute(GSXML.VERIFY_ATT);
     538      if (!verify.equals("")) {
    537539      // we are asking for the main document, and we have been asked to verify the user
    538540      logger.error("KATH verifiable file is true");
    539      
     541
    540542      // have we done the test previously?
    541543      boolean already_verified = false;
    542544      String hmvf_response = request.getParameter(GSParams.VERIFIED);
    543545      if (hmvf_response != null && hmvf_response.equals("0")) {
    544         // force the t&c
    545       } else {
     546        // manually force the t&c (user has added hmvf=0 to url)
     547      } else if (verify.equals("once")) {
     548        // lets check whether they have done it already
     549
    546550        if (verifiedUserMap == null) {
    547551          // we haven't done this at all, set up the map
     
    555559        }
    556560        logger.error("KATH already verified = "+already_verified);
    557          
    558         if (!already_verified) {
     561      }
     562     
     563      if (!already_verified) {
    559564          // have we just  done the test?
    560565          //String hmvf_response = request.getParameter(GSParams.VERIFIED);
     
    585590        }
    586591        already_verified = true;
    587         // store the fact that user has verified
    588         UserTimer timer = new UserTimer(verifiedUserTimeout, session_id);
    589         verifiedUserMap.put(session_id, timer);
    590         timer.start();
    591        
     592        if (verify.equals("once")) {
     593          // store the fact that user has verified
     594          UserTimer timer = new UserTimer(verifiedUserTimeout, session_id);
     595          verifiedUserMap.put(session_id, timer);
     596          timer.start();
     597        }
    592598          } // hmvf = 1
    593         }
    594       }
     599      }
     600     
    595601      if (!already_verified) {
    596602        // hmvf param is not set - we haven't shown them the form yet
     
    603609        return;
    604610      }
    605     } // end if verifiable file && need to verify
     611      } // end verify is set
     612    }// end if verifiable file
    606613   
    607614           
Note: See TracChangeset for help on using the changeset viewer.