[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - wsd/DocumentBroker.cpp wsd/LOOLWSD.cpp wsd/LOOLWSD.hpp

Jan Holesovsky kendy at collabora.com
Wed Oct 4 05:54:21 UTC 2017


 wsd/DocumentBroker.cpp |    5 +++++
 wsd/LOOLWSD.cpp        |    5 +++++
 wsd/LOOLWSD.hpp        |    1 +
 3 files changed, 11 insertions(+)

New commits:
commit 4b0894cbd2a554df9dc690d985421bf66aa99e83
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Wed Oct 4 05:54:05 2017 +0200

    More information about the support key state.
    
    Change-Id: I0fb7792df3c0ba97497b7d9f5281640c40eb49a4
    Reviewed-on: https://gerrit.libreoffice.org/43112
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 85042585..fe6bbc61 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -483,6 +483,11 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s
         }
     }
 
+#if ENABLE_SUPPORT_KEY
+    if (!LOOLWSD::OverrideWatermark.empty())
+        watermarkText = LOOLWSD::OverrideWatermark;
+#endif
+
     LOG_DBG("Setting username [" << username << "] and userId [" << userid << "] for session [" << sessionId << "]");
     session->setUserId(userid);
     session->setUserName(username);
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 2c3c5486..7b134862 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -556,6 +556,7 @@ Util::RuntimeConstant<bool> LOOLWSD::SSLTermination;
 std::set<std::string> LOOLWSD::EditFileExtensions;
 unsigned LOOLWSD::MaxConnections;
 unsigned LOOLWSD::MaxDocuments;
+std::string LOOLWSD::OverrideWatermark;
 
 static std::string UnitTestLibrary;
 
@@ -783,6 +784,7 @@ void LOOLWSD::initialize(Application& self)
     {
         LOG_WRN("Support key not set, please use 'loolconfig set-support-key'.");
         std::cerr << "Support key not set, please use 'loolconfig set-support-key'." << std::endl;
+        LOOLWSD::OverrideWatermark = "Unsupported, the support key is missing.";
     }
     else
     {
@@ -792,6 +794,7 @@ void LOOLWSD::initialize(Application& self)
         {
             LOG_WRN("Invalid support key, please use 'loolconfig set-support-key'.");
             std::cerr << "Invalid support key, please use 'loolconfig set-support-key'." << std::endl;
+            LOOLWSD::OverrideWatermark = "Unsupported, the support key is invalid.";
         }
         else
         {
@@ -800,12 +803,14 @@ void LOOLWSD::initialize(Application& self)
             {
                 LOG_WRN("Your support key has expired, please ask for a new one, and use 'loolconfig set-support-key'.");
                 std::cerr << "Your support key has expired, please ask for a new one, and use 'loolconfig set-support-key'." << std::endl;
+                LOOLWSD::OverrideWatermark = "Unsupported, the support key has expired.";
             }
             else
             {
                 LOG_INF("Your support key is valid for " << validDays << " days");
                 LOOLWSD::MaxConnections = 1000;
                 LOOLWSD::MaxDocuments = 200;
+                LOOLWSD::OverrideWatermark = "";
             }
         }
     }
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp
index 88318c5e..80d2d9e2 100644
--- a/wsd/LOOLWSD.hpp
+++ b/wsd/LOOLWSD.hpp
@@ -58,6 +58,7 @@ public:
     static std::set<std::string> EditFileExtensions;
     static unsigned MaxConnections;
     static unsigned MaxDocuments;
+    static std::string OverrideWatermark;
 
     /// Flag to shutdown the server.
     std::atomic<bool> ShutdownFlag;


More information about the Libreoffice-commits mailing list