You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2013/07/15 16:02:30 UTC

svn commit: r1503255 [2/3] - in /manifoldcf/trunk: ./ connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors...

Modified: manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java (original)
+++ manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java Mon Jul 15 14:02:29 2013
@@ -740,24 +740,26 @@ public class JDBCConnector extends org.a
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
-    String jdbcProvider = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.providerParameter);
+    String jdbcProvider = parameters.getParameter(JDBCConstants.providerParameter);
     if (jdbcProvider == null)
       jdbcProvider = "oracle:thin:@";
-    String accessMethod = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.methodParameter);
+    String accessMethod = parameters.getParameter(JDBCConstants.methodParameter);
     if (accessMethod == null)
       accessMethod = "name";
-    String host = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.hostParameter);
+    String host = parameters.getParameter(JDBCConstants.hostParameter);
     if (host == null)
       host = "localhost";
-    String databaseName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseNameParameter);
+    String databaseName = parameters.getParameter(JDBCConstants.databaseNameParameter);
     if (databaseName == null)
       databaseName = "database";
-    String databaseUser = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserName);
+    String databaseUser = parameters.getParameter(JDBCConstants.databaseUserName);
     if (databaseUser == null)
       databaseUser = "";
-    String databasePassword = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databasePassword);
+    String databasePassword = parameters.getObfuscatedParameter(JDBCConstants.databasePassword);
     if (databasePassword == null)
       databasePassword = "";
+    else
+      databasePassword = out.mapPasswordToKey(databasePassword);
 
     // "Database Type" tab
     if (tabName.equals(Messages.getString(locale,"JDBCConnector.DatabaseType")))
@@ -859,27 +861,27 @@ public class JDBCConnector extends org.a
   {
     String type = variableContext.getParameter("databasetype");
     if (type != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.providerParameter,type);
+      parameters.setParameter(JDBCConstants.providerParameter,type);
 
     String accessMethod = variableContext.getParameter("accessmethod");
     if (accessMethod != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.methodParameter,accessMethod);
+      parameters.setParameter(JDBCConstants.methodParameter,accessMethod);
 
     String host = variableContext.getParameter("databasehost");
     if (host != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.hostParameter,host);
+      parameters.setParameter(JDBCConstants.hostParameter,host);
 
     String databaseName = variableContext.getParameter("databasename");
     if (databaseName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseNameParameter,databaseName);
+      parameters.setParameter(JDBCConstants.databaseNameParameter,databaseName);
 
     String userName = variableContext.getParameter("username");
     if (userName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserName,userName);
+      parameters.setParameter(JDBCConstants.databaseUserName,userName);
 
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databasePassword,password);
+      parameters.setObfuscatedParameter(JDBCConstants.databasePassword,variableContext.mapKeyToPassword(password));
     
     return null;
   }
@@ -1063,19 +1065,19 @@ public class JDBCConnector extends org.a
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.idQueryNode))
+      if (sn.getType().equals(JDBCConstants.idQueryNode))
       {
         idQuery = sn.getValue();
         if (idQuery == null)
           idQuery = "";
       }
-      else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.versionQueryNode))
+      else if (sn.getType().equals(JDBCConstants.versionQueryNode))
       {
         versionQuery = sn.getValue();
         if (versionQuery == null)
           versionQuery = "";
       }
-      else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.dataQueryNode))
+      else if (sn.getType().equals(JDBCConstants.dataQueryNode))
       {
         dataQuery = sn.getValue();
         if (dataQuery == null)
@@ -1223,12 +1225,12 @@ public class JDBCConnector extends org.a
       int i = 0;
       while (i < ds.getChildCount())
       {
-        if (ds.getChild(i).getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.idQueryNode))
+        if (ds.getChild(i).getType().equals(JDBCConstants.idQueryNode))
           ds.removeChild(i);
         else
           i++;
       }
-      sn = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.idQueryNode);
+      sn = new SpecificationNode(JDBCConstants.idQueryNode);
       sn.setValue(idQuery);
       ds.addChild(ds.getChildCount(),sn);
     }
@@ -1237,12 +1239,12 @@ public class JDBCConnector extends org.a
       int i = 0;
       while (i < ds.getChildCount())
       {
-        if (ds.getChild(i).getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.versionQueryNode))
+        if (ds.getChild(i).getType().equals(JDBCConstants.versionQueryNode))
           ds.removeChild(i);
         else
           i++;
       }
-      sn = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.versionQueryNode);
+      sn = new SpecificationNode(JDBCConstants.versionQueryNode);
       sn.setValue(versionQuery);
       ds.addChild(ds.getChildCount(),sn);
     }
@@ -1251,12 +1253,12 @@ public class JDBCConnector extends org.a
       int i = 0;
       while (i < ds.getChildCount())
       {
-        if (ds.getChild(i).getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.dataQueryNode))
+        if (ds.getChild(i).getType().equals(JDBCConstants.dataQueryNode))
           ds.removeChild(i);
         else
           i++;
       }
-      sn = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.dataQueryNode);
+      sn = new SpecificationNode(JDBCConstants.dataQueryNode);
       sn.setValue(dataQuery);
       ds.addChild(ds.getChildCount(),sn);
     }
@@ -1326,19 +1328,19 @@ public class JDBCConnector extends org.a
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.idQueryNode))
+      if (sn.getType().equals(JDBCConstants.idQueryNode))
       {
         idQuery = sn.getValue();
         if (idQuery == null)
           idQuery = "";
       }
-      else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.versionQueryNode))
+      else if (sn.getType().equals(JDBCConstants.versionQueryNode))
       {
         versionQuery = sn.getValue();
         if (versionQuery == null)
           versionQuery = "";
       }
-      else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.dataQueryNode))
+      else if (sn.getType().equals(JDBCConstants.dataQueryNode))
       {
         dataQuery = sn.getValue();
         if (dataQuery == null)
@@ -1784,19 +1786,19 @@ public class JDBCConnector extends org.a
       while (i < ds.getChildCount())
       {
         SpecificationNode sn = ds.getChild(i++);
-        if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.idQueryNode))
+        if (sn.getType().equals(JDBCConstants.idQueryNode))
         {
           idQuery = sn.getValue();
           if (idQuery == null)
             idQuery = "";
         }
-        else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.versionQueryNode))
+        else if (sn.getType().equals(JDBCConstants.versionQueryNode))
         {
           versionQuery = sn.getValue();
           if (versionQuery == null)
             versionQuery = "";
         }
-        else if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.dataQueryNode))
+        else if (sn.getType().equals(JDBCConstants.dataQueryNode))
         {
           dataQuery = sn.getValue();
           if (dataQuery == null)

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraAuthorityConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraAuthorityConnector.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraAuthorityConnector.java Mon Jul 15 14:02:29 2013
@@ -39,6 +39,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.commons.lang.StringUtils;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import java.util.Map.Entry;
@@ -218,7 +219,7 @@ public class JiraAuthorityConnector exte
    * @param newMap is the map to fill in
    * @param parameters is the current set of configuration parameters
    */
-  private static void fillInServerConfigurationMap(Map<String, Object> newMap, ConfigParams parameters) {
+  private static void fillInServerConfigurationMap(Map<String, Object> newMap, IPasswordMapperActivity mapper, ConfigParams parameters) {
     String jiraprotocol = parameters.getParameter(JiraConfig.JIRA_PROTOCOL_PARAM);
     String jirahost = parameters.getParameter(JiraConfig.JIRA_HOST_PARAM);
     String jiraport = parameters.getParameter(JiraConfig.JIRA_PORT_PARAM);
@@ -239,6 +240,8 @@ public class JiraAuthorityConnector exte
       clientid = JiraConfig.CLIENT_ID_DEFAULT;
     if (clientsecret == null)
       clientsecret = JiraConfig.CLIENT_SECRET_DEFAULT;
+    else
+      clientsecret = mapper.mapPasswordToKey(clientsecret);
 
     newMap.put("JIRAPROTOCOL", jiraprotocol);
     newMap.put("JIRAHOST", jirahost);
@@ -266,7 +269,7 @@ public class JiraAuthorityConnector exte
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     Messages.outputResourceWithVelocity(out,locale,VIEW_CONFIG_FORWARD,paramMap);
   }
@@ -295,7 +298,7 @@ public class JiraAuthorityConnector exte
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_HEADER_FORWARD,paramMap);
@@ -314,7 +317,7 @@ public class JiraAuthorityConnector exte
 
     // Server tab
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_FORWARD_SERVER,paramMap);
   }
 
@@ -362,7 +365,7 @@ public class JiraAuthorityConnector exte
 
     String clientsecret = variableContext.getParameter("clientsecret");
     if (clientsecret != null)
-      parameters.setObfuscatedParameter(JiraConfig.CLIENT_SECRET_PARAM, clientsecret);
+      parameters.setObfuscatedParameter(JiraConfig.CLIENT_SECRET_PARAM, variableContext.mapKeyToPassword(clientsecret));
 
     return null;
   }

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java Mon Jul 15 14:02:29 2013
@@ -42,6 +42,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.commons.lang.StringUtils;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.SpecificationNode;
@@ -314,7 +315,7 @@ public class JiraRepositoryConnector ext
    * @param newMap is the map to fill in
    * @param parameters is the current set of configuration parameters
    */
-  private static void fillInServerConfigurationMap(Map<String, Object> newMap, ConfigParams parameters) {
+  private static void fillInServerConfigurationMap(Map<String, Object> newMap, IPasswordMapperActivity mapper, ConfigParams parameters) {
     String jiraprotocol = parameters.getParameter(JiraConfig.JIRA_PROTOCOL_PARAM);
     String jirahost = parameters.getParameter(JiraConfig.JIRA_HOST_PARAM);
     String jiraport = parameters.getParameter(JiraConfig.JIRA_PORT_PARAM);
@@ -335,6 +336,8 @@ public class JiraRepositoryConnector ext
       clientid = JiraConfig.CLIENT_ID_DEFAULT;
     if (clientsecret == null)
       clientsecret = JiraConfig.CLIENT_SECRET_DEFAULT;
+    else
+      clientsecret = mapper.mapPasswordToKey(clientsecret);
 
     newMap.put("JIRAPROTOCOL", jiraprotocol);
     newMap.put("JIRAHOST", jirahost);
@@ -362,7 +365,7 @@ public class JiraRepositoryConnector ext
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     Messages.outputResourceWithVelocity(out,locale,VIEW_CONFIG_FORWARD,paramMap);
   }
@@ -391,7 +394,7 @@ public class JiraRepositoryConnector ext
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_HEADER_FORWARD,paramMap);
@@ -410,7 +413,7 @@ public class JiraRepositoryConnector ext
 
     // Server tab
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_FORWARD_SERVER,paramMap);
   }
 
@@ -458,7 +461,7 @@ public class JiraRepositoryConnector ext
 
     String clientsecret = variableContext.getParameter("clientsecret");
     if (clientsecret != null)
-      parameters.setObfuscatedParameter(JiraConfig.CLIENT_SECRET_PARAM, clientsecret);
+      parameters.setObfuscatedParameter(JiraConfig.CLIENT_SECRET_PARAM, variableContext.mapKeyToPassword(clientsecret));
 
     return null;
   }

Modified: manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java (original)
+++ manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java Mon Jul 15 14:02:29 2013
@@ -538,6 +538,7 @@ public class LDAPAuthority extends org.a
     } catch (ManifoldCFException ex) {
       //ignore
     }
+    fBindPass = out.mapPasswordToKey(fBindPass);
 
     if (tabName.equals(Messages.getString(locale, "LDAP.LDAP"))) {
       out.print(
@@ -676,7 +677,7 @@ public class LDAPAuthority extends org.a
     copyParam(variableContext, parameters, "ldapBindUser");
     String bindPass = variableContext.getParameter("ldapBindPass");
     if (bindPass != null) {
-      parameters.setParameter("ldapBindPass", ManifoldCF.obfuscate(bindPass));
+      parameters.setObfuscatedParameter("ldapBindPass", variableContext.mapKeyToPassword(bindPass));
     }
 
     return null;

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java (original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java Mon Jul 15 14:02:29 2013
@@ -711,6 +711,8 @@ public class LivelinkAuthority extends o
     String serverPassword = parameters.getObfuscatedParameter(LiveLinkParameters.serverPassword);
     if (serverPassword == null)
       serverPassword = "";
+    else
+      serverPassword = out.mapPasswordToKey(serverPassword);
     String serverHTTPCgiPath = parameters.getParameter(LiveLinkParameters.serverHTTPCgiPath);
     if (serverHTTPCgiPath == null)
       serverHTTPCgiPath = "/livelink/livelink.exe";
@@ -723,6 +725,8 @@ public class LivelinkAuthority extends o
     String serverHTTPNTLMPassword = parameters.getObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword);
     if (serverHTTPNTLMPassword == null)
       serverHTTPNTLMPassword = "";
+    else
+      serverHTTPNTLMPassword = out.mapPasswordToKey(serverHTTPNTLMPassword);
     String serverHTTPSKeystore = parameters.getParameter(LiveLinkParameters.serverHTTPSKeystore);
     IKeystoreManager localServerHTTPSKeystore;
     if (serverHTTPSKeystore == null)
@@ -969,7 +973,7 @@ public class LivelinkAuthority extends o
       parameters.setParameter(LiveLinkParameters.serverUsername,serverUserName);
     String serverPassword = variableContext.getParameter("serverpassword");
     if (serverPassword != null)
-      parameters.setObfuscatedParameter(LiveLinkParameters.serverPassword,serverPassword);
+      parameters.setObfuscatedParameter(LiveLinkParameters.serverPassword,variableContext.mapKeyToPassword(serverPassword));
     String serverHTTPCgiPath = variableContext.getParameter("serverhttpcgipath");
     if (serverHTTPCgiPath != null)
       parameters.setParameter(LiveLinkParameters.serverHTTPCgiPath,serverHTTPCgiPath);
@@ -981,7 +985,7 @@ public class LivelinkAuthority extends o
       parameters.setParameter(LiveLinkParameters.serverHTTPNTLMUsername,serverHTTPNTLMUserName);
     String serverHTTPNTLMPassword = variableContext.getParameter("serverhttpntlmpassword");
     if (serverHTTPNTLMPassword != null)
-      parameters.setObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword,serverHTTPNTLMPassword);
+      parameters.setObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword,variableContext.mapKeyToPassword(serverHTTPNTLMPassword));
     String serverHTTPSKeystoreValue = variableContext.getParameter("serverhttpskeystoredata");
     if (serverHTTPSKeystoreValue != null)
       parameters.setParameter(LiveLinkParameters.serverHTTPSKeystore,serverHTTPSKeystoreValue);

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java (original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java Mon Jul 15 14:02:29 2013
@@ -1776,6 +1776,8 @@ public class LivelinkConnector extends o
     String serverPassword = parameters.getObfuscatedParameter(LiveLinkParameters.serverPassword);
     if (serverPassword == null)
       serverPassword = "";
+    else
+      serverPassword = out.mapPasswordToKey(serverPassword);
     String serverHTTPCgiPath = parameters.getParameter(LiveLinkParameters.serverHTTPCgiPath);
     if (serverHTTPCgiPath == null)
       serverHTTPCgiPath = "/livelink/livelink.exe";
@@ -1788,6 +1790,8 @@ public class LivelinkConnector extends o
     String serverHTTPNTLMPassword = parameters.getObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword);
     if (serverHTTPNTLMPassword == null)
       serverHTTPNTLMPassword = "";
+    else
+      serverHTTPNTLMPassword = out.mapPasswordToKey(serverHTTPNTLMPassword);
     String serverHTTPSKeystore = parameters.getParameter(LiveLinkParameters.serverHTTPSKeystore);
     IKeystoreManager localServerHTTPSKeystore;
     if (serverHTTPSKeystore == null)
@@ -1811,6 +1815,8 @@ public class LivelinkConnector extends o
     String ingestNtlmPassword = parameters.getObfuscatedParameter(LiveLinkParameters.ingestNtlmPassword);
     if (ingestNtlmPassword == null)
       ingestNtlmPassword = "";
+    else
+      ingestNtlmPassword = out.mapPasswordToKey(ingestNtlmPassword);
     String ingestNtlmDomain = parameters.getParameter(LiveLinkParameters.ingestNtlmDomain);
     if (ingestNtlmDomain == null)
       ingestNtlmDomain = "";
@@ -2160,7 +2166,7 @@ public class LivelinkConnector extends o
       parameters.setParameter(LiveLinkParameters.serverUsername,serverUserName);
     String serverPassword = variableContext.getParameter("serverpassword");
     if (serverPassword != null)
-      parameters.setObfuscatedParameter(LiveLinkParameters.serverPassword,serverPassword);
+      parameters.setObfuscatedParameter(LiveLinkParameters.serverPassword,variableContext.mapKeyToPassword(serverPassword));
     String serverHTTPCgiPath = variableContext.getParameter("serverhttpcgipath");
     if (serverHTTPCgiPath != null)
       parameters.setParameter(LiveLinkParameters.serverHTTPCgiPath,serverHTTPCgiPath);
@@ -2172,7 +2178,7 @@ public class LivelinkConnector extends o
       parameters.setParameter(LiveLinkParameters.serverHTTPNTLMUsername,serverHTTPNTLMUserName);
     String serverHTTPNTLMPassword = variableContext.getParameter("serverhttpntlmpassword");
     if (serverHTTPNTLMPassword != null)
-      parameters.setObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword,serverHTTPNTLMPassword);
+      parameters.setObfuscatedParameter(LiveLinkParameters.serverHTTPNTLMPassword,variableContext.mapKeyToPassword(serverHTTPNTLMPassword));
     String serverHTTPSKeystoreValue = variableContext.getParameter("serverhttpskeystoredata");
     if (serverHTTPSKeystoreValue != null)
       parameters.setParameter(LiveLinkParameters.serverHTTPSKeystore,serverHTTPSKeystoreValue);
@@ -2250,7 +2256,7 @@ public class LivelinkConnector extends o
       parameters.setParameter(LiveLinkParameters.ingestNtlmUsername,ingestNtlmUsername);
     String ingestNtlmPassword = variableContext.getParameter("ingestntlmpassword");
     if (ingestNtlmPassword != null)
-      parameters.setObfuscatedParameter(LiveLinkParameters.ingestNtlmPassword,ingestNtlmPassword);
+      parameters.setObfuscatedParameter(LiveLinkParameters.ingestNtlmPassword,variableContext.mapKeyToPassword(ingestNtlmPassword));
     String ingestKeystoreValue = variableContext.getParameter("ingestkeystoredata");
     if (ingestKeystoreValue != null)
       parameters.setParameter(LiveLinkParameters.ingestKeystore,ingestKeystoreValue);

Modified: manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java (original)
+++ manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java Mon Jul 15 14:02:29 2013
@@ -937,6 +937,8 @@ public class MeridioAuthority extends or
     String password = parameters.getObfuscatedParameter("Password");
     if (password == null)
       password = "";
+    else
+      password = out.mapPasswordToKey(password);
 
     String meridioKeystore = parameters.getParameter("MeridioKeystore");
     IKeystoreManager localKeystore;
@@ -1280,7 +1282,7 @@ public class MeridioAuthority extends or
 
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter("Password",password);
+      parameters.setObfuscatedParameter("Password",variableContext.mapKeyToPassword(password));
 
     String configOp = variableContext.getParameter("configop");
     if (configOp != null)

Modified: manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java (original)
+++ manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java Mon Jul 15 14:02:29 2013
@@ -1690,6 +1690,8 @@ public class MeridioConnector extends or
     String password = parameters.getObfuscatedParameter("Password");
     if (password == null)
       password = "";
+    else
+      password = out.mapPasswordToKey(password);
 
     String webClientProtocol = parameters.getParameter("MeridioWebClientProtocol");
     if (webClientProtocol == null)
@@ -2007,7 +2009,7 @@ public class MeridioConnector extends or
 
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter("Password",password);
+      parameters.setObfuscatedParameter("Password",variableContext.mapKeyToPassword(password));
 
     String webClientProtocol = variableContext.getParameter("webClientProtocol");
     if (webClientProtocol != null)

Propchange: manifoldcf/trunk/connectors/rss/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-737/connectors/rss:r1501867-1503249

Modified: manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java (original)
+++ manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java Mon Jul 15 14:02:29 2013
@@ -1651,6 +1651,8 @@ public class RSSConnector extends org.ap
     String proxyAuthPassword = parameters.getObfuscatedParameter(RSSConfig.PARAMETER_PROXYAUTHPASSWORD);
     if (proxyAuthPassword == null)
       proxyAuthPassword = "";
+    else
+      proxyAuthPassword = out.mapPasswordToKey(proxyAuthPassword);
       
     // Email tab
     if (tabName.equals(Messages.getString(locale,"RSSConnector.Email")))
@@ -1819,7 +1821,7 @@ public class RSSConnector extends org.ap
       parameters.setParameter(RSSConfig.PARAMETER_PROXYAUTHUSERNAME,proxyAuthUsername);
     String proxyAuthPassword = variableContext.getParameter("proxyauthpassword");
     if (proxyAuthPassword != null)
-      parameters.setObfuscatedParameter(RSSConfig.PARAMETER_PROXYAUTHPASSWORD,proxyAuthPassword);
+      parameters.setObfuscatedParameter(RSSConfig.PARAMETER_PROXYAUTHPASSWORD,variableContext.mapKeyToPassword(proxyAuthPassword));
 
     return null;
   }

Propchange: manifoldcf/trunk/connectors/sharepoint/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-737/connectors/sharepoint:r1501867-1503249

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java (original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java Mon Jul 15 14:02:29 2013
@@ -2103,6 +2103,8 @@ public class SharePointRepository extend
     String password = parameters.getObfuscatedParameter("password");
     if (password == null)
       password = "";
+    else
+      password = out.mapPasswordToKey(password);
 
     String keystore = parameters.getParameter("keystore");
     IKeystoreManager localKeystore;
@@ -2263,7 +2265,7 @@ public class SharePointRepository extend
 
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter("password",password);
+      parameters.setObfuscatedParameter("password",variableContext.mapKeyToPassword(password));
 
     String keystoreValue = variableContext.getParameter("keystoredata");
     if (keystoreValue != null)

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java (original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java Mon Jul 15 14:02:29 2013
@@ -1101,6 +1101,8 @@ public class SolrConnector extends org.a
     String password = parameters.getObfuscatedParameter(SolrConfig.PARAM_PASSWORD);
     if (password == null)
       password = "";
+    else
+      password = out.mapPasswordToKey(password);
     
     String commits = parameters.getParameter(SolrConfig.PARAM_COMMITS);
     if (commits == null)
@@ -1863,7 +1865,7 @@ public class SolrConnector extends org.a
 		
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter(SolrConfig.PARAM_PASSWORD,password);
+      parameters.setObfuscatedParameter(SolrConfig.PARAM_PASSWORD,variableContext.mapKeyToPassword(password));
     
     String maxLength = variableContext.getParameter("maxdocumentlength");
     if (maxLength != null)

Modified: manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java (original)
+++ manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java Mon Jul 15 14:02:29 2013
@@ -1860,6 +1860,8 @@ public class WebcrawlerConnector extends
     String proxyAuthPassword = parameters.getObfuscatedParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHPASSWORD);
     if (proxyAuthPassword == null)
       proxyAuthPassword = "";
+    else
+      proxyAuthPassword = out.mapPasswordToKey(proxyAuthPassword);
 
     // Proxy tab
     if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Proxy")))
@@ -2212,7 +2214,7 @@ public class WebcrawlerConnector extends
             if (domain == null)
               domain = "";
             String userName = cn.getAttributeValue(WebcrawlerConfig.ATTR_USERNAME);
-            String password = org.apache.manifoldcf.crawler.system.ManifoldCF.deobfuscate(cn.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD));
+            String password = out.mapPasswordToKey(org.apache.manifoldcf.crawler.system.ManifoldCF.deobfuscate(cn.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD)));
                                         
             // It's prefix will be...
             String prefix = "acredential_" + Integer.toString(accessCounter);
@@ -2395,6 +2397,8 @@ public class WebcrawlerConnector extends
                       String password = paramNode.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD);
                       if (password == null)
                         password = "";
+                      else
+                        password = out.mapPasswordToKey(password);
                       String authParamPrefix = authpagePrefix + "_" + paramCounter;
                       out.print(
 "                    <tr class=\""+(((paramCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
@@ -2542,7 +2546,7 @@ public class WebcrawlerConnector extends
             if (domain == null)
               domain = "";
             String userName = cn.getAttributeValue(WebcrawlerConfig.ATTR_USERNAME);
-            String password = org.apache.manifoldcf.crawler.system.ManifoldCF.deobfuscate(cn.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD));
+            String password = out.mapPasswordToKey(org.apache.manifoldcf.crawler.system.ManifoldCF.deobfuscate(cn.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD)));
 
             // It's prefix will be...
             String prefix = "acredential_" + Integer.toString(accessCounter);
@@ -2620,6 +2624,8 @@ public class WebcrawlerConnector extends
                       String password = paramNode.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD);
                       if (password == null)
                         password = "";
+                      else
+                        password = out.mapPasswordToKey(password);
                       String authParamPrefix = authpagePrefix + "_" + paramCounter;
                       out.print(
 "<input type=\"hidden\" name=\""+authParamPrefix+"_param"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(param)+"\"/>\n"+
@@ -2847,7 +2853,7 @@ public class WebcrawlerConnector extends
       parameters.setParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHUSERNAME,proxyAuthUsername);
     String proxyAuthPassword = variableContext.getParameter("proxyauthpassword");
     if (proxyAuthPassword != null)
-      parameters.setObfuscatedParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHPASSWORD,proxyAuthPassword);
+      parameters.setObfuscatedParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHPASSWORD,variableContext.mapKeyToPassword(proxyAuthPassword));
 
     String x = variableContext.getParameter("bandwidth_count");
     if (x != null && x.length() > 0)
@@ -2972,7 +2978,7 @@ public class WebcrawlerConnector extends
           node.setAttribute(WebcrawlerConfig.ATTR_DOMAIN,domain);
           node.setAttribute(WebcrawlerConfig.ATTR_USERNAME,userName);
           node.setAttribute(WebcrawlerConfig.ATTR_PASSWORD,
-            org.apache.manifoldcf.crawler.system.ManifoldCF.obfuscate(password));
+            org.apache.manifoldcf.crawler.system.ManifoldCF.obfuscate(variableContext.mapKeyToPassword(password)));
           parameters.addChild(parameters.getChildCount(),node);
         }
         i++;
@@ -3063,7 +3069,7 @@ public class WebcrawlerConnector extends
                     if (value != null && value.length() > 0)
                       paramNode.setAttribute(WebcrawlerConfig.ATTR_VALUE,value);
                     if (password != null && password.length() > 0)
-                      paramNode.setAttribute(WebcrawlerConfig.ATTR_PASSWORD,org.apache.manifoldcf.crawler.system.ManifoldCF.obfuscate(password));
+                      paramNode.setAttribute(WebcrawlerConfig.ATTR_PASSWORD,org.apache.manifoldcf.crawler.system.ManifoldCF.obfuscate(variableContext.mapKeyToPassword(password)));
                     authPageNode.addChild(authPageNode.getChildCount(),paramNode);
                   }
                   z++;

Propchange: manifoldcf/trunk/connectors/wiki/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-737/connectors/wiki:r1501867-1503249

Modified: manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java (original)
+++ manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java Mon Jul 15 14:02:29 2013
@@ -1012,6 +1012,8 @@ public class WikiConnector extends org.a
     String pass = parameters.getObfuscatedParameter(WikiConfig.PARAM_PASSWORD);
     if (pass == null) {
       pass = "";
+    } else {
+      pass = out.mapPasswordToKey(pass);
     }
     String domain = parameters.getParameter(WikiConfig.PARAM_DOMAIN);
     if (domain == null) {
@@ -1031,6 +1033,8 @@ public class WikiConnector extends org.a
     String accessPassword = parameters.getObfuscatedParameter(WikiConfig.PARAM_ACCESSPASSWORD);
     if (accessPassword == null)
       accessPassword = "";
+    else
+      accessPassword = out.mapPasswordToKey(accessPassword);
 
     // Email tab
     if (tabName.equals(Messages.getString(locale,"WikiConnector.Email")))
@@ -1183,7 +1187,7 @@ public class WikiConnector extends org.a
 
     String pass = variableContext.getParameter("serverpass");
     if (pass != null) {
-      parameters.setObfuscatedParameter(WikiConfig.PARAM_PASSWORD, pass);
+      parameters.setObfuscatedParameter(WikiConfig.PARAM_PASSWORD, variableContext.mapKeyToPassword(pass));
     }
 
     String domain = variableContext.getParameter("serverdomain");
@@ -1198,7 +1202,7 @@ public class WikiConnector extends org.a
 
     String accessPassword = variableContext.getParameter("accesspassword");
     if (accessPassword != null) {
-      parameters.setObfuscatedParameter(WikiConfig.PARAM_ACCESSPASSWORD, accessPassword);
+      parameters.setObfuscatedParameter(WikiConfig.PARAM_ACCESSPASSWORD, variableContext.mapKeyToPassword(accessPassword));
     }
 
     String accessRealm = variableContext.getParameter("accessrealm");

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutput.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutput.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutput.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutput.java Mon Jul 15 14:02:29 2013
@@ -21,90 +21,11 @@ package org.apache.manifoldcf.core.inter
 import java.io.*;
 
 /** This interface abstracts from the output character stream used to construct
-* HTML output for a web interface.
+* HTML output for a web interface.  More broadly, it provides the services that all
+* connectors will need in order to provide UI components.
 */
-public interface IHTTPOutput
+public interface IHTTPOutput extends IHTTPOutputActivity, IPasswordMapperActivity
 {
   public static final String _rcsid = "@(#)$Id: IHTTPOutput.java 988245 2010-08-23 18:39:35Z kwright $";
 
-  /** Flush the stream */
-  public void flush()
-    throws IOException;
-  
-  /** Write a newline */
-  public void newLine()
-    throws IOException;
-  
-  /** Write a boolean */
-  public void print(boolean b)
-    throws IOException;
-  
-  /** Write a char */
-  public void print(char c)
-    throws IOException;
-  
-  /** Write an array of chars */
-  public void print(char[] c)
-    throws IOException;
-  
-  /** Write a double */
-  public void print(double d)
-    throws IOException;
-  
-  /** Write a float */
-  public void print(float f)
-    throws IOException;
-  
-  /** Write an int */
-  public void print(int i)
-    throws IOException;
-  
-  /** Write a long */
-  public void print(long l)
-    throws IOException;
-  
-  /** Write an object */
-  public void print(Object o)
-    throws IOException;
-  
-  /** Write a string */
-  public void print(String s)
-    throws IOException;
-  
-  /** Write a boolean */
-  public void println(boolean b)
-    throws IOException;
-  
-  /** Write a char */
-  public void println(char c)
-    throws IOException;
-  
-  /** Write an array of chars */
-  public void println(char[] c)
-    throws IOException;
-  
-  /** Write a double */
-  public void println(double d)
-    throws IOException;
-  
-  /** Write a float */
-  public void println(float f)
-    throws IOException;
-  
-  /** Write an int */
-  public void println(int i)
-    throws IOException;
-  
-  /** Write a long */
-  public void println(long l)
-    throws IOException;
-  
-  /** Write an object */
-  public void println(Object o)
-    throws IOException;
-  
-  /** Write a string */
-  public void println(String s)
-    throws IOException;
-
 }

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java Mon Jul 15 14:02:29 2013
@@ -20,47 +20,11 @@ package org.apache.manifoldcf.core.inter
 
 import java.util.*;
 
-/** This interface represents parameters that get posted during UI interaction.
+/** This interface represents resources that are made available to connector methods
+* during UI post operations.
 */
-public interface IPostParameters
+public interface IPostParameters extends IParameterActivity, IPasswordMapperActivity
 {
   public static final String _rcsid = "@(#)$Id: IPostParameters.java 988245 2010-08-23 18:39:35Z kwright $";
 
-  /** Read an array of parameter values.
-  *@param name is the parameter name.
-  *@return the array of values, or null if it doesn't exist.
-  */
-  public String[] getParameterValues(String name);
-  
-  /** Get single parameter value.
-  *@param name is the parameter name.
-  *@return the value, or null if it doesn't exist.
-  */
-  public String getParameter(String name);
-  
-  /** Get a file parameter, as a binary input stream.
-  *@param name is the parameter name.
-  *@return the value, or null if it doesn't exist.
-  */
-  public BinaryInput getBinaryStream(String name)
-    throws ManifoldCFException;
-  
-  /** Get file parameter, as a byte array.
-  *@param name is the parameter name.
-  *@return the binary parameter as an array of bytes.
-  */
-  public byte[] getBinaryBytes(String name);
-  
-  /** Set a parameter value.
-  *@param name is the parameter name.
-  *@param value is the desired value.
-  */
-  public void setParameter(String name, String value);
-  
-  /** Set an array of parameter values.
-  *@param name is the parameter name.
-  *@param values is the array of desired values.
-  */
-  public void setParameterValues(String name, String[] values);
-
 }

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java (original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java Mon Jul 15 14:02:29 2013
@@ -81,6 +81,8 @@ public class ManifoldCF
   protected static Integer initializeFlagLock = new Integer(0);
 
   // Local member variables
+  protected static String loginUserName = null;
+  protected static String loginPassword = null;
   protected static String masterDatabaseName = null;
   protected static String masterDatabaseUsername = null;
   protected static String masterDatabasePassword = null;
@@ -96,6 +98,12 @@ public class ManifoldCF
 
   // System property/config file property names
   
+  // Admin properties
+  /** UI login user name */
+  public static final String loginUserNameProperty = "org.apache.manifoldcf.login.name";
+  /** UI login password */
+  public static final String loginPasswordProperty = "org.apache.manifoldcf.login.password";
+  
   // Database access properties
   /** Database name property */
   public static final String masterDatabaseNameProperty = "org.apache.manifoldcf.database.name";
@@ -142,6 +150,8 @@ public class ManifoldCF
       {
         // Clean up the system doing the same thing the shutdown thread would have if the process was killed
         cleanUpEnvironment();
+        loginUserName = null;
+        loginPassword = null;
         masterDatabaseName = null;
         masterDatabaseUsername = null;
         masterDatabasePassword = null;
@@ -208,6 +218,13 @@ public class ManifoldCF
           Logging.initializeLoggers();
           Logging.setLogLevels();
 
+          loginUserName = getProperty(loginUserNameProperty);
+          if (loginUserName == null)
+            loginUserName = "admin";
+          loginPassword = getProperty(loginPasswordProperty);
+          if (loginPassword == null)
+            loginPassword = "admin";
+
           masterDatabaseName = getProperty(masterDatabaseNameProperty);
           if (masterDatabaseName == null)
             masterDatabaseName = "dbname";
@@ -552,6 +569,25 @@ public class ManifoldCF
     }
   }
 
+  /** Verify login.
+  */
+  public static boolean verifyLogin(IThreadContext threadContext, String userID, String userPassword)
+    throws ManifoldCFException
+  {
+    if (userID != null && userPassword != null)
+    {
+      /*
+      IDBInterface database = DBInterfaceFactory.make(threadContext,
+        ManifoldCF.getMasterDatabaseName(),
+        ManifoldCF.getMasterDatabaseUsername(),
+        ManifoldCF.getMasterDatabasePassword());
+      */
+      // MHL to use a database table, when we get that sophisticated
+      return userID.equals(loginUserName) &&  userPassword.equals(loginPassword);
+    }
+    return false;
+  }
+  
   /** Perform standard one-way encryption of a string.
   *@param input is the string to encrypt.
   *@return the encrypted string.

Modified: manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py (original)
+++ manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py Mon Jul 15 14:02:29 2013
@@ -19,6 +19,8 @@
 import Javascript
 import urllib
 import urllib2
+import httplib
+import cookielib
 import HTMLParser
 import base64
 import re
@@ -735,18 +737,60 @@ class VirtualLink:
     def set_bodytext( self, bodytext ):
         self.linktext = bodytext
 
+# Dummy request (so we can use cookiejar)
+class DummyRequest:
+    """
+    Dummy request (for interfacing with cookiejar).
+    """
+
+    def __init__( self, protocol, host, url ):
+        self.protocol = protocol
+        self.host = host
+        self.url = url
+        self.headers = {}
+
+    def has_header( self, name ):
+        return name in self.headers
+
+    def add_header( self, key, val ):
+        self.headers[key.capitalize()] = val
+
+    def add_unredirected_header(self, key, val):
+        self.headers[key.capitalize()] = val
+
+    def is_unverifiable( self ):
+        return True
+
+    def get_type( self ):
+        return self.protocol
+
+    def get_full_url( self ):
+        return self.url
+
+    def get_header( self, header_name, default=None ):
+        return self.headers.get( header_name, default )
+
+    def get_host( self ):
+        return self.host
+
+    get_origin_req_host = get_host
+
+    def get_headers( self ):
+        return self.headers
+
 # Class that describes a virtual browser window.  Each virtual window has some set of forms and links,
 # as well as a set of dialog boxes (which can be popped up due to various actions, and dismissed
 # by virtual user activity)
 class VirtualWindow:
 
     def __init__( self, browser_instance, window_name, data, parent, current_url ):
-        print "Loading window '%s' with data from url %s" % (window_name, current_url)
+        print >>sys.stderr, "Loading window '%s' with data from url %s" % (window_name, current_url)
         self.links = { }
         self.buttons = { }
         self.forms = { }
         self.window_name = window_name
         self.data = data
+        #print >>sys.stderr, data
         self.parent = parent
         self.browser_instance = browser_instance
         self.is_open = True
@@ -993,16 +1037,19 @@ class VirtualBrowser:
         self.password = password
         self.win_host = win_host
         self.language = language
+        self.cookiejar = cookielib.CookieJar()
         if win_host == None and username != None:
             # Set up basic auth
-            self.urllibopener = urllib2.build_opener( urllib2.HTTPHandler ( ) )
+            pass
+            #self.urllibopener = urllib2.build_opener( urllib2.HTTPHandler ( ) )
         elif win_host != None and username != None:
             # Proxy-based auth
             # MHL
             raise Exception("Feature not yet implemented")
         else:
             # Use standard opener
-            self.urllibopener = urllib2.build_opener( urllib2.HTTPHandler ( ) )
+            pass
+            #self.urllibopener = urllib2.build_opener( urllib2.HTTPHandler ( ) )
 
     # Public part of the Virtual Browser interface
 
@@ -1073,6 +1120,7 @@ class VirtualBrowser:
         window_data = self.fetch_data_with_get( url )
         self.reload_window( window_name, window_data, url )
 
+    """
     def fetch_and_decode( self, req ):
         f = self.urllibopener.open( req )
         fetch_info = f.info()
@@ -1083,10 +1131,13 @@ class VirtualBrowser:
             if charset_index != -1:
                 encoding = content_type[charset_index+8:len(content_type)]
         return f.read( ).decode(encoding)
+    """
 
     # Read a url with get.  Returns the data as a string.
     def fetch_data_with_get( self, url ):
         print >> sys.stderr, "Getting url '%s'..." % url
+        return self.talk_to_server(url)
+        """
         req = urllib2.Request( url )
         if self.language != None:
             req.add_header("Accept-Language", self.language)
@@ -1097,11 +1148,14 @@ class VirtualBrowser:
         # MHL - not yet implemented
         # req.add_header('Referer', 'http://www.python.org/')
         return self.fetch_and_decode( req )
+        """
 
     # Read a url with post.  Pass the parameters as an array of ( name, value ) tuples.
     def fetch_data_with_post( self, parameters, url ):
         paramstring = urllib.urlencode( parameters, doseq=True )
         print >> sys.stderr, "Posting url '%s' with parameters '%s'..." % (url, paramstring)
+        return self.talk_to_server( url, method="POST", body=paramstring, content_type="application/x-www-form-urlencoded" )
+        """
         req = urllib2.Request( url, paramstring )
         if self.language != None:
             req.add_header("Accept-Language", self.language)
@@ -1111,6 +1165,7 @@ class VirtualBrowser:
         # Add cookies by domain
         # MHL
         return self.fetch_and_decode( req )
+        """
 
     # Private method to post using multipart forms
     def fetch_data_with_multipart_post( self, parameters, files, url ):
@@ -1121,17 +1176,6 @@ class VirtualBrowser:
             filecount = len(files)
         print >> sys.stderr, "Multipart posting url '%s' with parameters '%s' and %d files..." % (url, paramstring, filecount)
 
-        # Turn URL into protocol, host, and selector
-        urlpieces = url.split("://")
-        protocol = urlpieces[0]
-        uri = urlpieces[1]
-        # Split uri at the first /
-        uripieces = uri.split("/")
-        host = uripieces[0]
-        selector = uri[len(host):len(uri)]
-
-        import httplib
-
         """
         Post fields and files to an http host as multipart/form-data.
         fields is a sequence of (name, value) elements for regular form fields.
@@ -1139,52 +1183,100 @@ class VirtualBrowser:
         Return the server's response page.
         """
         content_type, body = encode_multipart_formdata(parameters, files)
-        if protocol == "http":
-            h = httplib.HTTPConnection(host)
-        elif protocol == "https":
-            h = httplib.HTTPSConnection(host)
-        else:
-            raise Exception("Unknown protocol: %s" % protocol)
-
-        h.connect()
-        try:
-            # Set the request type and url
-            h.putrequest("POST", selector)
+        return self.talk_to_server(url, method="POST", content_type=content_type, body=body)
 
-            # Set the content type and length
-            h.putheader("content-type", content_type)
-            h.putheader("content-length", str(len(body)))
-
-            # Add cookies by domain
-            # MHL
-
-            if self.language != None:
-                h.putheader("Accept-Language", self.language)
+    def talk_to_server(self, url, method="GET", content_type=None, body=None):
+        
+        # Redirection loop
+        while True:
+
+            # Turn URL into protocol, host, and selector
+            urlpieces = url.split("://")
+            protocol = urlpieces[0]
+            uri = urlpieces[1]
+            # Split uri at the first /
+            uripieces = uri.split("/")
+            host = uripieces[0]
+            selector = uri[len(host):len(uri)]
+
+            if protocol == "http":
+                h = httplib.HTTPConnection(host)
+            elif protocol == "https":
+                h = httplib.HTTPSConnection(host)
+            else:
+                raise Exception("Unknown protocol: %s" % protocol)
 
-            # Add basic auth credentials, if needed.
-            if self.username != None:
-                base64string = base64.encodestring("%s:%s" % (self.username, self.password))[:-1]
-                h.putheader("Authorization", "Basic %s" % base64string)
-
-            h.endheaders()
-
-            # Send the body
-            h.send(body)
-            response = h.getresponse()
-            status = response.status
-            headers = response.getheaders()
-            encoding = "iso-8859-1"
-            content_type = response.getheader("Content-type","text/html; charset=iso-8859-1")
-            charset_index = content_type.find("charset=")
-            if charset_index != -1:
-                encoding = content_type[charset_index+8:len(content_type)]
+            h.connect()
+            try:
+                # Set the request type and url
+                h.putrequest(method, selector)
 
-            value = response.read().decode(encoding)
-            if status != 200:
-                raise Exception("Received an error response %d from url: '%s'" % (status,url) )
-            return value
-        finally:
-            h.close()
+                # Set the content type and length
+                if content_type != None:
+                    h.putheader("content-type", content_type)
+                if body != None:
+                    h.putheader("content-length", str(len(body)))
+
+                # Add cookies by domain.  To do this with httplib and cookielib,
+                # we create a dummy urllib2 request.
+                urllib2_request = DummyRequest( protocol, host, url )
+
+                # add cookies to fake request
+                self.cookiejar.add_cookie_header( urllib2_request )
+                
+                # apply cookie headers to actual request
+                for header in urllib2_request.get_headers().keys():
+                    header_value = urllib2_request.get_headers()[header]
+                    h.putheader( header, header_value )
+
+                if self.language != None:
+                    h.putheader("Accept-Language", self.language)
+
+                # Add basic auth credentials, if needed.
+                if self.username != None:
+                    base64string = base64.encodestring("%s:%s" % (self.username, self.password))[:-1]
+                    h.putheader("Authorization", "Basic %s" % base64string)
+
+                h.endheaders()
+
+                # Send the body
+                if body != None:
+                    h.send(body)
+                response = h.getresponse()
+                status = response.status
+                headers = response.getheaders()
+                encoding = "iso-8859-1"
+                content_type = response.getheader("Content-type","text/html; charset=iso-8859-1")
+                charset_index = content_type.find("charset=")
+                if charset_index != -1:
+                    encoding = content_type[charset_index+8:len(content_type)]
+
+                value = response.read().decode(encoding)
+
+                # HACK: pretend we're urllib2 response for cookielib
+                response.info = lambda : response.msg
+
+                # read and store cookies from response
+                self.cookiejar.extract_cookies(response, urllib2_request)
+
+                # If redirection, go around again
+                if status == 301 or status == 302:
+                    # Redirection!  New url to process.
+                    location_header = response.msg.getheader("location")
+                    if location_header != None:
+                        print >>sys.stderr, "Redirecting from url '%s' to url '%s'..." % ( url, location_header )
+                        url = location_header
+                        continue
+                    else:
+                        raise Exception("Missing redirection location header")
+
+                # If NOT a redirection, handle it.
+                if status != 200:
+                    raise Exception("Received an error response %d from url: '%s'" % (status,url) )
+
+                return value
+            finally:
+                h.close()
 
 # Static method for multipart encoding
 def encode_multipart_formdata(fields, files):
@@ -1236,7 +1328,7 @@ class JSConfirmMethod( Javascript.JSObje
             raise Exception("confirm method requires one string argument")
         # Evaluate to string
         message = argset[0].str_value( )
-        print "CONFIRM: "+message
+        print >>sys.stderr, "CONFIRM: "+message
         # Now, decide whether we return true or false.
         return Javascript.JSBoolean( self.window_instance.get_answer( message, True ) )
 
@@ -1254,7 +1346,7 @@ class JSAlertMethod( Javascript.JSObject
             raise Exception("alert method requires one string argument")
         # Evaluate just to be sure there's no error
         message = argset[0].str_value( )
-        print "ALERT: "+message
+        print >>sys.stderr, "ALERT: "+message
         # Always click "OK"
         return Javascript.JSBoolean( True )
 
@@ -1299,7 +1391,7 @@ class JSFocusMethod( Javascript.JSObject
         self.owner = owner
 
     def call( self, argset, context ):
-        print "FOCUS: On field '%s'" % self.owner.get_name( )
+        print >>sys.stderr, "FOCUS: On field '%s'" % self.owner.get_name( )
         return Javascript.JSBoolean( True )
 
 # JS object representing a window in Javascript
@@ -1556,7 +1648,7 @@ class VirtualActionParser( HTMLParser.HT
                 multipart = False
             if method == "POST" and multipart == True:
                 method = "MULTIPART"
-            print "Form of type %s detected" % method
+            print >>sys.stderr, "Form of type %s detected" % method
             self.current_form_instance = VirtualForm( self.window_instance, name, action, method )
             self.window_instance.add_form( self.current_form_instance )
         except:

Propchange: manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-737/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py:r1501867-1503249

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminDefaults.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminDefaults.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminDefaults.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminDefaults.jsp Mon Jul 15 14:02:29 2013
@@ -42,7 +42,7 @@
 	org.apache.manifoldcf.ui.multipart.MultipartWrapper variableContext = (org.apache.manifoldcf.ui.multipart.MultipartWrapper)threadContext.get("__WRAPPER__");
 	if (variableContext == null)
 	{
-		variableContext = new org.apache.manifoldcf.ui.multipart.MultipartWrapper(request);
+		variableContext = new org.apache.manifoldcf.ui.multipart.MultipartWrapper(request,adminprofile);
 		threadContext.save("__WRAPPER__",variableContext);
 	}
 %>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminHeaders.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminHeaders.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminHeaders.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminHeaders.jsp Mon Jul 15 14:02:29 2013
@@ -46,13 +46,17 @@ response.setContentType("text/html;chars
 
 
 <%
+	if (adminprofile.getLoggedOn() == false)
+	{
+		response.sendRedirect("login.jsp");
+		return;
+	}
+
 	IThreadContext threadContext = thread.getThreadContext();
 	org.apache.manifoldcf.ui.multipart.MultipartWrapper variableContext = (org.apache.manifoldcf.ui.multipart.MultipartWrapper)threadContext.get("__WRAPPER__");
 	if (variableContext == null)
 	{
-		variableContext = new org.apache.manifoldcf.ui.multipart.MultipartWrapper(request);
+		variableContext = new org.apache.manifoldcf.ui.multipart.MultipartWrapper(request,adminprofile);
 		threadContext.save("__WRAPPER__",variableContext);
 	}
 %>
-
-<%@ include file="checkAdminLogin.jsp" %>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp Mon Jul 15 14:02:29 2013
@@ -218,7 +218,7 @@
 	//-->
 	</script>
 <%
-	AuthorityConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabsArray);
+	AuthorityConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabsArray);
 
 	// Get connectors, since this will be needed to determine what to display.
 	IResultSet set = connectorManager.getConnectors();
@@ -487,7 +487,7 @@
 	  }
 
 	  if (className.length() > 0)
-		AuthorityConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabName);
+		AuthorityConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
 %>
 		    <table class="displaytable">
 			<tr><td class="separator" colspan="4"><hr/></td></tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editconnection.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editconnection.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editconnection.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editconnection.jsp Mon Jul 15 14:02:29 2013
@@ -254,7 +254,7 @@
 	//-->
 	</script>
 <%
-	RepositoryConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabsArray);
+	RepositoryConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabsArray);
 %>
 
 </head>
@@ -567,7 +567,7 @@
 	  }
 
 	  if (className.length() > 0)
-		RepositoryConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabName);
+		RepositoryConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
 %>
 		    <table class="displaytable">
 			<tr><td class="separator" colspan="4"><hr/></td></tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp Mon Jul 15 14:02:29 2013
@@ -410,7 +410,7 @@
 		{
 			try
 			{
-				outputConnector.outputSpecificationHeader(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),outputSpecification,tabsArray);
+				outputConnector.outputSpecificationHeader(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),outputSpecification,tabsArray);
 			}
 			finally
 			{
@@ -429,7 +429,7 @@
 		{
 			try
 			{
-				repositoryConnector.outputSpecificationHeader(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),documentSpecification,tabsArray);
+				repositoryConnector.outputSpecificationHeader(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),documentSpecification,tabsArray);
 			}
 			finally
 			{
@@ -1278,7 +1278,7 @@
 		{
 			try
 			{
-				outputConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),outputSpecification,tabName);
+				outputConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),outputSpecification,tabName);
 			}
 			finally
 			{
@@ -1298,7 +1298,7 @@
 		{
 			try
 			{
-				repositoryConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),documentSpecification,tabName);
+				repositoryConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),documentSpecification,tabName);
 			}
 			finally
 			{

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp Mon Jul 15 14:02:29 2013
@@ -216,7 +216,7 @@
 	//-->
 	</script>
 <%
-	MappingConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabsArray);
+	MappingConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabsArray);
 
 	// Get connectors, since this will be needed to determine what to display.
 	IResultSet set = connectorManager.getConnectors();
@@ -486,7 +486,7 @@
 	  }
 
 	  if (className.length() > 0)
-		MappingConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabName);
+		MappingConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
 %>
 		    <table class="displaytable">
 			<tr><td class="separator" colspan="4"><hr/></td></tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editoutput.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editoutput.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editoutput.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editoutput.jsp Mon Jul 15 14:02:29 2013
@@ -212,7 +212,7 @@
 	//-->
 	</script>
 <%
-	OutputConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabsArray);
+	OutputConnectorFactory.outputConfigurationHeader(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabsArray);
 %>
 
 </head>
@@ -415,7 +415,7 @@
 	  }
 
 	  if (className.length() > 0)
-		OutputConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters,tabName);
+		OutputConnectorFactory.outputConfigurationBody(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters,tabName);
 
 %>
 		    <table class="displaytable">

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/index.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/index.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/index.jsp Mon Jul 15 14:02:29 2013
@@ -29,7 +29,7 @@
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<link rel="StyleSheet" href="style.css" type="text/css" media="screen"/>
 	<title>
-		Apache ManifoldCF
+		<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"index.ApacheManifoldCF")%>
 	</title>
 
 </head>
@@ -39,7 +39,7 @@
       <tr><td colspan="2" class="banner"><jsp:include page="banner.jsp" flush="true"/></td></tr>
       <tr><td class="navigation"><jsp:include page="navigation.jsp" flush="true"/></td>
        <td class="window">
-	<p class="windowtitle"><%=Messages.getString(pageContext.getRequest().getLocale(),"index.WelcomeToApacheManifoldFC")%></p>
+	<p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"index.WelcomeToApacheManifoldFC")%></p>
        </td>
       </tr>
     </table>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp Mon Jul 15 14:02:29 2013
@@ -90,4 +90,7 @@
 	<li class="menuitem">
 		<nobr><a class="menulink" href='<%="http://manifoldcf.apache.org/release/trunk/"+Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.Locale")+"/end-user-documentation.html"%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"navigation.Help")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.Help")%></a></nobr>
 	</li>
+	<li class="menuitem">
+		<nobr><a class="menulink" href="logout.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"navigation.LogOut")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.LogOut")%></a></nobr>
+	</li>
 </ul>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/setupAdminProfile.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/setupAdminProfile.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/setupAdminProfile.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/setupAdminProfile.jsp Mon Jul 15 14:02:29 2013
@@ -1,5 +1,6 @@
-<%
+<%@ include file="adminDefaults.jsp" %>
 
+<%
 /* $Id$ */
 
 /**
@@ -20,28 +21,20 @@
 */
 %>
 
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
-<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-
-<jsp:useBean id="adminprofile" class="org.apache.manifoldcf.ui.beans.AdminProfile" scope="session"/>
-
-<c:catch var="error">
-	<c:if test="${param.valid=='true'}">
-		<c:set value="${param.login}" target="${adminprofile}" property="userID"/>
-		<c:set value="${param.password}" target="${adminprofile}" property="password"/>
-	</c:if>
-	
-	<c:if test="${param.valid=='false'}">
-		<c:set value="null" target="${adminprofile}" property="userID"/>
-	</c:if>
-</c:catch>
-
-<c:if test="${error!=null}">
-	<c:set target="${logger}" property="msg" value="Profile error!!!! ${error}"/>
-	<c:set value="null" target="${adminprofile}" property="userID"/>
-</c:if>
-
-
-
-
+<%
+String userID = variableContext.getParameter("userID");
+String password = variableContext.getParameter("password");
+if (userID == null)
+	userID = "";
+if (password == null)
+	password = "";
+
+adminprofile.login(threadContext,userID,password);
+if (adminprofile.getLoggedOn())
+	response.sendRedirect("index.jsp");
+else
+{
+	// Go back to login page, but with signal that login failed
+	response.sendRedirect("login.jsp?loginfailed=true");
+}
+%>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp Mon Jul 15 14:02:29 2013
@@ -164,7 +164,7 @@
 			<tr>
 				<td colspan="4">
 <%
-		AuthorityConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters);
+		AuthorityConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters);
 %>
 
 				</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp Mon Jul 15 14:02:29 2013
@@ -191,7 +191,7 @@
 			<tr>
 				<td colspan="4">
 <%
-		RepositoryConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters);
+		RepositoryConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters);
 %>
 				</td>
 			</tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp Mon Jul 15 14:02:29 2013
@@ -637,7 +637,7 @@
 			{
 				try
 				{
-					outputConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),job.getOutputSpecification());
+					outputConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),job.getOutputSpecification());
 				}
 				finally
 				{
@@ -663,7 +663,7 @@
 			{
 				try
 				{
-					repositoryConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),job.getSpecification());
+					repositoryConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),job.getSpecification());
 				}
 				finally
 				{

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp Mon Jul 15 14:02:29 2013
@@ -160,7 +160,7 @@
 			<tr>
 				<td colspan="4">
 <%
-		MappingConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters);
+		MappingConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters);
 %>
 
 				</td>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp Mon Jul 15 14:02:29 2013
@@ -146,7 +146,7 @@
 			<tr>
 				<td colspan="4">
 <%
-		OutputConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out),pageContext.getRequest().getLocale(),parameters);
+		OutputConnectorFactory.viewConfiguration(threadContext,className,new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),parameters);
 %>
 				</td>
 			</tr>

Modified: manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/AdminProfile.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/AdminProfile.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/AdminProfile.java (original)
+++ manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/AdminProfile.java Mon Jul 15 14:02:29 2013
@@ -24,6 +24,7 @@ import javax.servlet.http.*;
 
 import org.apache.manifoldcf.core.interfaces.*;
 import org.apache.manifoldcf.core.system.*;
+import org.apache.manifoldcf.ui.passwords.PasswordMapper;
 
 /** The profile object contains an admin user's login information, and helps establish the
 * session model for the application.  This particular bean maintains the user (against
@@ -34,15 +35,18 @@ public class AdminProfile implements Htt
   public static final String _rcsid = "@(#)$Id: AdminProfile.java 988245 2010-08-23 18:39:35Z kwright $";
 
   /** Time of login */
-  private long loginTime = 0;
+  private long loginTime = -1L;
   /** Logged in user */
   private String userID = null;
-  /** Session identifier */
-  private String sessionIdentifier = null;
   /** Set to "true" if user is logged in. */
   private boolean isLoggedIn = false;
   /** Set to "true" if user can manage users. */
   private boolean manageUsers = false;
+  /** Password mapper */
+  private PasswordMapper passwordMapper = null;
+
+  /** Session identifier */
+  private String sessionIdentifier = null;
 
   /** Constructor.
   */
@@ -61,15 +65,6 @@ public class AdminProfile implements Htt
     return sessionIdentifier;
   }
 
-  /** Set the admin user id.
-  *@param userID is the ID of the admin user to log in.
-  */
-  public void setUserID(String userID)
-  {
-    sessionCleanup();       // nuke existing stuff (i.e. log out)
-    this.userID = userID;
-  }
-
   /** Get the admin user id.
   *@return the last login user id.
   */
@@ -86,35 +81,36 @@ public class AdminProfile implements Htt
     return manageUsers;
   }
 
+  /** Log out the current user.
+  */
+  public void logout()
+  {
+    sessionCleanup();
+  }
+
   /** Log on the user, with the already-set user id and company
   * description.
   *@param userPassword is the login password for the user.
   */
-  public void setPassword(String userPassword)
+  public void login(IThreadContext threadContext,
+    String userID, String userPassword)
   {
     sessionCleanup();
     try
     {
       // Check if everything is in place.
-      IThreadContext threadContext = ThreadContextFactory.make();
-      if (userID != null)
+      if (ManifoldCF.verifyLogin(threadContext,userID,userPassword))
       {
-        IDBInterface database = DBInterfaceFactory.make(threadContext,
-          ManifoldCF.getMasterDatabaseName(),
-          ManifoldCF.getMasterDatabaseUsername(),
-          ManifoldCF.getMasterDatabasePassword());
-        // MHL to actually log in (when we figure out what to use as an authority)
-        if (userID.equals("admin") &&  userPassword.equals("admin"))
-        {
-          isLoggedIn = true;
-          loginTime = System.currentTimeMillis();
-          manageUsers = false;
-        }
+        isLoggedIn = true;
+        loginTime = System.currentTimeMillis();
+        this.userID = userID;
+        manageUsers = false;
+        passwordMapper = new PasswordMapper();
       }
     }
     catch (ManifoldCFException e)
     {
-      Logging.misc.fatal("Exception logging in!",e);
+      Logging.misc.fatal("Exception logging in: "+e.getMessage(),e);
     }
   }
 
@@ -143,12 +139,24 @@ public class AdminProfile implements Htt
     return loginTime;
   }
 
+  /** Get the password mapper object.
+  *@return the password mapper object.
+  */
+  public PasswordMapper getPasswordMapper()
+  {
+    return passwordMapper;
+  }
+  
   // Nuke stuff for security and the garbage
   // collector threads
   private void sessionCleanup()
   {
     // Un-log-in the user
     isLoggedIn = false;
+    userID = null;
+    manageUsers = false;
+    loginTime = -1L;
+    passwordMapper = null;
   }