summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-07-02 11:24:39 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-07-16 09:53:23 +0200
commit298272f9dc154936e3bb813519903d12d35b2af9 (patch)
treef1f778b9f2bcd43813e8c124bf27d1169c8e9e72 /ucbhelper
parent51b316c80fe2ec7b4f01b56714358541ac1205fd (diff)
tdf#84190 : when auth fails, don't remember passwords for cmis
Change-Id: Ia1e0d553556693e0efa6de0bfc6f8b0ae9d40b5d
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/provider/simpleauthenticationrequest.cxx32
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(