diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-02 11:24:39 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-07-08 06:08:52 +0000 |
commit | 050c4f9ceca3046159f7a24d3d5abf8ec4e47fb3 (patch) | |
tree | e6191af8a990941e245fb05092edc0c2d19b6b08 /ucbhelper | |
parent | 9ab3e9292b093fc02c07fc52b25430d253277d1c (diff) |
tdf#84190 : when auth fails, don't remember passwords for cmis
Change-Id: Ia1e0d553556693e0efa6de0bfc6f8b0ae9d40b5d
Reviewed-on: https://gerrit.libreoffice.org/16688
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/provider/simpleauthenticationrequest.cxx | 32 |
1 files changed, 23 insertions, 9 deletions
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( |