diff options
author | Mihai Varga <mihai.mv13@gmail.com> | 2014-07-31 11:41:20 +0300 |
---|---|---|
committer | Mihai Varga <mihai.mv13@gmail.com> | 2014-07-31 11:41:20 +0300 |
commit | cb4734178ef0223903426e9e0fd8587f5886b8df (patch) | |
tree | 699e8853ae2acdb33ba190998d11c4e484b199ca | |
parent | 07f01a61b6e56feb6382600cb72f0a68462ef3be (diff) |
OneDrive authentication fallback request handler
Change-Id: I136912073582c29f68b25787b69f7cc117fb4a6a
-rw-r--r-- | uui/source/iahndl-authentication.cxx | 23 | ||||
-rw-r--r-- | uui/source/iahndl.cxx | 9 | ||||
-rw-r--r-- | uui/source/iahndl.hxx | 6 |
3 files changed, 38 insertions, 0 deletions
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index fbb1dba24c3d..b2876c469677 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/task/XInteractionPassword.hpp> #include <com/sun/star/task/XInteractionPassword2.hpp> #include <com/sun/star/task/XInteractionRetry.hpp> +#include <com/sun/star/ucb/XInteractionAuthFallback.hpp> #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp> #include <com/sun/star/ucb/URLAuthenticationRequest.hpp> @@ -39,6 +40,7 @@ #include <vcl/abstdlg.hxx> #include <vcl/svapp.hxx> +#include "authfallbackdlg.hxx" #include "ids.hrc" #include "getcontinuations.hxx" #include "passwordcontainer.hxx" @@ -744,4 +746,25 @@ UUIInteractionHelper::handlePasswordRequest( return false; } +bool +UUIInteractionHelper::handleAuthFallbackRequest( OUString & instructions, + OUString & url, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations ) +{ + Window * pParent = getParentProperty( ); + AuthFallbackDlg *dlg = new AuthFallbackDlg( pParent, instructions, url ); + int retCode = dlg->Execute( ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionAuthFallback > xAuthFallback; + getContinuations(rContinuations, &xAbort, &xAuthFallback); + + if( retCode == RET_OK && xAuthFallback.is( ) ) + { + xAuthFallback->setCode( dlg->GetCode( ) ); + xAuthFallback->select( ); + } + + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index d80904b33da6..694c602aeabd 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/task/XInteractionHandler2.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <com/sun/star/task/XInteractionRetry.hpp> +#include <com/sun/star/ucb/AuthenticationFallbackRequest.hpp> #include <com/sun/star/ucb/InteractiveAppException.hpp> #include <com/sun/star/ucb/InteractiveLockingLockedException.hpp> #include <com/sun/star/ucb/InteractiveLockingNotLockedException.hpp> @@ -829,6 +830,14 @@ UUIInteractionHelper::handleRequest_impl( if (!bObtainErrorStringOnly) { + ucb::AuthenticationFallbackRequest anAuthFallbackRequest; + if ( aAnyRequest >>= anAuthFallbackRequest ) + { + handleAuthFallbackRequest( anAuthFallbackRequest.instructions, + anAuthFallbackRequest.url, rRequest->getContinuations() ); + return true; + } + if ( handleAuthenticationRequest( rRequest ) ) return true; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index efbee64016d7..164c2635cf1e 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -295,6 +295,12 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest, const OUString& i_rServiceName ) const; + + bool + handleAuthFallbackRequest( + OUString & instructions, + OUString & url, + Continuations const & rContinuations ); }; class ErrorResource: private Resource |