summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2015-08-26 13:48:59 +0200
committerSzymon Kłos <eszkadev@gmail.com>2015-08-29 12:33:20 +0200
commit51c3a6421ecdb3443121c26e3bdeb21b07bd1fd8 (patch)
treecd68488980d4da4f0fc9f4c8099c0534dd9a1e86 /fpicker
parentc879fa8e5fd7779ca242fe368cbdd70084df049b (diff)
remember password for all types of service
Change-Id: I8620332ac5228eee1d7c16d0b0ff7920031be331
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/office/RemoteFilesDialog.cxx19
-rw-r--r--fpicker/source/office/RemoteFilesDialog.hxx3
2 files changed, 16 insertions, 6 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4d1cc1515716..c8ffde084e1d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -687,11 +687,16 @@ void RemoteFilesDialog::DisableControls()
m_pCancel_btn->Enable( true );
}
-void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword )
+void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUser
+ , const OUString& rPassword, bool bPersistent )
{
+ if( rURL.isEmpty() || rUser.isEmpty() || rPassword.isEmpty() )
+ return;
+
try
{
- if( m_xMasterPasswd->isPersistentStoringAllowed() && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) )
+ if( m_xMasterPasswd->isPersistentStoringAllowed() &&
+ ( !bPersistent || m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) )
{
Reference< XInteractionHandler > xInteractionHandler(
InteractionHandler::createWithParent( m_xContext, 0 ),
@@ -700,8 +705,11 @@ void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUse
Sequence< OUString > aPasswd( 1 );
aPasswd[0] = rPassword;
- m_xMasterPasswd->addPersistent(
- rURL, rUser, aPasswd, xInteractionHandler );
+ if( bPersistent )
+ m_xMasterPasswd->addPersistent(
+ rURL, rUser, aPasswd, xInteractionHandler );
+ else
+ m_xMasterPasswd->add( rURL, rUser, aPasswd, xInteractionHandler );
}
}
catch( const Exception& )
@@ -725,7 +733,8 @@ IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, AddServiceHdl, Button*, void )
OUString sUser = aDlg->GetUser();
if( !sUser.isEmpty() && !sPassword.isEmpty() )
{
- SavePassword( newService->GetUrl(), sUser, sPassword );
+ bool bPersistent = aDlg->IsRememberChecked();
+ SavePassword( newService->GetUrl(), sUser, sPassword, bPersistent );
}
OUString sPrefix = lcl_GetServiceType( newService );
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 65ce6c22ef43..a1ce0def526e 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -182,7 +182,8 @@ private:
void EnableControls();
void DisableControls();
- void SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword );
+ void SavePassword( const OUString& rURL, const OUString& rUser
+ , const OUString& rPassword, bool bPersistent );
DECL_LINK_TYPED ( AddServiceHdl, Button*, void );
DECL_LINK ( SelectServiceHdl, void * );