From 298272f9dc154936e3bb813519903d12d35b2af9 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 2 Jul 2015 11:24:39 +0200 Subject: tdf#84190 : when auth fails, don't remember passwords for cmis Change-Id: Ia1e0d553556693e0efa6de0bfc6f8b0ae9d40b5d --- .../provider/simpleauthenticationrequest.cxx | 32 ++++++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'ucbhelper') diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx index cdaa80ab81f1..ad6c9cd8a8c4 100644 --- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx +++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx @@ -33,7 +33,8 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( const OUString & rPassword, const OUString & rAccount, bool bAllowPersistentStoring, - bool bAllowUseSystemCredentials ) + bool bAllowUseSystemCredentials, + bool bAllowSessionStoring ) { // Fill request... @@ -61,7 +62,8 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( true, aRequest.HasAccount, bAllowPersistentStoring, - bAllowUseSystemCredentials ); + bAllowUseSystemCredentials, + bAllowSessionStoring ); } @@ -115,17 +117,29 @@ void SimpleAuthenticationRequest::initialize( bool bCanSetPassword, bool bCanSetAccount, bool bAllowPersistentStoring, - bool bAllowUseSystemCredentials ) + bool bAllowUseSystemCredentials, + bool bAllowSessionStoring ) { setRequest( uno::makeAny( rRequest ) ); // Fill continuations... - uno::Sequence< ucb::RememberAuthentication > aRememberModes( - bAllowPersistentStoring ? 3 : 2 ); - aRememberModes[ 0 ] = ucb::RememberAuthentication_NO; - aRememberModes[ 1 ] = ucb::RememberAuthentication_SESSION; - if (bAllowPersistentStoring) - aRememberModes[ 2 ] = ucb::RememberAuthentication_PERSISTENT; + unsigned int nSize = 1; + unsigned int nPos = 0; + + if( bAllowSessionStoring ) + nSize++; + + if( bAllowPersistentStoring ) + nSize++; + + uno::Sequence< ucb::RememberAuthentication > aRememberModes( nSize ); + aRememberModes[ nPos++ ] = ucb::RememberAuthentication_NO; + + if( bAllowSessionStoring ) + aRememberModes[ nPos++ ] = ucb::RememberAuthentication_SESSION; + + if ( bAllowPersistentStoring ) + aRememberModes[ nPos++ ] = ucb::RememberAuthentication_PERSISTENT; m_xAuthSupplier = new InteractionSupplyAuthentication( -- cgit