Skip to content

[webgui] let suppress warnings from webgui components #19027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gui/browserv7/src/RWebBrowserImp.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "TROOT.h"
#include "TSeqCollection.h" // needed in gROOT->GetListOfFiles()->FindObject
#include "TEnv.h"

#include <iostream>

Expand Down Expand Up @@ -71,7 +72,13 @@ RWebBrowserImp::~RWebBrowserImp()
void RWebBrowserImp::ShowWarning()
{
static bool show_warn = true;
if (!show_warn) return;
if (!show_warn)
return;

TString value = gEnv->GetValue("WebGui.Warning", "yes");
if ((value != "yes") && (value != "1"))
return;

show_warn = false;

std::cout << "\n"
Expand Down
15 changes: 10 additions & 5 deletions gui/webdisplay/src/RWebWindowsManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,18 @@ void RWebWindowsManager::AssignMainThrd()
void RWebWindowsManager::SetLoopbackMode(bool on)
{
gWebWinLoopbackMode = on;
bool print_warning = RWebWindowWSHandler::GetBoolEnv("WebGui.Warning", 1) == 1;
if (!on) {
printf("\nWARNING!\n");
printf("Disabling loopback mode may leads to security problem.\n");
printf("See https://root.cern/about/security/ for more information.\n\n");
if (print_warning) {
printf("\nWARNING!\n");
printf("Disabling loopback mode may leads to security problem.\n");
printf("See https://root.cern/about/security/ for more information.\n\n");
}
if (!gWebWinUseSessionKey) {
printf("Enforce session key to safely work on public network.\n");
printf("One may call RWebWindowsManager::SetUseSessionKey(false); to disable it.\n");
if (print_warning) {
printf("Enforce session key to safely work on public network.\n");
printf("One may call RWebWindowsManager::SetUseSessionKey(false); to disable it.\n");
}
gWebWinUseSessionKey = true;
}
}
Expand Down
Loading