mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Alfresco JLAN integration updates.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7758 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
47
.classpath
47
.classpath
@@ -1,23 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="source/java"/>
|
||||
<classpathentry kind="src" path="config"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="/Repository"/>
|
||||
<classpathentry kind="src" path="/Core"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Remote API"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/commons/commons-httpclient-3.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/commons/commons-jxpath-1.2.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/3rd Party"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/xercesImpl-2.8.0.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Jndi-Client"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/bsf-2.4.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/xmlgraphics-commons-1.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/fop-0.92beta.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/avalon-framework-4.2.0.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/MBean"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/chiba-1.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/json.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Web-Framework"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="source/java"/>
|
||||
<classpathentry kind="src" path="config"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="src" path="/Repository"/>
|
||||
<classpathentry kind="src" path="/Core"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Remote API"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/commons/commons-httpclient-3.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/commons/commons-jxpath-1.2.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/3rd Party"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/xercesImpl-2.8.0.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Jndi-Client"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/bsf-2.4.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/xmlgraphics-commons-1.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/fop-0.92beta.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/fop/avalon-framework-4.2.0.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/MBean"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/chiba-1.3.0.jar"/>
|
||||
<classpathentry kind="lib" path="/3rd Party/lib/json.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Web-Framework"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/Alfresco JLAN"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
||||
|
@@ -54,14 +54,14 @@ import javax.servlet.http.HttpSession;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.config.ConfigService;
|
||||
import org.alfresco.filesys.server.auth.kerberos.KerberosDetails;
|
||||
import org.alfresco.filesys.server.auth.kerberos.SessionSetupPrivilegedAction;
|
||||
import org.alfresco.filesys.server.auth.spnego.NegTokenInit;
|
||||
import org.alfresco.filesys.server.auth.spnego.NegTokenTarg;
|
||||
import org.alfresco.filesys.server.auth.spnego.OID;
|
||||
import org.alfresco.filesys.server.auth.spnego.SPNEGO;
|
||||
import org.alfresco.filesys.server.config.ServerConfiguration;
|
||||
import org.alfresco.filesys.ServerConfigurationBean;
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.jlan.server.auth.kerberos.KerberosDetails;
|
||||
import org.alfresco.jlan.server.auth.kerberos.SessionSetupPrivilegedAction;
|
||||
import org.alfresco.jlan.server.auth.spnego.NegTokenInit;
|
||||
import org.alfresco.jlan.server.auth.spnego.NegTokenTarg;
|
||||
import org.alfresco.jlan.server.auth.spnego.OID;
|
||||
import org.alfresco.jlan.server.auth.spnego.SPNEGO;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
@@ -112,7 +112,7 @@ public class KerberosAuthenticationFilter extends AbstractAuthenticationFilter i
|
||||
|
||||
// File server configuration
|
||||
|
||||
private ServerConfiguration m_srvConfig;
|
||||
private ServerConfigurationBean m_srvConfig;
|
||||
|
||||
// Various services required by the Kerberos authenticator
|
||||
|
||||
@@ -196,7 +196,7 @@ public class KerberosAuthenticationFilter extends AbstractAuthenticationFilter i
|
||||
m_personService = (PersonService) ctx.getBean("personService");
|
||||
m_configService = (ConfigService) ctx.getBean("webClientConfigService");
|
||||
|
||||
m_srvConfig = (ServerConfiguration) ctx.getBean(ServerConfiguration.SERVER_CONFIGURATION);
|
||||
m_srvConfig = (ServerConfigurationBean) ctx.getBean(ServerConfigurationBean.SERVER_CONFIGURATION);
|
||||
|
||||
// Check that the authentication component supports the required mode
|
||||
|
||||
|
@@ -48,19 +48,20 @@ import javax.transaction.UserTransaction;
|
||||
import net.sf.acegisecurity.BadCredentialsException;
|
||||
|
||||
import org.alfresco.config.ConfigService;
|
||||
import org.alfresco.filesys.server.auth.PasswordEncryptor;
|
||||
import org.alfresco.filesys.server.auth.ntlm.NTLM;
|
||||
import org.alfresco.filesys.server.auth.ntlm.NTLMLogonDetails;
|
||||
import org.alfresco.filesys.server.auth.ntlm.NTLMMessage;
|
||||
import org.alfresco.filesys.server.auth.ntlm.TargetInfo;
|
||||
import org.alfresco.filesys.server.auth.ntlm.Type1NTLMMessage;
|
||||
import org.alfresco.filesys.server.auth.ntlm.Type2NTLMMessage;
|
||||
import org.alfresco.filesys.server.auth.ntlm.Type3NTLMMessage;
|
||||
import org.alfresco.filesys.server.auth.passthru.DomainMapping;
|
||||
import org.alfresco.filesys.server.config.ServerConfiguration;
|
||||
import org.alfresco.filesys.util.DataPacker;
|
||||
import org.alfresco.filesys.util.IPAddress;
|
||||
import org.alfresco.filesys.ServerConfigurationBean;
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.jlan.server.auth.PasswordEncryptor;
|
||||
import org.alfresco.jlan.server.auth.ntlm.NTLM;
|
||||
import org.alfresco.jlan.server.auth.ntlm.NTLMLogonDetails;
|
||||
import org.alfresco.jlan.server.auth.ntlm.NTLMMessage;
|
||||
import org.alfresco.jlan.server.auth.ntlm.TargetInfo;
|
||||
import org.alfresco.jlan.server.auth.ntlm.Type1NTLMMessage;
|
||||
import org.alfresco.jlan.server.auth.ntlm.Type2NTLMMessage;
|
||||
import org.alfresco.jlan.server.auth.ntlm.Type3NTLMMessage;
|
||||
import org.alfresco.jlan.server.auth.passthru.DomainMapping;
|
||||
import org.alfresco.jlan.server.config.SecurityConfigSection;
|
||||
import org.alfresco.jlan.util.DataPacker;
|
||||
import org.alfresco.jlan.util.IPAddress;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationException;
|
||||
@@ -116,7 +117,7 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
|
||||
// File server configuration
|
||||
|
||||
private ServerConfiguration m_srvConfig;
|
||||
private ServerConfigurationBean m_srvConfig;
|
||||
|
||||
// Various services required by NTLM authenticator
|
||||
|
||||
@@ -127,6 +128,10 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
private TransactionService m_transactionService;
|
||||
private ConfigService m_configService;
|
||||
|
||||
// Security configuration section, for domain mappings
|
||||
|
||||
private SecurityConfigSection m_secConfig;
|
||||
|
||||
// Password encryptor
|
||||
|
||||
private PasswordEncryptor m_encryptor = new PasswordEncryptor();
|
||||
@@ -180,7 +185,7 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
m_personService = (PersonService) ctx.getBean("personService");
|
||||
m_configService = (ConfigService) ctx.getBean("webClientConfigService");
|
||||
|
||||
m_srvConfig = (ServerConfiguration) ctx.getBean(ServerConfiguration.SERVER_CONFIGURATION);
|
||||
m_srvConfig = (ServerConfigurationBean) ctx.getBean(ServerConfigurationBean.SERVER_CONFIGURATION);
|
||||
|
||||
// Check that the authentication component supports the required mode
|
||||
|
||||
@@ -203,6 +208,10 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
|
||||
m_srvName = m_srvConfig.getLocalServerName(true) + "_A";
|
||||
}
|
||||
|
||||
// Find the security configuration section
|
||||
|
||||
m_secConfig = (SecurityConfigSection) m_srvConfig.getConfigSection( SecurityConfigSection.SectionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -781,6 +790,10 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
|
||||
NodeRef personNodeRef = m_personService.getPerson(userName);
|
||||
|
||||
// Use the system user context to do the user lookup
|
||||
|
||||
m_authComponent.setCurrentUser( m_authComponent.getSystemUserName());
|
||||
|
||||
// User name should match the uid in the person entry found
|
||||
|
||||
userName = (String) m_nodeService.getProperty(personNodeRef, ContentModel.PROP_USERNAME);
|
||||
@@ -946,13 +959,13 @@ public class NTLMAuthenticationFilter extends AbstractAuthenticationFilter imple
|
||||
{
|
||||
// Check if there are any domain mappings
|
||||
|
||||
if ( m_srvConfig.hasDomainMappings() == false)
|
||||
if ( m_secConfig != null && m_secConfig.hasDomainMappings() == false)
|
||||
return null;
|
||||
|
||||
// convert the client IP address to an integer value
|
||||
|
||||
int clientAddr = IPAddress.parseNumericAddress( clientIP);
|
||||
for ( DomainMapping domainMap : m_srvConfig.getDomainMappings())
|
||||
for ( DomainMapping domainMap : m_secConfig.getDomainMappings())
|
||||
{
|
||||
if ( domainMap.isMemberOfDomain( clientAddr))
|
||||
{
|
||||
|
@@ -26,6 +26,7 @@ package org.alfresco.web.bean;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -34,11 +35,14 @@ import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.filesys.CIFSServer;
|
||||
import org.alfresco.filesys.server.config.ServerConfiguration;
|
||||
import org.alfresco.filesys.server.filesys.DiskSharedDevice;
|
||||
import org.alfresco.filesys.smb.server.repo.ContentContext;
|
||||
import org.alfresco.filesys.smb.server.repo.ContentDiskInterface;
|
||||
import org.alfresco.filesys.CIFSServerBean;
|
||||
import org.alfresco.filesys.ServerConfigurationBean;
|
||||
import org.alfresco.filesys.repo.ContentContext;
|
||||
import org.alfresco.filesys.repo.ContentDiskInterface;
|
||||
import org.alfresco.jlan.server.core.SharedDevice;
|
||||
import org.alfresco.jlan.server.core.SharedDeviceList;
|
||||
import org.alfresco.jlan.server.filesys.DiskSharedDevice;
|
||||
import org.alfresco.jlan.server.filesys.FilesystemsConfigSection;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.service.cmr.repository.FileTypeImageSize;
|
||||
@@ -131,7 +135,7 @@ public class NavigationBean
|
||||
/**
|
||||
* @param cifsServer The cifsServer to set.
|
||||
*/
|
||||
public void setCifsServer(CIFSServer cifsServer)
|
||||
public void setCifsServer(CIFSServerBean cifsServer)
|
||||
{
|
||||
this.cifsServer = cifsServer;
|
||||
}
|
||||
@@ -595,27 +599,33 @@ public class NavigationBean
|
||||
Path path = node.getNodePath();
|
||||
|
||||
// resolve CIFS network folder location for this node
|
||||
ServerConfiguration fileServiceConfig = (ServerConfiguration)FacesContextUtils.getRequiredWebApplicationContext(
|
||||
FacesContext.getCurrentInstance()).getBean("fileServerConfiguration");
|
||||
if (fileServiceConfig.isSMBServerEnabled())
|
||||
FilesystemsConfigSection filesysConfig = (FilesystemsConfigSection) cifsServer.getConfiguration().getConfigSection(FilesystemsConfigSection.SectionName);
|
||||
DiskSharedDevice diskShare = null;
|
||||
|
||||
SharedDeviceList shares = filesysConfig.getShares();
|
||||
Enumeration<SharedDevice> shareEnum = shares.enumerateShares();
|
||||
|
||||
while ( shareEnum.hasMoreElements() && diskShare == null) {
|
||||
SharedDevice curShare = shareEnum.nextElement();
|
||||
if ( curShare.getContext() instanceof ContentContext)
|
||||
diskShare = (DiskSharedDevice) curShare;
|
||||
}
|
||||
|
||||
if (diskShare != null)
|
||||
{
|
||||
DiskSharedDevice diskShare = cifsServer.getConfiguration().getPrimaryFilesystem();
|
||||
if (diskShare != null && diskShare.getContext() instanceof ContentContext)
|
||||
ContentContext contentCtx = (ContentContext) diskShare.getContext();
|
||||
NodeRef rootNode = contentCtx.getRootNode();
|
||||
try
|
||||
{
|
||||
ContentContext contentCtx = (ContentContext) diskShare.getContext();
|
||||
NodeRef rootNode = contentCtx.getRootNode();
|
||||
try
|
||||
{
|
||||
String cifsPath = Repository.getNamePath(this.nodeService, path, rootNode, "\\", "file:///" + getCIFSServerPath(diskShare));
|
||||
|
||||
node.getProperties().put("cifsPath", cifsPath);
|
||||
node.getProperties().put("cifsPathLabel", cifsPath.substring(8)); // strip file:/// part
|
||||
}
|
||||
catch(AccessDeniedException ade)
|
||||
{
|
||||
node.getProperties().put("cifsPath", "");
|
||||
node.getProperties().put("cifsPathLabel",""); // strip file:/// part
|
||||
}
|
||||
String cifsPath = Repository.getNamePath(this.nodeService, path, rootNode, "\\", "file:///" + getCIFSServerPath(diskShare));
|
||||
|
||||
node.getProperties().put("cifsPath", cifsPath);
|
||||
node.getProperties().put("cifsPathLabel", cifsPath.substring(8)); // strip file:/// part
|
||||
}
|
||||
catch(AccessDeniedException ade)
|
||||
{
|
||||
node.getProperties().put("cifsPath", "");
|
||||
node.getProperties().put("cifsPathLabel",""); // strip file:/// part
|
||||
}
|
||||
}
|
||||
|
||||
@@ -975,7 +985,7 @@ public class NavigationBean
|
||||
protected RuleService ruleService;
|
||||
|
||||
/** CIFSServer bean reference */
|
||||
protected CIFSServer cifsServer;
|
||||
protected CIFSServerBean cifsServer;
|
||||
|
||||
/** CIFS content disk driver bean reference */
|
||||
protected ContentDiskInterface contentDiskDriver;
|
||||
|
@@ -32,7 +32,6 @@ import java.util.StringTokenizer;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.context.ResponseWriter;
|
||||
|
||||
import org.alfresco.filesys.server.filesys.FileExistsException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
|
@@ -32,6 +32,7 @@ import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
@@ -53,9 +54,12 @@ import javax.servlet.ServletContext;
|
||||
|
||||
import org.alfresco.config.ConfigElement;
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.filesys.CIFSServer;
|
||||
import org.alfresco.filesys.server.filesys.DiskSharedDevice;
|
||||
import org.alfresco.filesys.smb.server.repo.ContentContext;
|
||||
import org.alfresco.filesys.CIFSServerBean;
|
||||
import org.alfresco.filesys.repo.ContentContext;
|
||||
import org.alfresco.jlan.server.core.SharedDevice;
|
||||
import org.alfresco.jlan.server.core.SharedDeviceList;
|
||||
import org.alfresco.jlan.server.filesys.DiskSharedDevice;
|
||||
import org.alfresco.jlan.server.filesys.FilesystemsConfigSection;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
@@ -767,12 +771,25 @@ public final class Utils
|
||||
NodeService nodeService = Repository.getServiceRegistry(context).getNodeService();
|
||||
NavigationBean navBean = (NavigationBean)context.getExternalContext().
|
||||
getSessionMap().get(NavigationBean.BEAN_NAME);
|
||||
CIFSServer cifsServer = (CIFSServer)FacesContextUtils.getRequiredWebApplicationContext(
|
||||
CIFSServerBean cifsServer = (CIFSServerBean)FacesContextUtils.getRequiredWebApplicationContext(
|
||||
context).getBean("cifsServer");
|
||||
|
||||
if (nodeService != null && navBean != null && cifsServer != null)
|
||||
{
|
||||
DiskSharedDevice diskShare = cifsServer.getConfiguration().getPrimaryFilesystem();
|
||||
// Resolve CIFS network folder location for this node
|
||||
|
||||
FilesystemsConfigSection filesysConfig = (FilesystemsConfigSection) cifsServer.getConfiguration().getConfigSection(FilesystemsConfigSection.SectionName);
|
||||
DiskSharedDevice diskShare = null;
|
||||
|
||||
SharedDeviceList shares = filesysConfig.getShares();
|
||||
Enumeration<SharedDevice> shareEnum = shares.enumerateShares();
|
||||
|
||||
while ( shareEnum.hasMoreElements() && diskShare == null) {
|
||||
SharedDevice curShare = shareEnum.nextElement();
|
||||
if ( curShare.getContext() instanceof ContentContext)
|
||||
diskShare = (DiskSharedDevice) curShare;
|
||||
}
|
||||
|
||||
|
||||
if (diskShare != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user