summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-11-07 13:15:26 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-11-07 18:48:55 +0100
commit39768755e8db5fb79d398373cdcde2cfd4e0f20a (patch)
tree9dfe20d6e1358fdd7296b49315e3d1278110bf1b /svtools
parent9c30388aa239d7c9707d31bf827a2c5322a51e27 (diff)
OAuth2 application keys shouldn't be in the code.
The GDrive OAuth2 key is now defined at configure time. If either the client secret or client id is missing, the Google Drive connectivity will be disabled at runtime. Tinderboxes can set up a GDrive key, but they need to make sure it's not persisting in the build log. Change-Id: I09bc748641ec14eae890f273f05bffe4ed421dbb
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/dialogs/ServerDetailsControls.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index f7a76390f5f2..6582b1c137f3 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -22,6 +22,7 @@
#include <svtools/PlaceEditDialog.hxx>
#include <svtools/ServerDetailsControls.hxx>
+#include <config_oauth2.h>
using namespace std;
using namespace com::sun::star::lang;
@@ -278,12 +279,19 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
show( false );
// Load the ServerType entries
+ bool bSkipGDrive = OUString( GDRIVE_CLIENT_ID ).isEmpty() ||
+ OUString( GDRIVE_CLIENT_SECRET ).isEmpty();
+
Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
for ( sal_Int32 i = 0; i < aTypesUrlsList.getLength( ) && aTypesNamesList.getLength( ); ++i )
{
- m_pLBServerType->InsertEntry( aTypesNamesList[i] );
- m_aServerTypesURLs.push_back( aTypesUrlsList[i] );
+ OUString sUrl = aTypesUrlsList[i];
+ if ( !( sUrl == OUString( GDRIVE_BASE_URL ) && bSkipGDrive ) )
+ {
+ m_pLBServerType->InsertEntry( aTypesNamesList[i] );
+ m_aServerTypesURLs.push_back( sUrl );
+ }
}
}