Changeset 33387
- Timestamp:
- 2019-08-06T11:33:16+12:00 (5 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
r33256 r33387 445 445 session.setMaxInactiveInterval(session_expiration); 446 446 String uid = session.getId(); 447 logger.error("uid = "+uid);448 447 request.setCharacterEncoding("UTF-8"); 449 448 response.setContentType("text/html;charset=UTF-8"); … … 464 463 userContext.setLanguage(lang); 465 464 userContext.setUserID(uid); 466 logger.error ("setting user context "+ uid);467 465 if (request.getAuthType() != null) 468 466 { 469 467 //Get the username 470 userContext.setUsername(request.getUserPrincipal().getName()); 471 logger.error("adding username "+request.getUserPrincipal().getName()); 468 userContext.setUsername(request.getUserPrincipal().getName()); 472 469 473 470 //Get the groups for the user … … 552 549 should_cache = false; 553 550 554 logger.error("KATH: cleaning up the cache");555 551 // we may want to remove all collection cache info, or just a specific collection 556 552 boolean clean_all = true; … … 608 604 } 609 605 610 logger.error("should_cache= " + should_cache);611 logger.error("cache key = " + cache_key);612 606 //clear the collection-specific cache in the session, since we have no way to know whether this session is 613 607 //about the same collection as the last session or not. … … 619 613 { 620 614 session.removeAttribute(name); 621 logger.error("XXX removing "+name+" from the session");622 615 } 623 616 } … … 632 625 if (session_ids_table.containsKey(sid)) 633 626 { 634 logger.error("cache contains sesion id");635 627 session_cache = session_ids_table.get(sid); 636 628 param_table = session_cache.getParamsTable(); 637 629 if (param_table.containsKey(cache_key)) 638 630 { 639 logger.error("existing table: " + cache_key);640 631 table = param_table.get(cache_key); 641 632 } … … 644 635 table = new Hashtable<String, String>(); 645 636 param_table.put(cache_key, table); 646 logger.error("new table: " + cache_key);647 637 new_table = true; 648 638 } … … 650 640 else 651 641 { 652 logger.error("cache doesn't contain session id");653 642 param_table = new Hashtable<String, Hashtable<String, String>>(); 654 643 table = new Hashtable<String, String>(); … … 667 656 String v = this.gs_params.getParamDefault(p); 668 657 if (!p.equals(GSParams.ACTION) && !p.equals(GSParams.SUBACTION) && !p.equals(GSParams.LANGUAGE) && !p.equals(GSParams.OUTPUT)) { 669 logger.error("adding to new table default param "+p+", "+v);670 658 table.put(p,v); 671 659 } … … 704 692 {// we have already dealt with these 705 693 706 logger.error("query map:" + name);707 694 String value = ""; 708 695 String[] values = queryMap.get(name); … … 718 705 if (this.gs_params.shouldSave(name) && table != null) 719 706 { 720 logger.error("adding to table");721 707 table.put(name, value); 722 708 } 723 709 else 724 710 { 725 logger.error("adding param to xml param list");726 711 Element param = msg_doc.createElement(GSXML.PARAM_ELEM); 727 712 param.setAttribute(GSXML.NAME_ATT, name); … … 743 728 { 744 729 String name = keys.nextElement(); 745 logger.error("adding from table to session "+name);746 730 session.setAttribute(name, table.get(name)); 747 731 } … … 750 734 // put in all the params from the session cache 751 735 Enumeration params = session.getAttributeNames(); 752 logger.error("add in session attributes");753 736 while (params.hasMoreElements()) 754 737 { 755 738 String name = (String) params.nextElement(); 756 logger.error("session attribute "+name);757 739 if (!name.equals(GSXML.USER_SESSION_CACHE_ATT) && !name.equals(GSParams.LANGUAGE) && !name.equals(GSXML.USER_ID_ATT)) 758 740 { … … 1061 1043 if (table == null) 1062 1044 { 1063 1045 //logger.info("cached table is null"); 1064 1046 return; 1065 1047 } 1066 1048 if (table.size() == 0) 1067 1049 { 1068 1050 //logger.info("cached table size is zero"); 1069 1051 return; 1070 1052 } … … 1075 1057 num_cached_coll += cache_list.get(i).tableSize(); 1076 1058 } 1077 logger.info("Number of sessions : total number of cached collection info = " + table.size() + " : " + num_cached_coll);1059 //logger.info("Number of sessions : total number of cached collection info = " + table.size() + " : " + num_cached_coll); 1078 1060 } 1079 1061 -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r33180 r33387 177 177 this.site_http_address = web_address + "/"+this.library_name+"/sites/" + this.site_name; 178 178 } 179 logger.error("KATH - site http address = "+this.site_http_address);180 179 // are we behind a firewall?? - is there a better place to set up the proxy? 181 180 String host = GlobalProperties.getProperty("proxy.host"); -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
r33347 r33387 495 495 496 496 Element mr_response = (Element)gsRouter.process(securityMessage); 497 logger.debug("security response = "+XMLConverter.getPrettyString(mr_response));497 //logger.debug("security response = "+XMLConverter.getPrettyString(mr_response)); 498 498 499 499 boolean verifiable_file = true; … … 538 538 if (!verify.equals("")) { 539 539 // we are asking for the main document, and we have been asked to verify the user 540 logger.error("KATH verifiable file is true");541 542 540 // have we done the test previously? 543 541 boolean already_verified = false; … … 551 549 // we haven't done this at all, set up the map 552 550 verifiedUserMap = new Hashtable<String, UserTimer>(); 553 logger.error("KATH setting up new user map");554 551 } else { 555 552 // check this map … … 558 555 } 559 556 } 560 logger.error("KATH already verified = "+already_verified);561 557 } 562 558 563 559 if (!already_verified) { 564 560 // have we just done the test? 565 //String hmvf_response = request.getParameter(GSParams.VERIFIED);566 561 // hmvf param will be set by form if the verify page was submitted 567 562 if (hmvf_response != null && hmvf_response.equals("1")) { 568 logger.error("user has submitted the form, check recaptcha response");569 563 if (!securityResponse.getAttribute(GSXML.SITE_KEY_ATT).equals("")) { 570 564 String recaptcha_response = request.getParameter(Authentication.RECAPTCHA_RESPONSE_PARAM); 571 565 String secret_key = securityResponse.getAttribute(GSXML.SECRET_KEY_ATT); 572 566 int result = Authentication.verifyRecaptcha(secret_key, recaptcha_response); 573 logger.error("recaptcha result code = "+result);574 567 if (result == Authentication.NO_ERROR) { 575 logger.error("RECAPTCHA SUCCESS, hopefully going to the document");576 568 already_verified = true; 577 569 … … 603 595 // or we have been asked to force the T&C 604 596 // we need to display the verify page 605 logger.error("KATH display verify page");606 //String new_url = context.getContextPath()+"/"+ context.getAttribute("LibraryName")+"?a=p&sa=verify&c="+collection+"&url="+url;607 597 String new_url = context.getContextPath()+"/"+ library_name+"?a=p&sa=verify&c="+collection+"&url="+url; 608 598 ((HttpServletResponse)response).sendRedirect(new_url); … … 656 646 if (metadataList.getLength() == 0) { 657 647 658 logger.error("Could not find the document related to this url");648 logger.error("Could not find the document ID related to this url"); 659 649 return null; 660 650 }
Note:
See TracChangeset
for help on using the changeset viewer.