Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 25128)
@@ -14,5 +14,4 @@
 import javax.servlet.http.*;
 
-import java.security.Principal;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -99,5 +98,5 @@
 	 */
 	protected Hashtable session_ids_table = new Hashtable();
-	
+
 	/**
 	 * the maximum interval that the cached info remains in session_ids_table
@@ -722,12 +721,35 @@
 			request.login(username[0], password[0]);
 		}
-		
-		if(request.getAuthType() != null)
+
+		if (request.getAuthType() != null)
 		{
 			Element userInformation = this.doc.createElement("userInformation");
 			xml_request.appendChild(userInformation);
 			userInformation.setAttribute("username", request.getUserPrincipal().getName());
-		}
-			
+
+			Element userInfoMessage = this.doc.createElement(GSXML.MESSAGE_ELEM);
+			Element userInfoRequest = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_SECURITY, "GetUserInformation", userContext);
+			userInfoMessage.appendChild(userInfoRequest);
+
+			Element paramList = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
+			userInfoRequest.appendChild(paramList);
+
+			Element param = this.doc.createElement(GSXML.PARAM_ELEM);
+			param.setAttribute(GSXML.NAME_ATT, "username");
+			param.setAttribute(GSXML.VALUE_ATT, request.getUserPrincipal().getName());
+			paramList.appendChild(param);
+
+			Element userInformationResponse = (Element) GSXML.getChildByTagName(this.recept.process(userInfoMessage), GSXML.RESPONSE_ELEM);
+			Element responseParamList = (Element) GSXML.getChildByTagName(userInformationResponse, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
+			if (responseParamList == null)
+			{
+				logger.error("Can't get the groups for user " + request.getUserPrincipal().getName());
+			}
+
+			HashMap responseParams = GSXML.extractParams(responseParamList, true);
+			String groups = (String) responseParams.get("groups");
+
+			userInformation.setAttribute("groups", groups);
+		}
 
 		//If we are in a collection-related page then make sure this user is allowed to access it
@@ -771,8 +793,8 @@
 					Element paramList = this.doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
 					loginPageRequest.appendChild(paramList);
-					
+
 					Element messageParam = this.doc.createElement(GSXML.PARAM_ELEM);
 					messageParam.setAttribute(GSXML.NAME_ATT, "loginMessage");
-					if(request.getAuthType() == null)
+					if (request.getAuthType() == null)
 					{
 						messageParam.setAttribute(GSXML.VALUE_ATT, "Please log in to view this page");
@@ -780,8 +802,8 @@
 					else
 					{
-						messageParam.setAttribute(GSXML.VALUE_ATT, "You are not in the correct group to view this page");
+						messageParam.setAttribute(GSXML.VALUE_ATT, "You are not in the correct group to view this page, would you like to log in as a different user?");
 					}
 					paramList.appendChild(messageParam);
-					
+
 					Element urlParam = this.doc.createElement(GSXML.PARAM_ELEM);
 					urlParam.setAttribute(GSXML.NAME_ATT, "redirectURL");
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 25128)
@@ -255,3 +255,15 @@
 	}
 
+	protected void addInterfaceOptions(Element elem)
+	{
+		Element documentOptionList = this.doc.createElement("interfaceOptions");
+		for(Object key : this.config_params.keySet())
+		{
+			Element option = this.doc.createElement("option");
+			option.setAttribute(GSXML.NAME_ATT, (String)key);
+			option.setAttribute(GSXML.VALUE_ATT, this.config_params.get(key).toString());
+			documentOptionList.appendChild(option);
+		}
+		elem.appendChild(elem.getOwnerDocument().importNode(documentOptionList, true));
+	}
 }
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/BrowseAction.java	(revision 25128)
@@ -92,4 +92,5 @@
 	//append site metadata
 	addSiteMetadata(page_response, userContext);
+	addInterfaceOptions(page_response);
 
 	// if rt=d, then we are just displaying the service
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java	(revision 25128)
@@ -147,4 +147,5 @@
 		//append site metadata
 		addSiteMetadata(page_response, userContext);
+		addInterfaceOptions(page_response);
 
 		// get the additional data needed for the page
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 25128)
@@ -86,4 +86,5 @@
 		//append site metadata
 		addSiteMetadata(page_response, userContext);
+		addInterfaceOptions(page_response);
 
 		// if rt=d, then we are just displaying the service
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GeneralAction.java	(revision 25128)
@@ -2,9 +2,21 @@
 
 import org.greenstone.gsdl3.util.*;
+import org.greenstone.util.GlobalProperties;
 // XML classes
+import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
 
+import java.io.File;
 import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
 
 public class GeneralAction extends Action
@@ -31,4 +43,13 @@
 		Element cgi_param_list = (Element) GSXML.getChildByTagName(request, GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER);
 		HashMap params = GSXML.extractParams(cgi_param_list, false);
+
+		if (params.get("configChangeName") != null && params.get("configChangeValue") != null)
+		{
+			String optionName = (String) params.get("configChangeName");
+			String optionValue = (String) params.get("configChangeValue");
+			
+			changeConfig(optionName, optionValue);
+		}
+
 		String service_name = (String) params.get(GSParams.SERVICE);
 		String cluster_name = (String) params.get(GSParams.CLUSTER);
@@ -66,6 +87,6 @@
 			Element mr_query_message = this.doc.createElement(GSXML.MESSAGE_ELEM);
 			Element mr_query_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_PROCESS, to, userContext);
-			
-			if(request_type.equals("s"))
+
+			if (request_type.equals("s"))
 			{
 				mr_query_request.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_STATUS);
@@ -91,4 +112,5 @@
 				// just send the reponse as is
 				addSiteMetadata(result_response, userContext);
+				addInterfaceOptions(result_response);
 				return result_response;
 			}
@@ -107,5 +129,5 @@
 		mr_info_message.appendChild(mr_info_request);
 		Element mr_info_response = (Element) this.mr.process(mr_info_message);
-		
+
 		String path = GSXML.RESPONSE_ELEM;
 		path = GSPath.appendLink(path, GSXML.SERVICE_ELEM);
@@ -118,7 +140,52 @@
 
 		addSiteMetadata(page_response, userContext);
-		
+		addInterfaceOptions(page_response);
+
 		return result;
 	}
+	
+	protected void changeConfig (String optionName, String optionValue)
+	{
+		if(this.config_params.get(optionName) != null)
+		{
+			this.config_params.put(optionName, optionValue);
+			
+			File interfaceConfigFile = new File(GSFile.interfaceConfigFile(GSFile.interfaceHome(GlobalProperties.getGSDL3Home(), (String)this.config_params.get("interface_name"))));
+			
+			Document interfaceXML = null;
+			try
+			{
+				DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+				DocumentBuilder db = dbf.newDocumentBuilder();
+				interfaceXML = db.parse(interfaceConfigFile);
+				Element topElement = interfaceXML.getDocumentElement();
+				Element optionListElem = (Element) GSXML.getChildByTagName(topElement, "optionList");
 
+				NodeList optionList = optionListElem.getElementsByTagName("option");
+				
+				for(int i = 0; i < optionList.getLength(); i++)
+				{
+					Element currentOption = (Element)optionList.item(i);
+					if(currentOption.getAttribute(GSXML.NAME_ATT) != null && currentOption.getAttribute(GSXML.NAME_ATT).equals(optionName))
+					{
+						currentOption.setAttribute(GSXML.VALUE_ATT, optionValue);
+					}
+				}
+				
+				DOMSource source = new DOMSource(interfaceXML);
+				Result xmlresult = new StreamResult(interfaceConfigFile);
+
+				Transformer transformer = TransformerFactory.newInstance().newTransformer();
+				transformer.transform(source, xmlresult);
+			}
+			catch(Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+		else
+		{
+			logger.error("Could not set param \"" + optionName + "\" to \"" + optionValue + "\" because that option does not exist.");
+		}
+	}
 }
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java	(revision 25128)
@@ -17,5 +17,4 @@
 public class PageAction extends Action
 {
-
 	static Logger logger = Logger.getLogger(org.greenstone.gsdl3.action.PageAction.class.getName());
 
@@ -27,5 +26,4 @@
 	public Node process(Node message_node)
 	{
-
 		Element message = this.converter.nodeToElement(message_node);
 
@@ -68,5 +66,4 @@
 	protected Element homePage(Element request)
 	{
-
 		UserContext userContext = new UserContext(request);
 		// first, get the message router info
@@ -130,5 +127,4 @@
 	protected Element aboutPage(Element request)
 	{
-
 		UserContext userContext = new UserContext(request);
 		// extract the params from the cgi-request, 
@@ -143,4 +139,5 @@
 			Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
 			addSiteMetadata(response, userContext);
+			addInterfaceOptions(response);
 			return response;
 		}
@@ -200,4 +197,5 @@
 		//add the site metadata
 		addSiteMetadata(response, userContext);
+		addInterfaceOptions(response);
 		return response;
 	}
@@ -224,4 +222,5 @@
 			Element response = this.doc.createElement(GSXML.RESPONSE_ELEM);
 			addSiteMetadata(response, userContext);
+			addInterfaceOptions(response);
 			return response;
 		}
@@ -242,4 +241,5 @@
 		//add the site metadata
 		addSiteMetadata(response, userContext);
+		addInterfaceOptions(response);
 
 		return response;
@@ -249,5 +249,4 @@
 	protected boolean sendMultipleRequests(NodeList items, String path_prefix, String request_type, UserContext userContext)
 	{
-
 		// we will send all the requests in a single message
 		Element message = this.doc.createElement(GSXML.MESSAGE_ELEM);
@@ -321,4 +320,3 @@
 		return page_response;
 	}
-
 }
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java	(revision 25127)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/QueryAction.java	(revision 25128)
@@ -97,4 +97,5 @@
 			//append site metadata
 			addSiteMetadata(page_response, userContext);
+			addInterfaceOptions(page_response);
 			return page_response;
 		}
@@ -106,4 +107,5 @@
 			//append site metadata
 			addSiteMetadata(page_response, userContext);
+			addInterfaceOptions(page_response);
 			return page_response;
 		}
@@ -132,4 +134,5 @@
 			//append site metadata
 			addSiteMetadata(page_response, userContext);
+			addInterfaceOptions(page_response);
 			return page_response;
 		}
@@ -168,4 +171,5 @@
 			//append site metadata
 			addSiteMetadata(page_response, userContext);
+			addInterfaceOptions(page_response);
 			return page_response;
 		}
@@ -180,4 +184,5 @@
 			//append site metadata
 			addSiteMetadata(page_response, userContext);
+			addInterfaceOptions(page_response);
 			return page_response;
 		}
@@ -236,4 +241,5 @@
 		//append site metadata
 		addSiteMetadata(page_response, userContext);
+		addInterfaceOptions(page_response);
 		return page_response;
 	}
