diff options
Diffstat (limited to 'ucb/source/ucp/webdav')
-rw-r--r-- | ucb/source/ucp/webdav/DAVAuthListener.hxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.cxx | 14 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVResourceAccess.hxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVSession.hxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/NeonSession.cxx | 21 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/NeonSession.hxx | 3 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/webdavcontent.cxx | 16 |
8 files changed, 60 insertions, 7 deletions
diff --git a/ucb/source/ucp/webdav/DAVAuthListener.hxx b/ucb/source/ucp/webdav/DAVAuthListener.hxx index 9718ef821cc4..4744b06f9649 100644 --- a/ucb/source/ucp/webdav/DAVAuthListener.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListener.hxx @@ -48,7 +48,8 @@ class DAVAuthListener : public salhelper::SimpleReferenceObject const ::rtl::OUString & inRealm, const ::rtl::OUString & inHostName, ::rtl::OUString & inoutUserName, - ::rtl::OUString & outPassWord ) = 0; + ::rtl::OUString & outPassWord, + const sal_Bool & bAllowPersistentStoring) = 0; }; } // namespace webdav_ucp diff --git a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx index df663ca1c74b..e697773eb198 100644 --- a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx @@ -63,7 +63,8 @@ namespace webdav_ucp virtual int authenticate( const ::rtl::OUString & inRealm, const ::rtl::OUString & inHostName, ::rtl::OUString & inoutUserName, - ::rtl::OUString & outPassWord ); + ::rtl::OUString & outPassWord, + const sal_Bool & bAllowPersistentStoring); private: com::sun::star::uno::Reference< diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index fdd026f76963..0def59082476 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -59,7 +59,8 @@ int DAVAuthListener_Impl::authenticate( const ::rtl::OUString & inRealm, const ::rtl::OUString & inHostName, ::rtl::OUString & inoutUserName, - ::rtl::OUString & outPassWord ) + ::rtl::OUString & outPassWord, + const sal_Bool & bAllowPersistentStoring) { if ( m_xEnv.is() ) { @@ -79,7 +80,9 @@ int DAVAuthListener_Impl::authenticate( = new ucbhelper::SimpleAuthenticationRequest( inHostName, inRealm, inoutUserName, - outPassWord ); + outPassWord, + ::rtl::OUString(), + bAllowPersistentStoring); xIH->handle( xRequest.get() ); rtl::Reference< ucbhelper::InteractionContinuation > xSelection @@ -531,6 +534,13 @@ void DAVResourceAccess::GET( } //========================================================================= +void DAVResourceAccess::ABORT() + throw( DAVException ) +{ + initialize(); + m_xSession->ABORT(); +} +//========================================================================= namespace { void resetInputStream( const uno::Reference< io::XInputStream > & rStream ) diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 267ce8f99d29..2ab863dc0b24 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -215,6 +215,10 @@ public: com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw( DAVException ); + void + ABORT() + throw( DAVException ); + // helper static void getUserRequestHeaders( const com::sun::star::uno::Reference< diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index 68facf14cba2..b6de1c5b10ad 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -134,6 +134,9 @@ public: const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; + virtual void ABORT() + throw( DAVException ) = 0; + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > POST( const rtl::OUString & inPath, const rtl::OUString & rContentType, diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index 165824a44c93..4ceeef476d66 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -60,6 +60,7 @@ #include <com/sun/star/security/CertificateContainerStatus.hpp> #include <com/sun/star/security/CertificateContainer.hpp> #include <com/sun/star/security/XCertificateContainer.hpp> +#include <com/sun/star/task/XMasterPasswordHandling.hpp> #ifndef _SIMPLECERTIFICATIONVALIDATIONREQUEST_HXX_ @@ -329,11 +330,19 @@ extern "C" int NeonSession_NeonAuth( void * inUserData, //thePassWord = rtl::OUString::createFromAscii( inoutPassWord ); } + //i97003 (tkr): Ask XMasterPasswordHandling if we should store the credentials persistently and give this information to the SimpleAuthenticationRequest + uno::Reference< ::com::sun::star::task::XMasterPasswordHandling > xMasterPasswordHandling = + uno::Reference< ::com::sun::star::task::XMasterPasswordHandling >( + theSession->getMSF().get()->createInstance( rtl::OUString::createFromAscii( "com.sun.star.task.PasswordContainer" )), uno::UNO_QUERY ); + // - + int theRetVal = pListener->authenticate( rtl::OUString::createFromAscii( inRealm ), theSession->getHostName(), theUserName, - thePassWord ); + thePassWord, + xMasterPasswordHandling.is() ? xMasterPasswordHandling->isPersistentStoringAllowed() : sal_False); + rtl::OString aUser( rtl::OUStringToOString( theUserName, RTL_TEXTENCODING_UTF8 ) ); if ( aUser.getLength() > ( NE_ABUFSIZ - 1 ) ) @@ -1250,6 +1259,16 @@ void NeonSession::POST( const rtl::OUString & inPath, } // ------------------------------------------------------------------- +// ABORT +// ------------------------------------------------------------------- +void NeonSession::ABORT() + throw ( DAVException ) +{ + if (NULL !=m_pHttpSession) + ne_close_connection(m_pHttpSession); +} + +// ------------------------------------------------------------------- // MKCOL // ------------------------------------------------------------------- void NeonSession::MKCOL( const rtl::OUString & inPath, diff --git a/ucb/source/ucp/webdav/NeonSession.hxx b/ucb/source/ucp/webdav/NeonSession.hxx index 98e9ea9fb17c..263169ae452a 100644 --- a/ucb/source/ucp/webdav/NeonSession.hxx +++ b/ucb/source/ucp/webdav/NeonSession.hxx @@ -209,6 +209,9 @@ class NeonSession : public DAVSession const DAVRequestEnvironment & rEnv ) throw ( DAVException ); + virtual void ABORT() + throw ( DAVException ); + // Note: Uncomment the following if locking support is required /* virtual void LOCK (const Lock & inLock, diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index dff18a5f1d73..afe2f2d3a7a8 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -862,8 +862,20 @@ uno::Any SAL_CALL Content::execute( void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) throw( uno::RuntimeException ) { - // @@@ Implement logic to abort running commands, if this makes - // sense for your conten.t + try + { + std::auto_ptr< DAVResourceAccess > xResAccess; + { + osl::MutexGuard aGuard( m_aMutex ); + xResAccess.reset( + new DAVResourceAccess( *m_xResAccess.get() ) ); + } + xResAccess->ABORT(); + } + catch ( DAVException const & /*e*/ ) + { + // ABORT command failed! + } } //========================================================================= |