mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
(Merged from 2.0 branch)
Added the 'authticket' property with the logged on users authentication ticket, returned via the PropFind request. AR-1449 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5682 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -35,6 +35,8 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
import org.alfresco.model.ContentModel;
|
import org.alfresco.model.ContentModel;
|
||||||
|
import org.alfresco.repo.webdav.auth.AuthenticationFilter;
|
||||||
|
import org.alfresco.repo.webdav.auth.WebDAVUser;
|
||||||
import org.alfresco.service.cmr.lock.LockService;
|
import org.alfresco.service.cmr.lock.LockService;
|
||||||
import org.alfresco.service.cmr.lock.LockStatus;
|
import org.alfresco.service.cmr.lock.LockStatus;
|
||||||
import org.alfresco.service.cmr.model.FileFolderService;
|
import org.alfresco.service.cmr.model.FileFolderService;
|
||||||
@@ -598,6 +600,17 @@ public class PropFindMethod extends WebDAVMethod
|
|||||||
xml.write(WebDAV.formatCreationDate(typeConv.convert(Date.class, davValue)));
|
xml.write(WebDAV.formatCreationDate(typeConv.convert(Date.class, davValue)));
|
||||||
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE);
|
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_CREATION_DATE, WebDAV.XML_NS_CREATION_DATE);
|
||||||
}
|
}
|
||||||
|
else if ( propName.equals( WebDAV.XML_ALF_AUTHTICKET))
|
||||||
|
{
|
||||||
|
// Get the users authentication ticket
|
||||||
|
|
||||||
|
WebDAVUser davUser = (WebDAVUser) m_request.getSession().getAttribute( AuthenticationFilter.AUTHENTICATION_USER);
|
||||||
|
|
||||||
|
xml.startElement(WebDAV.DAV_NS, WebDAV.XML_ALF_AUTHTICKET, WebDAV.XML_NS_ALF_AUTHTICKET, nullAttr);
|
||||||
|
if ( davUser != null)
|
||||||
|
xml.write( davUser.getTicket());
|
||||||
|
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_ALF_AUTHTICKET, WebDAV.XML_NS_ALF_AUTHTICKET);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Could not map the requested property to an Alfresco property
|
// Could not map the requested property to an Alfresco property
|
||||||
@@ -795,7 +808,12 @@ public class PropFindMethod extends WebDAVMethod
|
|||||||
|
|
||||||
// Print out all the custom properties
|
// Print out all the custom properties
|
||||||
|
|
||||||
// TODO: Output custom properties
|
WebDAVUser davUser = (WebDAVUser) m_request.getSession().getAttribute( AuthenticationFilter.AUTHENTICATION_USER);
|
||||||
|
|
||||||
|
xml.startElement(WebDAV.DAV_NS, WebDAV.XML_ALF_AUTHTICKET, WebDAV.XML_NS_ALF_AUTHTICKET, nullAttr);
|
||||||
|
if ( davUser != null)
|
||||||
|
xml.write( davUser.getTicket());
|
||||||
|
xml.endElement(WebDAV.DAV_NS, WebDAV.XML_ALF_AUTHTICKET, WebDAV.XML_NS_ALF_AUTHTICKET);
|
||||||
|
|
||||||
// Close off the response
|
// Close off the response
|
||||||
|
|
||||||
@@ -846,7 +864,7 @@ public class PropFindMethod extends WebDAVMethod
|
|||||||
|
|
||||||
// Output the custom properties
|
// Output the custom properties
|
||||||
|
|
||||||
// TODO: Custom properties
|
xml.write(DocumentHelper.createElement(WebDAV.XML_NS_ALF_AUTHTICKET));
|
||||||
|
|
||||||
// Close off the response
|
// Close off the response
|
||||||
|
|
||||||
|
@@ -205,6 +205,11 @@ public class WebDAV
|
|||||||
|
|
||||||
public static final String XML_CONTENT_TYPE = "text/xml; charset=UTF-8";
|
public static final String XML_CONTENT_TYPE = "text/xml; charset=UTF-8";
|
||||||
|
|
||||||
|
// Alfresco specific properties
|
||||||
|
|
||||||
|
public static final String XML_ALF_AUTHTICKET = "authticket";
|
||||||
|
public static final String XML_NS_ALF_AUTHTICKET = DAV_NS_PREFIX + "authticket";
|
||||||
|
|
||||||
// Path seperator
|
// Path seperator
|
||||||
|
|
||||||
public static final String PathSeperator = "/";
|
public static final String PathSeperator = "/";
|
||||||
|
Reference in New Issue
Block a user