[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - fpicker/source

Szymon Kłos eszkadev at gmail.com
Tue Aug 25 02:53:04 PDT 2015


 fpicker/source/office/RemoteFilesDialog.cxx |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

New commits:
commit db7d1b4af5a309fe368d01cb9965ba632f2fbee2
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Aug 25 11:51:11 2015 +0200

    Remove stored password if service is deleted
    
    Change-Id: I500a8ee2874f7a9577e37fe25f5813e5821e9719

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 19ea5b5..dfc14e1 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -824,6 +824,30 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
             if( aBox->Execute() == RET_YES )
             {
+                // remove password
+                try
+                {
+                    if( m_xMasterPasswd->isPersistentStoringAllowed() )
+                    {
+                        OUString sUrl( m_aServices[nPos]->GetUrl() );
+
+                        Reference< XInteractionHandler > xInteractionHandler(
+                            InteractionHandler::createWithParent( m_xContext, 0 ),
+                            UNO_QUERY );
+
+                        UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler );
+
+                        if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() )
+                        {
+                            OUString sUserName = aURLEntries.UserList[0].UserName;
+
+                            m_xMasterPasswd->removePersistent( sUrl, sUserName );
+                        }
+                    }
+                }
+                catch( const Exception& )
+                {}
+
                 m_aServices.erase( m_aServices.begin() + nPos );
                 m_pServices_lb->RemoveEntry( nSelected );
 


More information about the Libreoffice-commits mailing list