summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/webdav/DAVResourceAccess.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/ucp/webdav/DAVResourceAccess.cxx')
-rw-r--r--ucb/source/ucp/webdav/DAVResourceAccess.cxx60
1 files changed, 39 insertions, 21 deletions
diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
index 0def59082476..67f8e5a386f0 100644
--- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx
+++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx
@@ -60,7 +60,8 @@ int DAVAuthListener_Impl::authenticate(
const ::rtl::OUString & inHostName,
::rtl::OUString & inoutUserName,
::rtl::OUString & outPassWord,
- const sal_Bool & bAllowPersistentStoring)
+ sal_Bool bAllowPersistentStoring,
+ sal_Bool bCanUseSystemCredentials )
{
if ( m_xEnv.is() )
{
@@ -77,12 +78,14 @@ int DAVAuthListener_Impl::authenticate(
outPassWord = m_aPrevPassword;
rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest
- = new ucbhelper::SimpleAuthenticationRequest( inHostName,
+ = new ucbhelper::SimpleAuthenticationRequest( m_aURL,
+ inHostName,
inRealm,
inoutUserName,
outPassWord,
::rtl::OUString(),
- bAllowPersistentStoring);
+ bAllowPersistentStoring,
+ bCanUseSystemCredentials );
xIH->handle( xRequest.get() );
rtl::Reference< ucbhelper::InteractionContinuation > xSelection
@@ -99,8 +102,23 @@ int DAVAuthListener_Impl::authenticate(
ucbhelper::InteractionSupplyAuthentication > & xSupp
= xRequest->getAuthenticationSupplier();
- inoutUserName = xSupp->getUserName();
- outPassWord = xSupp->getPassword();
+ sal_Bool bUseSystemCredentials = sal_False;
+
+ if ( bCanUseSystemCredentials )
+ bUseSystemCredentials = xSupp->getUseSystemCredentials();
+
+ if ( bUseSystemCredentials )
+ {
+ // This is the (strange) way to tell neon to use
+ // system credentials.
+ inoutUserName = rtl::OUString();
+ outPassWord = rtl::OUString();
+ }
+ else
+ {
+ inoutUserName = xSupp->getUserName();
+ outPassWord = xSupp->getPassword();
+ }
// #102871# - Remember username and password.
m_aPrevUsername = inoutUserName;
@@ -186,7 +204,7 @@ void DAVResourceAccess::OPTIONS(
rCapabilities,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv) );
}
catch ( DAVException & e )
@@ -231,7 +249,7 @@ void DAVResourceAccess::PROPFIND(
rResources,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -273,7 +291,7 @@ void DAVResourceAccess::PROPFIND(
rResInfo,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) ) ;
}
catch ( DAVException & e )
@@ -313,7 +331,7 @@ void DAVResourceAccess::PROPPATCH(
rValues,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -353,7 +371,7 @@ void DAVResourceAccess::HEAD(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -391,7 +409,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET(
xStream = m_xSession->GET( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -432,7 +450,7 @@ void DAVResourceAccess::GET(
rStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -474,7 +492,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -519,7 +537,7 @@ void DAVResourceAccess::GET(
rResource,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -601,7 +619,7 @@ void DAVResourceAccess::PUT(
xSeekableStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -655,7 +673,7 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST(
xSeekableStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -719,7 +737,7 @@ void DAVResourceAccess::POST(
rOutputStream,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -762,7 +780,7 @@ void DAVResourceAccess::MKCOL(
m_xSession->MKCOL( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )
@@ -802,7 +820,7 @@ void DAVResourceAccess::COPY(
rDestinationURI,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ),
bOverwrite );
}
@@ -843,7 +861,7 @@ void DAVResourceAccess::MOVE(
rDestinationURI,
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ),
bOverwrite );
}
@@ -882,7 +900,7 @@ void DAVResourceAccess::DESTROY(
m_xSession->DESTROY( getRequestURI(),
DAVRequestEnvironment(
getRequestURI(),
- new DAVAuthListener_Impl( xEnv ),
+ new DAVAuthListener_Impl( xEnv, m_aURL ),
aHeaders, xEnv ) );
}
catch ( DAVException & e )