[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - officecfg/registry uui/source

Mike Kaganski mike.kaganski at collabora.com
Sat May 6 05:00:31 UTC 2017


 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    8 ++++++
 uui/source/passwordcontainer.cxx                           |   16 ++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 4bf7cf2440e7d85baa365638858ec13aa534e2ba
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Fri May 5 18:34:36 2017 +0300

    tdf#107649: add TrySystemCredentialsFirst config option
    
    This will allow automatically try system credentials for any URI
    (including unknown) before displaying dialogs. This is intended for
    corporate enviromnents.
    
    Default value of this option is false, keeping current behavior.
    
    Change-Id: I96cb18e089134325e1f92f1afdef331975000e3b
    Reviewed-on: https://gerrit.libreoffice.org/37297
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit ffd8e6b44e7dacb28047661fd6b73061790761cf)
    Reviewed-on: https://gerrit.libreoffice.org/37303
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 946bd3262501..37a1c9861ec7 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -935,6 +935,14 @@
           credentials of the user.</desc>
         </info>
       </prop>
+      <prop oor:name="TrySystemCredentialsFirst" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Specifies if authentication using system credentials should be tried
+          automatically for all resources that support it (regardless of whether they are
+          in "AuthenticateUsingSystemCredentials" list or not).</desc>
+        </info>
+        <value>false</value>
+      </prop>
     </group>
     <group oor:name="Dictionaries">
       <info>
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index e724fbb03441..00cd9d05584b 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -30,6 +30,7 @@
 #include <com/sun/star/ucb/URLAuthenticationRequest.hpp>
 #include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
 #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp>
+#include "officecfg/Office/Common.hxx"
 
 #include "passwordcontainer.hxx"
 
@@ -142,11 +143,16 @@ bool PasswordContainerHelper::handleAuthenticationRequest(
 
     if ( bCanUseSystemCredentials )
     {
-        // Runtime / Persistent info avail for current auth request?
-
-        OUString aResult = m_xPasswordContainer->findUrl(
-            rURL.isEmpty() ? rRequest.ServerName : rURL );
-        if ( !aResult.isEmpty() )
+        // Does the configuration mandate that we try system credentials first?
+        bool bUseSystemCredentials = ::officecfg::Office::Common::Passwords::TrySystemCredentialsFirst::get();
+        if (!bUseSystemCredentials)
+        {
+            // Runtime / Persistent info avail for current auth request?
+            OUString aResult = m_xPasswordContainer->findUrl(
+                rURL.isEmpty() ? rRequest.ServerName : rURL);
+            bUseSystemCredentials = !aResult.isEmpty();
+        }
+        if ( bUseSystemCredentials )
         {
             if ( fillContinuation( true,
                                    rRequest,


More information about the Libreoffice-commits mailing list