[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3' - wsd/FileServer.cpp

Andras Timar andras.timar at collabora.com
Thu May 24 14:08:30 UTC 2018


 wsd/FileServer.cpp |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0220ab942150575ff6b1bad899b8a9da379816be
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu May 24 13:33:45 2018 +0200

    more tweaks to supported/unsupported branding
    
    Change-Id: I6df2047ace23a2613bb1a314284c8aa2cc2a5c8d
    Reviewed-on: https://gerrit.libreoffice.org/54759
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp
index 218d6a33d..378578c56 100644
--- a/wsd/FileServer.cpp
+++ b/wsd/FileServer.cpp
@@ -549,7 +549,7 @@ std::string FileServerRequestHandler::getRequestPathname(const HTTPRequest& requ
 
 constexpr char BRANDING[] = "branding";
 #if ENABLE_SUPPORT_KEY
-constexpr char BRANDING_SUPPORTED[] = "branding-supported";
+constexpr char BRANDING_UNSUPPORTED[] = "branding-unsupported";
 #endif
 
 void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::MemoryInputStream& message, const std::shared_ptr<StreamSocket>& socket)
@@ -612,10 +612,10 @@ void FileServerRequestHandler::preprocessFile(const HTTPRequest& request, Poco::
 #if ENABLE_SUPPORT_KEY
     const std::string keyString = config.getString("support_key", "");
     SupportKey key(keyString);
-    if (key.verify() && key.validDaysRemaining() > 0)
+    if (!key.verify() || key.validDaysRemaining() <= 0)
     {
-        brandCSS = Poco::format(linkCSS, std::string(BRANDING_SUPPORTED));
-        brandJS = Poco::format(scriptJS, std::string(BRANDING_SUPPORTED));
+        brandCSS = Poco::format(linkCSS, std::string(BRANDING_UNSUPPORTED));
+        brandJS = Poco::format(scriptJS, std::string(BRANDING_UNSUPPORTED));
     }
 #elif ENABLE_DEBUG
     brandCSS = "";
@@ -792,9 +792,9 @@ void FileServerRequestHandler::preprocessAdminFile(const HTTPRequest& request,co
     const std::string keyString = config.getString("support_key", "");
     SupportKey key(keyString);
 
-    if (key.verify() && key.validDaysRemaining() > 0)
+    if (!key.verify() || key.validDaysRemaining() <= 0)
     {
-        brandJS = Poco::format(scriptJS, std::string(BRANDING_SUPPORTED));
+        brandJS = Poco::format(scriptJS, std::string(BRANDING_UNSUPPORTED));
         brandFooter = Poco::format(footerPage, key.data(), Poco::DateTimeFormatter::format(key.expiry(), Poco::DateTimeFormat::RFC822_FORMAT));
     }
 #elif ENABLE_DEBUG


More information about the Libreoffice-commits mailing list