Changeset 32985
- Timestamp:
- 2019-04-05T14:24:29+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r32475 r32985 33 33 import org.apache.log4j.Logger; 34 34 import org.greenstone.gsdl3.core.ModuleInterface; 35 import org.greenstone.gsdl3.service.Authentication; 35 36 import org.greenstone.gsdl3.util.CustomClassLoader; 36 37 import org.greenstone.gsdl3.util.Dictionary; … … 80 81 /** Stores the scope of any security rules (either collection or document) */ 81 82 protected boolean _securityScopeCollection = true; 82 83 protected boolean _humanVerify = false; 84 protected boolean _useRecaptcha = false; // for human verify 85 protected String _siteKey = null; // for recaptcha 86 protected String _secretKey = null; // for recaptcha 87 83 88 protected HashMap<String, ArrayList<Element>> _documentSets = new HashMap<String, ArrayList<Element>>(); 84 89 protected ArrayList<HashMap<String, ArrayList<String>>> _securityExceptions = new ArrayList<HashMap<String, ArrayList<String>>>(); 85 90 86 91 protected XMLTransformer transformer = null; 87 /**88 * A class loader that knows about the collection resources directory can89 * put properties files, dtds etc in here90 */91 //CustomClassLoader class_loader = null;92 92 93 93 /** same as setClusterName */ … … 339 339 } 340 340 341 String humanVerify = securityBlock.getAttribute("humanVerify"); 342 if (humanVerify.equals("true")) { 343 _humanVerify = true; 344 } 345 346 String useRecaptcha = securityBlock.getAttribute("useRecaptcha"); 347 if (useRecaptcha.equals("true")) { 348 349 Authentication authen_services =(Authentication) this.router.getModuleMap().get(Authentication.AUTHENTICATION_SERVICE); 350 if (authen_services != null) { 351 String siteKey = authen_services.getRecaptchaSiteKey(); 352 String secretKey = authen_services.getRecaptchaSecretKey(); 353 354 if (siteKey != null && secretKey != null) { 355 _useRecaptcha = true; 356 _siteKey = siteKey; 357 _secretKey = secretKey; 358 } 359 } 360 } 341 361 if (scope.toLowerCase().equals("collection")) 342 362 { … … 497 517 response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_SECURITY); 498 518 519 if (_humanVerify) { 520 response.setAttribute("humanVerify", "true"); 521 if (_useRecaptcha) { 522 response.setAttribute("siteKey", _siteKey); 523 response.setAttribute("secretKey", _secretKey); 524 } 525 } 499 526 String oid = request.getAttribute("oid"); 500 527 if (oid.contains("."))
Note:
See TracChangeset
for help on using the changeset viewer.