Changeset 33347 for main/trunk/greenstone3
- Timestamp:
- 2019-07-23T13:45:16+12:00 (5 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r33176 r33347 81 81 /** Stores the scope of any security rules (either collection or document) */ 82 82 protected boolean _securityScopeCollection = true; 83 protected boolean _humanVerify = false;83 protected String _humanVerify = null; 84 84 protected boolean _useRecaptcha = false; // for human verify 85 85 protected String _siteKey = null; // for recaptcha … … 340 340 341 341 String humanVerify = securityBlock.getAttribute(GSXML.VERIFY_ATT); 342 if ( humanVerify.equals("true")) {343 _humanVerify = true;342 if (!humanVerify.equals("") && !humanVerify.equals("false")) { 343 _humanVerify = humanVerify; 344 344 } 345 345 … … 519 519 response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_SECURITY); 520 520 521 if (_humanVerify ) {522 response.setAttribute("humanVerify", "true");521 if (_humanVerify != null) { 522 response.setAttribute("humanVerify", _humanVerify); 523 523 if (_useRecaptcha) { 524 524 response.setAttribute("siteKey", _siteKey); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
r33241 r33347 534 534 // if got here have no groups that we need to belong to 535 535 // 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("")) { 537 539 // we are asking for the main document, and we have been asked to verify the user 538 540 logger.error("KATH verifiable file is true"); 539 541 540 542 // have we done the test previously? 541 543 boolean already_verified = false; 542 544 String hmvf_response = request.getParameter(GSParams.VERIFIED); 543 545 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 546 550 if (verifiedUserMap == null) { 547 551 // we haven't done this at all, set up the map … … 555 559 } 556 560 logger.error("KATH already verified = "+already_verified); 557 558 if (!already_verified) { 561 } 562 563 if (!already_verified) { 559 564 // have we just done the test? 560 565 //String hmvf_response = request.getParameter(GSParams.VERIFIED); … … 585 590 } 586 591 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 } 592 598 } // hmvf = 1 593 594 }599 } 600 595 601 if (!already_verified) { 596 602 // hmvf param is not set - we haven't shown them the form yet … … 603 609 return; 604 610 } 605 } // end if verifiable file && need to verify 611 } // end verify is set 612 }// end if verifiable file 606 613 607 614
Note:
See TracChangeset
for help on using the changeset viewer.