wsd/FileServer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit 14bda5897e9007091263dfd8c02712a4d598ecbc Author: Andras Timar <[email protected]> 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 <[email protected]> Tested-by: Jan Holesovsky <[email protected]> diff --git a/wsd/FileServer.cpp b/wsd/FileServer.cpp index 669f57c4b..3f7080ecd 100644 --- a/wsd/FileServer.cpp +++ b/wsd/FileServer.cpp @@ -564,7 +564,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) @@ -627,10 +627,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 = ""; @@ -807,9 +807,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 _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
