Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 33240)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/URLFilter.java	(revision 33241)
@@ -77,5 +77,6 @@
   protected static final String SYSTEM_SUBACTION_DEACTIVATE = "deactivate";
 
-  // if we are showing terms and conditions to user, this remembers who has accepted already
+  // if we are showing terms and conditions to user, this remembers who has
+  // accepted already
   protected Hashtable<String, UserTimer> verifiedUserMap = null;
   protected static final int verifiedUserTimeout = 24 * 60 * 60 * 1000; 
@@ -103,5 +104,4 @@
     HttpServletRequest hRequest = ((HttpServletRequest) request);
     HttpSession hSession = hRequest.getSession();
-    String session_id = hSession.getId();
     ServletContext context = hSession.getServletContext();
 	
@@ -116,10 +116,289 @@
       return;
     }
-    logger.error("in do Filter: "+url);
-
+ 
     // Run security checks on files requested from a collection's index/assoc folder
     if (url.contains(ASSOCIATED_FILE_PATH)) {
+      // we need to do security checking here in case the documents are private
+      // or if there is a terms and conditions page to be shown.
+      // Also, assoc files urls now contain the library name in them.
+      // e.g. greenstone3/library/sites/localsite/collect/collname/index/assoc/Hashxxx/doc.pdf
+      // so they are not a true link to a file. We remove the
+      // 'library' then forward the request to the new url.
+      securityCheckAssocFiles(url, hRequest, response);
+      return;
+    }
+
+    // if we are asking for an interface file, and it doesn't exist, then
+    // try loading up the interfaceConfig file to find out what the base
+    // interface was, then try looking in that interface for the file.
+    if (url.contains(INTERFACE_PATH))
+      {			    
+	String fileURL = url.replaceFirst(context.getContextPath(), "");
+	File requestedFile = new File(context.getRealPath(fileURL));
+
+	if (!requestedFile.exists()) {
+	  String baseURL = getFileInBaseInterface(fileURL, context);
+	  if (baseURL != null) {
+	    File baseInterfaceFile = new File(context.getRealPath(baseURL));
+	    if (baseInterfaceFile.exists()) {
+	      request.getRequestDispatcher(baseURL).forward(request, response);
+	      // ServletOutputStream out = response.getOutputStream();
+	      // out.write(FileUtils.readFileToByteArray(baseInterfaceFile));
+	      // out.flush();
+	      // out.close();
+	      return;
+	    }
+	  }
+	}
+      }
+    else
+      {
+	ArrayList<String> keywords = new ArrayList<String>();
+	keywords.add(PAGE_PATH);
+	keywords.add(BROWSE_PATH);
+	keywords.add(SEARCH_PATH);
+	keywords.add(DOCUMENT_PATH);
+	//If we have a jsessionid on the end of our URL we want to ignore it
+	int index;
+	if ((index = url.indexOf(";jsessionid")) != -1)
+	  {
+	    url = url.substring(0, index);
+	  }
+	String[] segments = url.split("/");
+	for (int i = 0; i < segments.length; i++)
+	  {
+	    String[] additionalParameters = null;
+	    String[] defaultParamValues = null;
+	    //COLLECTION
+	    if (segments[i].equals(COLLECTION_PATH) && (i + 1) < segments.length) {
+	      int j=i+1;
+	      while(j+1 < segments.length && !keywords.contains(segments[j+1])) {
+		j++;
+	      }
+					  
+	      if (j>i+1) {
+		// we had a group part
+		String [] groups = Arrays.copyOfRange(segments, i+1, j);
+		String group = StringUtils.join(groups, "/");
+		gRequest.setParameter(GSParams.GROUP, group);
+	      }
+	      gRequest.setParameter(GSParams.COLLECTION, segments[j]);
+	    }
+	    // GROUP
+	    else if(segments[i].equals(GROUP_PATH) && (i + 1) < segments.length)
+	      {
+		// assume for now, no other path parts for group links
+		int j= segments.length - 1;
+		String group;
+		if (j==i+1) {
+		  group = segments[j];
+		} else {
+		  String [] groups = Arrays.copyOfRange(segments, i+1, j+1);
+		  group = StringUtils.join(groups, "/");
+		}
+		gRequest.setParameter(GSParams.GROUP, group);
+		gRequest.setParameter(GSParams.ACTION, "p");
+		gRequest.setParameter(GSParams.SUBACTION, "home");
+					    
+	      }
+	    //DOCUMENT
+	    else if (segments[i].equals(DOCUMENT_PATH) && (i + 1) < segments.length)
+	      {
+		gRequest.setParameter(GSParams.DOCUMENT, segments[i + 1]);
+						
+		additionalParameters = new String[] { GSParams.ACTION };
+		defaultParamValues = new String[] { "d" };
+		if ((i+2) < segments.length && segments[i+2].equals("print")) {
+		  gRequest.setParameter(GSParams.SUBACTION, "print");
+		  gRequest.setParameter("ed", "1");
+						  
+		}
+					
+	      }
+	    //PAGE
+	    else if (segments[i].equals(PAGE_PATH) && (i + 1) < segments.length)
+	      {
+		gRequest.setParameter(GSParams.SUBACTION, segments[i + 1]);
+
+		additionalParameters = new String[] { GSParams.ACTION };
+		defaultParamValues = new String[] { "p" };
+	      }
+	    //SYSTEM
+	    else if (segments[i].equals(SYSTEM_PATH) && (i + 1) < segments.length)
+	      {
+		String sa = segments[i + 1];
+		if (sa.equals(SYSTEM_SUBACTION_CONFIGURE) || sa.equals(SYSTEM_SUBACTION_RECONFIGURE))
+		  {
+		    sa = "c";
+		  }
+		else if (sa.equals(SYSTEM_SUBACTION_ACTIVATE))
+		  {
+		    sa = "a";
+		  }
+		else if (sa.equals(SYSTEM_SUBACTION_DEACTIVATE))
+		  {
+		    sa = "d";
+		  }
+
+		if (sa.equals("c") && (i + 2) < segments.length)
+		  {
+		    gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
+		  }
+
+		if (sa.equals("a") && (i + 2) < segments.length)
+		  {
+		    gRequest.setParameter(GSParams.SYSTEM_MODULE_TYPE, "collection");
+		    gRequest.setParameter(GSParams.SYSTEM_MODULE_NAME, segments[i + 2]);
+		  }
+
+		if (sa.equals("d") && (i + 2) < segments.length)
+		  {
+		    gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
+		  }
+
+		gRequest.setParameter(GSParams.SUBACTION, sa);
+
+		additionalParameters = new String[] { GSParams.ACTION };
+		defaultParamValues = new String[] { "s" };
+	      }
+	    //ADMIN
+	    else if (segments[i].equals("admin") && (i + 1) < segments.length)
+	      {
+		String pageName = segments[i + 1];
+
+		gRequest.setParameter("s1.authpage", pageName);
+
+		additionalParameters = new String[] { GSParams.ACTION, GSParams.REQUEST_TYPE, GSParams.SUBACTION, GSParams.SERVICE };
+		defaultParamValues = new String[] { "g", "r", "authen", "Authentication" };
+	      }
+	    //BROWSE
+	    else if (segments[i].equals(BROWSE_PATH) && (i + 1) < segments.length)
+	      {
+		String cl = "";
+		for (int j = 1; (i + j) < segments.length; j++)
+		  {
+		    String currentSegment = segments[i + j].replace("CL", "").replace("cl", "");
+		    if (currentSegment.contains("."))
+		      {
+			String[] subsegments = currentSegment.split("\\.");
+			for (String subsegment : subsegments)
+			  {
+			    subsegment = subsegment.replace("CL", "").replace("cl", "");
+
+			    if (cl.length() > 0)
+			      {
+				cl += ".";
+			      }
+
+			    if (subsegment.length() > 0)
+			      {
+				cl += subsegment;
+			      }
+			  }
+			continue;
+		      }
+		    if (!currentSegment.matches("^(CL|cl)?\\d+$"))
+		      {
+			continue;
+		      }
+
+		    if (cl.length() > 0)
+		      {
+			cl += ".";
+		      }
+
+		    cl += currentSegment;
+		  }
+
+		gRequest.setParameter("cl", "CL" + cl);
+
+		additionalParameters = new String[] { GSParams.ACTION, GSParams.REQUEST_TYPE, GSParams.SERVICE };
+		defaultParamValues = new String[] { "b", "s", "ClassifierBrowse" };
+	      }
+	    //QUERY
+	    else if (segments[i].equals(SEARCH_PATH))
+	      {
+		String serviceName = "";
+		if ((i + 1) < segments.length)
+		  {
+		    serviceName = segments[i + 1];
+		    gRequest.setParameter("s", serviceName);
+
+		    additionalParameters = new String[] { GSParams.ACTION, GSParams.SUBACTION, GSParams.REQUEST_TYPE };
+		    defaultParamValues = new String[] { "q", "", "d" };
+		  }
+		if ((i + 2) < segments.length)
+		  {
+		    if (serviceName.equals("TextQuery") || serviceName.equals("RawQuery"))
+		      {
+
+			gRequest.setParameter("s1.query", segments[i + 2]);
+		      }
+		    else if (serviceName.equals("FieldQuery"))
+		      {
+			gRequest.setParameter("s1.fqv", segments[i + 2]);
+		      }
+		    else if (serviceName.equals("AdvancedFieldQuery"))
+		      {
+			gRequest.setParameter("s1.fqv", segments[i + 2]);
+		      }
+		  }
+	      }
+	    if (additionalParameters != null)
+	      {
+		for (int j = 0; j < additionalParameters.length; j++)
+		  {
+		    if (gRequest.getParameter(additionalParameters[j]) == null)
+		      {
+			gRequest.setParameter(additionalParameters[j], defaultParamValues[j]);
+		      }
+		  }
+	      }
+	  }
+      }
+
+    chain.doFilter(gRequest, response);
+  }
+
+  private boolean isURLRestricted(String url)
+  {
+    for (String restrictedURL : _restrictedURLs)
+      {
+	if (url.matches(".*" + restrictedURL + ".*"))
+	  {
+	    return true;
+	  }
+      }
+
+    return false;
+  }
+
+  private String getFileInBaseInterface(String fileURL, ServletContext context) {
+    int interfaceNameStart = fileURL.indexOf(INTERFACE_PATH) + INTERFACE_PATH.length();
+    int interfaceNameEnd = fileURL.indexOf("/", interfaceNameStart);
+    String interfaceName = fileURL.substring(interfaceNameStart, interfaceNameEnd);
+    String interfacesDir = fileURL.substring(0, interfaceNameStart);
+    File interfaceConfigFile = new File(context.getRealPath(interfacesDir + interfaceName + "/interfaceConfig.xml"));
+    
+    if (interfaceConfigFile.exists()) {
       
-	// now we need to get library name from the path, which is like
+      Document interfaceConfigDoc = XMLConverter.getDOM(interfaceConfigFile);
+      
+      String baseInterface = interfaceConfigDoc.getDocumentElement().getAttribute("baseInterface");
+      if (baseInterface.length() > 0)
+	{
+	  return fileURL.replace("/" + interfaceName + "/", "/" + baseInterface + "/");
+	}
+    }
+      return null;
+  }
+	  
+
+  private void securityCheckAssocFiles(String url, HttpServletRequest request, ServletResponse response) throws IOException, ServletException {
+    HttpSession session = request.getSession();
+    String session_id = session.getId();
+    ServletContext context = session.getServletContext();
+
+    	// now we need to get library name from the path, which is like
 	// /greenstone3/library/sites/localsite/collect/collname/index/assoc/...
 	String library_name = url.replaceFirst(context.getContextPath(), "");
@@ -255,10 +534,14 @@
 	// if got here have no groups that we need to belong to
 	// do we have human verify thing?
-	if (verifiable_file) {
-	  // we are asking for the main document - lets check human verify
+	if (verifiable_file && !securityResponse.getAttribute(GSXML.VERIFY_ATT).equals("") ) {
+	  // we are asking for the main document, and we have been asked to verify the user 
 	  logger.error("KATH verifiable file is true");
-	  if (!securityResponse.getAttribute(GSXML.VERIFY_ATT).equals("")) {
-	    // have we done the test previously?
-	    boolean already_verified = false;
+	  
+	  // have we done the test previously?
+	  boolean already_verified = false;
+	  String hmvf_response = request.getParameter(GSParams.VERIFIED);
+	  if (hmvf_response != null && hmvf_response.equals("0")) {
+	    // force the t&c
+	  } else {
 	    if (verifiedUserMap == null) {
 	      // we haven't done this at all, set up the map
@@ -272,13 +555,13 @@
 	    }
 	    logger.error("KATH already verified = "+already_verified);
-
+	      
 	    if (!already_verified) {
 	      // have we just  done the test?
-	      String hmvf_response = gRequest.getParameter(GSParams.VERIFIED);
+	      //String hmvf_response = request.getParameter(GSParams.VERIFIED);
 	      // hmvf param will be set by form if the verify page was submitted
 	      if (hmvf_response != null && hmvf_response.equals("1")) {
 		logger.error("user has submitted the form, check recaptcha response");
 		if (!securityResponse.getAttribute(GSXML.SITE_KEY_ATT).equals("")) {
-		  String recaptcha_response = gRequest.getParameter(Authentication.RECAPTCHA_RESPONSE_PARAM);
+		  String recaptcha_response = request.getParameter(Authentication.RECAPTCHA_RESPONSE_PARAM);
 		  String secret_key = securityResponse.getAttribute(GSXML.SECRET_KEY_ATT);
 		  int result = Authentication.verifyRecaptcha(secret_key, recaptcha_response);
@@ -286,5 +569,5 @@
 		  if (result == Authentication.NO_ERROR) {
 		    logger.error("RECAPTCHA SUCCESS, hopefully going to the document");
-
+		    already_verified = true;
 		    
 		  } else {
@@ -294,27 +577,31 @@
 		    String new_url = context.getContextPath()+"/"+ library_name+"?a=p&sa=error&c="+collection+"&ec=recap_fail";				
 		    ((HttpServletResponse)response).sendRedirect(new_url);
-						
+		    
 		    return;
 		  }
-
-		  // store the fact that user has verified
-		  UserTimer timer = new UserTimer(verifiedUserTimeout, session_id);
-		  verifiedUserMap.put(session_id, timer);
-		  timer.start();
+		    
+		    
 		  
 		}
-					    
-	      } else {
-		// hmvf param is not set - we haven't shown them the form yet
-		// we need to display the verify page
-		logger.error("KATH display verify page");
-		//String new_url = context.getContextPath()+"/"+ context.getAttribute("LibraryName")+"?a=p&sa=verify&c="+collection+"&url="+url;
-		String new_url = context.getContextPath()+"/"+ library_name+"?a=p&sa=verify&c="+collection+"&url="+url;			    
-		((HttpServletResponse)response).sendRedirect(new_url);
-		return;
-	      }
+		already_verified = true;
+		// store the fact that user has verified
+		UserTimer timer = new UserTimer(verifiedUserTimeout, session_id);
+		verifiedUserMap.put(session_id, timer);
+		timer.start();
+		
+	      } // hmvf = 1
 	    }
-	  } // end if we are asked to verify it
-	} // end if verifiable file
+	  }
+	  if (!already_verified) {
+	    // hmvf param is not set - we haven't shown them the form yet
+	    // or we have been asked to force the T&C
+	    // we need to display the verify page
+	    logger.error("KATH display verify page");
+	    //String new_url = context.getContextPath()+"/"+ context.getAttribute("LibraryName")+"?a=p&sa=verify&c="+collection+"&url="+url;
+	    String new_url = context.getContextPath()+"/"+ library_name+"?a=p&sa=verify&c="+collection+"&url="+url;			    
+	    ((HttpServletResponse)response).sendRedirect(new_url);
+	    return;
+	  }
+	} // end if verifiable file && need to verify
     
 			
@@ -330,259 +617,8 @@
 
 	return;
-    }
-    else if (url.contains(INTERFACE_PATH))
-      {			    
-	String fileURL = url.replaceFirst(context.getContextPath(), "");
-	File requestedFile = new File(context.getRealPath(fileURL));
-
-	if (!requestedFile.exists())
-	  {
-	    int interfaceNameStart = fileURL.indexOf(INTERFACE_PATH) + INTERFACE_PATH.length();
-	    int interfaceNameEnd = fileURL.indexOf("/", interfaceNameStart);
-	    String interfaceName = fileURL.substring(interfaceNameStart, interfaceNameEnd);
-	    String interfacesDir = fileURL.substring(0, interfaceNameStart);
-	    File interfaceConfigFile = new File(context.getRealPath(interfacesDir + interfaceName + "/interfaceConfig.xml"));
-
-	    if (interfaceConfigFile.exists())
-	      {
-		Document interfaceConfigDoc = XMLConverter.getDOM(interfaceConfigFile);
-
-		String baseInterface = interfaceConfigDoc.getDocumentElement().getAttribute("baseInterface");
-		if (baseInterface.length() > 0)
-		  {
-		    File baseInterfaceFile = new File(context.getRealPath(fileURL.replace("/" + interfaceName + "/", "/" + baseInterface + "/")));
-		    if (baseInterfaceFile.exists())
-		      {
-			ServletOutputStream out = response.getOutputStream();
-			out.write(FileUtils.readFileToByteArray(baseInterfaceFile));
-			out.flush();
-			out.close();
-			return;
-		      }
-		  }
-	      }
-	  }
-      }
-    else
-      {
-	ArrayList<String> keywords = new ArrayList<String>();
-	keywords.add(PAGE_PATH);
-	keywords.add(BROWSE_PATH);
-	keywords.add(SEARCH_PATH);
-	keywords.add(DOCUMENT_PATH);
-	//If we have a jsessionid on the end of our URL we want to ignore it
-	int index;
-	if ((index = url.indexOf(";jsessionid")) != -1)
-	  {
-	    url = url.substring(0, index);
-	  }
-	String[] segments = url.split("/");
-	for (int i = 0; i < segments.length; i++)
-	  {
-	    String[] additionalParameters = null;
-	    String[] defaultParamValues = null;
-	    //COLLECTION
-	    if (segments[i].equals(COLLECTION_PATH) && (i + 1) < segments.length) {
-	      int j=i+1;
-	      while(j+1 < segments.length && !keywords.contains(segments[j+1])) {
-		j++;
-	      }
-					  
-	      if (j>i+1) {
-		// we had a group part
-		String [] groups = Arrays.copyOfRange(segments, i+1, j);
-		String group = StringUtils.join(groups, "/");
-		gRequest.setParameter(GSParams.GROUP, group);
-	      }
-	      gRequest.setParameter(GSParams.COLLECTION, segments[j]);
-	    }
-	    // GROUP
-	    else if(segments[i].equals(GROUP_PATH) && (i + 1) < segments.length)
-	      {
-		// assume for now, no other path parts for group links
-		int j= segments.length - 1;
-		String group;
-		if (j==i+1) {
-		  group = segments[j];
-		} else {
-		  String [] groups = Arrays.copyOfRange(segments, i+1, j+1);
-		  group = StringUtils.join(groups, "/");
-		}
-		gRequest.setParameter(GSParams.GROUP, group);
-		gRequest.setParameter(GSParams.ACTION, "p");
-		gRequest.setParameter(GSParams.SUBACTION, "home");
-					    
-	      }
-	    //DOCUMENT
-	    else if (segments[i].equals(DOCUMENT_PATH) && (i + 1) < segments.length)
-	      {
-		gRequest.setParameter(GSParams.DOCUMENT, segments[i + 1]);
-						
-		additionalParameters = new String[] { GSParams.ACTION };
-		defaultParamValues = new String[] { "d" };
-		if ((i+2) < segments.length && segments[i+2].equals("print")) {
-		  gRequest.setParameter(GSParams.SUBACTION, "print");
-		  gRequest.setParameter("ed", "1");
-						  
-		}
-					
-	      }
-	    //PAGE
-	    else if (segments[i].equals(PAGE_PATH) && (i + 1) < segments.length)
-	      {
-		gRequest.setParameter(GSParams.SUBACTION, segments[i + 1]);
-
-		additionalParameters = new String[] { GSParams.ACTION };
-		defaultParamValues = new String[] { "p" };
-	      }
-	    //SYSTEM
-	    else if (segments[i].equals(SYSTEM_PATH) && (i + 1) < segments.length)
-	      {
-		String sa = segments[i + 1];
-		if (sa.equals(SYSTEM_SUBACTION_CONFIGURE) || sa.equals(SYSTEM_SUBACTION_RECONFIGURE))
-		  {
-		    sa = "c";
-		  }
-		else if (sa.equals(SYSTEM_SUBACTION_ACTIVATE))
-		  {
-		    sa = "a";
-		  }
-		else if (sa.equals(SYSTEM_SUBACTION_DEACTIVATE))
-		  {
-		    sa = "d";
-		  }
-
-		if (sa.equals("c") && (i + 2) < segments.length)
-		  {
-		    gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
-		  }
-
-		if (sa.equals("a") && (i + 2) < segments.length)
-		  {
-		    gRequest.setParameter(GSParams.SYSTEM_MODULE_TYPE, "collection");
-		    gRequest.setParameter(GSParams.SYSTEM_MODULE_NAME, segments[i + 2]);
-		  }
-
-		if (sa.equals("d") && (i + 2) < segments.length)
-		  {
-		    gRequest.setParameter(GSParams.SYSTEM_CLUSTER, segments[i + 2]);
-		  }
-
-		gRequest.setParameter(GSParams.SUBACTION, sa);
-
-		additionalParameters = new String[] { GSParams.ACTION };
-		defaultParamValues = new String[] { "s" };
-	      }
-	    //ADMIN
-	    else if (segments[i].equals("admin") && (i + 1) < segments.length)
-	      {
-		String pageName = segments[i + 1];
-
-		gRequest.setParameter("s1.authpage", pageName);
-
-		additionalParameters = new String[] { GSParams.ACTION, GSParams.REQUEST_TYPE, GSParams.SUBACTION, GSParams.SERVICE };
-		defaultParamValues = new String[] { "g", "r", "authen", "Authentication" };
-	      }
-	    //BROWSE
-	    else if (segments[i].equals(BROWSE_PATH) && (i + 1) < segments.length)
-	      {
-		String cl = "";
-		for (int j = 1; (i + j) < segments.length; j++)
-		  {
-		    String currentSegment = segments[i + j].replace("CL", "").replace("cl", "");
-		    if (currentSegment.contains("."))
-		      {
-			String[] subsegments = currentSegment.split("\\.");
-			for (String subsegment : subsegments)
-			  {
-			    subsegment = subsegment.replace("CL", "").replace("cl", "");
-
-			    if (cl.length() > 0)
-			      {
-				cl += ".";
-			      }
-
-			    if (subsegment.length() > 0)
-			      {
-				cl += subsegment;
-			      }
-			  }
-			continue;
-		      }
-		    if (!currentSegment.matches("^(CL|cl)?\\d+$"))
-		      {
-			continue;
-		      }
-
-		    if (cl.length() > 0)
-		      {
-			cl += ".";
-		      }
-
-		    cl += currentSegment;
-		  }
-
-		gRequest.setParameter("cl", "CL" + cl);
-
-		additionalParameters = new String[] { GSParams.ACTION, GSParams.REQUEST_TYPE, GSParams.SERVICE };
-		defaultParamValues = new String[] { "b", "s", "ClassifierBrowse" };
-	      }
-	    //QUERY
-	    else if (segments[i].equals(SEARCH_PATH))
-	      {
-		String serviceName = "";
-		if ((i + 1) < segments.length)
-		  {
-		    serviceName = segments[i + 1];
-		    gRequest.setParameter("s", serviceName);
-
-		    additionalParameters = new String[] { GSParams.ACTION, GSParams.SUBACTION, GSParams.REQUEST_TYPE };
-		    defaultParamValues = new String[] { "q", "", "d" };
-		  }
-		if ((i + 2) < segments.length)
-		  {
-		    if (serviceName.equals("TextQuery") || serviceName.equals("RawQuery"))
-		      {
-
-			gRequest.setParameter("s1.query", segments[i + 2]);
-		      }
-		    else if (serviceName.equals("FieldQuery"))
-		      {
-			gRequest.setParameter("s1.fqv", segments[i + 2]);
-		      }
-		    else if (serviceName.equals("AdvancedFieldQuery"))
-		      {
-			gRequest.setParameter("s1.fqv", segments[i + 2]);
-		      }
-		  }
-	      }
-	    if (additionalParameters != null)
-	      {
-		for (int j = 0; j < additionalParameters.length; j++)
-		  {
-		    if (gRequest.getParameter(additionalParameters[j]) == null)
-		      {
-			gRequest.setParameter(additionalParameters[j], defaultParamValues[j]);
-		      }
-		  }
-	      }
-	  }
-      }
-
-    chain.doFilter(gRequest, response);
-  }
-
-  private boolean isURLRestricted(String url)
-  {
-    for (String restrictedURL : _restrictedURLs)
-      {
-	if (url.matches(".*" + restrictedURL + ".*"))
-	  {
-	    return true;
-	  }
-      }
-
-    return false;
-  }
+  }
+
+
+
 
   private String queryMRforDOCID(MessageRouter gsRouter, String collection, String assocfiledir) {
