diff options
author | sb <sb@openoffice.org> | 2009-09-25 15:27:34 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2009-09-25 15:27:34 +0200 |
commit | 6da618739964d7a9ea38293ec8b3c2f5e0b7c9b8 (patch) | |
tree | d9dadce2766459422adab55791e1f2c1c767f681 /ucbhelper/source | |
parent | c763ddce153dbb73707680874ef9d2f011caaeeb (diff) | |
parent | 728c8eb458b5613eb5b8bbe8201dfc33a8a9cd78 (diff) |
merged in DEV300_m60
Diffstat (limited to 'ucbhelper/source')
-rw-r--r-- | ucbhelper/source/provider/interactionrequest.cxx | 32 | ||||
-rw-r--r-- | ucbhelper/source/provider/simpleauthenticationrequest.cxx | 125 |
2 files changed, 102 insertions, 55 deletions
diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx index 8bfb4461d6f3..df91c47dc8fe 100644 --- a/ucbhelper/source/provider/interactionrequest.cxx +++ b/ucbhelper/source/provider/interactionrequest.cxx @@ -704,7 +704,8 @@ InteractionSupplyAuthentication::queryInterface( const uno::Type & rType ) uno::Any aRet = cppu::queryInterface( rType, static_cast< lang::XTypeProvider * >( this ), static_cast< task::XInteractionContinuation * >( this ), - static_cast< ucb::XInteractionSupplyAuthentication * >( this ) ); + static_cast< ucb::XInteractionSupplyAuthentication * >( this ), + static_cast< ucb::XInteractionSupplyAuthentication2 * >( this )); return aRet.hasValue() ? aRet : InteractionContinuation::queryInterface( rType ); @@ -750,7 +751,7 @@ uno::Sequence< uno::Type > SAL_CALL InteractionSupplyAuthentication::getTypes() uno::Reference< lang::XTypeProvider > * >( 0 ) ), getCppuType( static_cast< uno::Reference< - ucb::XInteractionSupplyAuthentication > * >( 0 ) ) ); + ucb::XInteractionSupplyAuthentication2 > * >( 0 ) ) ); pCollection = &collection; } } @@ -905,6 +906,33 @@ void SAL_CALL InteractionSupplyAuthentication::setRememberAccount( } //========================================================================= +// +// XInteractionSupplyAuthentication2 methods. +// +//========================================================================= + +// virtual +::sal_Bool SAL_CALL +InteractionSupplyAuthentication::canUseSystemCredentials( + ::sal_Bool& Default ) + throw ( uno::RuntimeException ) +{ + Default = m_bDefaultUseSystemCredentials; + return m_bCanUseSystemCredentials; +} + +//========================================================================= +// virtual +void SAL_CALL InteractionSupplyAuthentication::setUseSystemCredentials( + ::sal_Bool UseSystemCredentials ) + throw ( uno::RuntimeException ) +{ + if ( m_bCanUseSystemCredentials ) + m_bUseSystemCredentials = UseSystemCredentials; +} + + +//========================================================================= //========================================================================= // // InteractionSupplyName Implementation. diff --git a/ucbhelper/source/provider/simpleauthenticationrequest.cxx b/ucbhelper/source/provider/simpleauthenticationrequest.cxx index 16570f7f012d..c5d7448fa29b 100644 --- a/ucbhelper/source/provider/simpleauthenticationrequest.cxx +++ b/ucbhelper/source/provider/simpleauthenticationrequest.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucbhelper.hxx" #include <com/sun/star/task/XMasterPasswordHandling.hpp> +#include <com/sun/star/ucb/URLAuthenticationRequest.hpp> #include <ucbhelper/simpleauthenticationrequest.hxx> using namespace com::sun::star; @@ -38,14 +39,15 @@ using namespace ucbhelper; //========================================================================= SimpleAuthenticationRequest::SimpleAuthenticationRequest( + const rtl::OUString & rURL, const rtl::OUString & rServerName, const rtl::OUString & rRealm, const rtl::OUString & rUserName, const rtl::OUString & rPassword, const rtl::OUString & rAccount ) { - // Fill request... - ucb::AuthenticationRequest aRequest; + // Fill request... + ucb::URLAuthenticationRequest aRequest; // aRequest.Message = // OUString // aRequest.Context = // XInterface aRequest.Classification = task::InteractionClassification_ERROR; @@ -61,26 +63,30 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( aRequest.HasAccount = ( rAccount.getLength() > 0 ); if ( aRequest.HasAccount ) aRequest.Account = rAccount; + aRequest.URL = rURL; - initialize(aRequest, + initialize(aRequest, sal_False, sal_True, sal_True, aRequest.HasAccount, - sal_False); + sal_False, + sal_False ); } //========================================================================= SimpleAuthenticationRequest::SimpleAuthenticationRequest( + const rtl::OUString & rURL, const rtl::OUString & rServerName, const rtl::OUString & rRealm, const rtl::OUString & rUserName, const rtl::OUString & rPassword, const rtl::OUString & rAccount, - const sal_Bool & bAllowPersistentStoring ) + sal_Bool bAllowPersistentStoring, + sal_Bool bAllowUseSystemCredentials ) { - // Fill request... - ucb::AuthenticationRequest aRequest; + // Fill request... + ucb::URLAuthenticationRequest aRequest; // aRequest.Message = // OUString // aRequest.Context = // XInterface aRequest.Classification = task::InteractionClassification_ERROR; @@ -96,56 +102,20 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( aRequest.HasAccount = ( rAccount.getLength() > 0 ); if ( aRequest.HasAccount ) aRequest.Account = rAccount; + aRequest.URL = rURL; - initialize(aRequest, + initialize(aRequest, sal_False, sal_True, sal_True, aRequest.HasAccount, - bAllowPersistentStoring); -} - -void SimpleAuthenticationRequest::initialize( - ucb::AuthenticationRequest aRequest, - const sal_Bool & bCanSetRealm, - const sal_Bool & bCanSetUserName, - const sal_Bool & bCanSetPassword, - const sal_Bool & bCanSetAccount, - const sal_Bool & bAllowPersistentStoring ) -{ - setRequest( uno::makeAny( aRequest ) ); - - // Fill continuations... - uno::Sequence< ucb::RememberAuthentication > aRememberModes( bAllowPersistentStoring ? 3 : 2 ); - aRememberModes[ 0 ] = ucb::RememberAuthentication_NO; - aRememberModes[ 1 ] = ucb::RememberAuthentication_SESSION; - if (bAllowPersistentStoring) - aRememberModes[ 1 ] = ucb::RememberAuthentication_PERSISTENT; - - m_xAuthSupplier - = new InteractionSupplyAuthentication( - this, - bCanSetRealm, - bCanSetUserName, - bCanSetPassword, - bCanSetAccount, - aRememberModes, // rRememberPasswordModes - ucb::RememberAuthentication_SESSION, // eDefaultRememberPasswordMode - aRememberModes, // rRememberAccountModes - ucb::RememberAuthentication_SESSION // eDefaultRememberAccountMode - ); - - uno::Sequence< - uno::Reference< task::XInteractionContinuation > > aContinuations( 3 ); - aContinuations[ 0 ] = new InteractionAbort( this ); - aContinuations[ 1 ] = new InteractionRetry( this ); - aContinuations[ 2 ] = m_xAuthSupplier.get(); - - setContinuations( aContinuations ); + bAllowPersistentStoring, + bAllowUseSystemCredentials ); } //========================================================================= SimpleAuthenticationRequest::SimpleAuthenticationRequest( + const rtl::OUString & rURL, const rtl::OUString & rServerName, EntityType eRealmType, const rtl::OUString & rRealm, @@ -157,7 +127,7 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( const rtl::OUString & rAccount ) { // Fill request... - ucb::AuthenticationRequest aRequest; + ucb::URLAuthenticationRequest aRequest; // aRequest.Message = // OUString // aRequest.Context = // XInterface aRequest.Classification = task::InteractionClassification_ERROR; @@ -175,17 +145,20 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( aRequest.HasAccount = eAccountType != ENTITY_NA; if ( aRequest.HasAccount ) aRequest.Account = rAccount; + aRequest.URL = rURL; initialize(aRequest, eRealmType == ENTITY_MODIFY, eUserNameType == ENTITY_MODIFY, ePasswordType == ENTITY_MODIFY, eAccountType == ENTITY_MODIFY, - sal_False); + sal_False, + sal_False ); } //========================================================================= SimpleAuthenticationRequest::SimpleAuthenticationRequest( + const rtl::OUString & rURL, const rtl::OUString & rServerName, EntityType eRealmType, const rtl::OUString & rRealm, @@ -195,10 +168,11 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( const rtl::OUString & rPassword, EntityType eAccountType, const rtl::OUString & rAccount, - const sal_Bool & bAllowPersistentStoring ) + sal_Bool bAllowPersistentStoring, + sal_Bool bAllowUseSystemCredentials ) { // Fill request... - ucb::AuthenticationRequest aRequest; + ucb::URLAuthenticationRequest aRequest; // aRequest.Message = // OUString // aRequest.Context = // XInterface aRequest.Classification = task::InteractionClassification_ERROR; @@ -216,11 +190,56 @@ SimpleAuthenticationRequest::SimpleAuthenticationRequest( aRequest.HasAccount = eAccountType != ENTITY_NA; if ( aRequest.HasAccount ) aRequest.Account = rAccount; + aRequest.URL = rURL; initialize(aRequest, eRealmType == ENTITY_MODIFY, eUserNameType == ENTITY_MODIFY, ePasswordType == ENTITY_MODIFY, eAccountType == ENTITY_MODIFY, - bAllowPersistentStoring); + bAllowPersistentStoring, + bAllowUseSystemCredentials ); +} + +//========================================================================= +void SimpleAuthenticationRequest::initialize( + const ucb::URLAuthenticationRequest & rRequest, + sal_Bool bCanSetRealm, + sal_Bool bCanSetUserName, + sal_Bool bCanSetPassword, + sal_Bool bCanSetAccount, + sal_Bool bAllowPersistentStoring, + sal_Bool bAllowUseSystemCredentials ) +{ + 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[ 1 ] = ucb::RememberAuthentication_PERSISTENT; + + m_xAuthSupplier + = new InteractionSupplyAuthentication( + this, + bCanSetRealm, + bCanSetUserName, + bCanSetPassword, + bCanSetAccount, + aRememberModes, // rRememberPasswordModes + ucb::RememberAuthentication_SESSION, // eDefaultRememberPasswordMode + aRememberModes, // rRememberAccountModes + ucb::RememberAuthentication_SESSION, // eDefaultRememberAccountMode + bAllowUseSystemCredentials, // bCanUseSystemCredentials, + false // bDefaultUseSystemCredentials + ); + + uno::Sequence< + uno::Reference< task::XInteractionContinuation > > aContinuations( 3 ); + aContinuations[ 0 ] = new InteractionAbort( this ); + aContinuations[ 1 ] = new InteractionRetry( this ); + aContinuations[ 2 ] = m_xAuthSupplier.get(); + + setContinuations( aContinuations ); } |