Debug v22
This commit is contained in:
parent
9276042264
commit
34ecb66ec6
2 changed files with 39 additions and 28 deletions
|
|
@ -2636,3 +2636,4 @@ AIModelForFeature=AI model for features (AI service %s)
|
|||
communityRepo=Community repository
|
||||
online=Online
|
||||
NotConnected=Not connected
|
||||
GraphicalView=Graphical view
|
||||
|
|
|
|||
|
|
@ -4387,51 +4387,52 @@ if ($action == 'editsecurity') {
|
|||
|
||||
// Force RP
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceRP'), $langs->trans("Recommended").': "strict-origin-when-cross-origin" '.$langs->trans("or").' "same-origin"=more secured"').'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceRP'), 'HTTP Header Referer-Policy<br><br>'.$langs->trans("Recommended").':<br>"strict-origin-when-cross-origin" '.$langs->trans("or").' "same-origin"=more secured"', 1, 'help', 'valignmiddle', 0, 3, 'WEBSITE_'.$object->id.'_SECURITY_FORCERP').'</td>';
|
||||
print '<td><input class="minwidth500" name="WEBSITE_'.$object->id.'_SECURITY_FORCERP" id="WEBSITE_'.$object->id.'_SECURITY_FORCERP" value="'.getDolGlobalString("WEBSITE_".$object->id."_SECURITY_FORCERP").'"></td>';
|
||||
print '</tr>';
|
||||
// Force STS
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceSTS'), $langs->trans("Example").': "max-age=31536000; includeSubDomains"').'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceSTS'), 'HTTP Header Strict-Transport-Security<br><br>'.$langs->trans("Example").':<br>"max-age=31536000; includeSubDomains"', 1, 'help', 'valignmiddle', 0, 3, 'WEBSITE_'.$object->id.'_SECURITY_FORCESTS').'</td>';
|
||||
print '<td><input class="minwidth500" name="WEBSITE_'.$object->id.'_SECURITY_FORCESTS" id="WEBSITE_'.$object->id.'_SECURITY_FORCESTS" value="'.getDolGlobalString("WEBSITE_".$object->id."_SECURITY_FORCESTS").'"></td>';
|
||||
print '</tr>';
|
||||
// Force PP
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForcePP'), $langs->trans("Example").': "camera=(), microphone=(), geolocation=*"').'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForcePP'), 'HTTP Header Permissions-Policy<br><br>'.$langs->trans("Example").':<br>"camera=(), microphone=(), geolocation=*"', 1, 'help', 'valignmiddle', 0, 3, 'WEBSITE_'.$object->id.'_SECURITY_FORCEPP').'</td>';
|
||||
print '<td><input class="minwidth500" name="WEBSITE_'.$object->id.'_SECURITY_FORCEPP" id="WEBSITE_'.$object->id.'_SECURITY_FORCEPP" value="'.getDolGlobalString("WEBSITE_".$object->id."_SECURITY_FORCEPP").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
$examplecsprule = "frame-ancestors 'self'; img-src * data:; font-src *; default-src 'self' 'unsafe-inline' 'unsafe-eval' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com;";
|
||||
// Force CSPRO
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceCSPRO'), $langs->trans("Example").": ".$examplecsprule).'</td>';
|
||||
print '<td>'.$form->textwithpicto($langs->trans('WebsiteSecurityForceCSPRO'), 'HTTP Header Content-Security-Policy-Report-Only<br><br>'.$langs->trans("Example").":<br>".$examplecsprule, 1, 'help', 'valignmiddle', 0, 3, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSPRO').'</td>';
|
||||
print '<td><input class="minwidth500" name="WEBSITE_'.$object->id.'_SECURITY_FORCECSPRO" id="WEBSITE_'.$object->id.'_SECURITY_FORCECSPRO" value="'.getDolGlobalString("WEBSITE_".$object->id."_SECURITY_FORCECSPRO").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
// Content Security Policy
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="centpercent">';
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans('ContentSecurityPolicy'), $langs->trans("Example").": ".$examplecsprule).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Value").':</span></td><td colspan=2><input style="width:90%;" class="minwidth500" name="WEBSITE_'.$object->id.'_SECURITY_FORCECSP" id="WEBSITE_'.$object->id.'_SECURITY_FORCECSP" value="'.$forceCSP.'"></td></tr>';
|
||||
|
||||
print '<tr><td></td></tr>';
|
||||
|
||||
print '<tr><td></td>';
|
||||
print '<td>'.$form->selectarray("select_identifier_WEBSITE_SECURITY_FORCECSP", $selectarrayCSPDirectives, "select_identifier_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth300').'</td>';
|
||||
// Force CSP - Content Security Policy
|
||||
print '<tr class="oddeven nohover">';
|
||||
print '<td class="tdtop">'.$form->textwithpicto($langs->trans('ContentSecurityPolicy'), 'HTTP Header Content-Security-Policy<br><br>'.$langs->trans("Example").":<br>".$examplecsprule, 1, 'help', 'valignmiddle', 0, 3, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP').'</td>';
|
||||
print '<td>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
|
||||
print '<input class="minwidth500 quatrevingtpercent" name="WEBSITE_'.$object->id.'_SECURITY_FORCECSP" id="WEBSITE_'.$object->id.'_SECURITY_FORCECSP" value="'.$forceCSP.'"><br>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="nowraponall">';
|
||||
print img_picto('', 'graph', 'class="pictofixedwidth"').$langs->trans("GraphicalView").'<br>';
|
||||
print $form->selectarray("select_identifier_WEBSITE_SECURITY_FORCECSP", $selectarrayCSPDirectives, "select_identifier_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth200 maxwidth300 inline-block');
|
||||
print ' ';
|
||||
print '<input type="hidden" id="select_source_WEBSITE_SECURITY_FORCECSP" name="select_source_WEBSITE_SECURITY_FORCECSP">';
|
||||
foreach ($selectarrayCSPSources as $key => $values) {
|
||||
print '<div class="div_WEBSITE_SECURITY_FORCECSP hidden" id="div_'.$key.'_WEBSITE_SECURITY_FORCECSP">';
|
||||
print $form->selectarray("select_".$key."_WEBSITE_SECURITY_FORCECSP", $values, "select_".$key."_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth300 select_WEBSITE_SECURITY_FORCECSP');
|
||||
print '<div class="div_WEBSITE_SECURITY_FORCECSP hidden inline-block maxwidth200" id="div_'.$key.'_WEBSITE_SECURITY_FORCECSP">';
|
||||
print $form->selectarray("select_".$key."_WEBSITE_SECURITY_FORCECSP", $values, "select_".$key."_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth200 maxwidth300 inline-block select_WEBSITE_SECURITY_FORCECSP');
|
||||
print '</div>';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td><div class="div_input_data_WEBSITE_SECURITY_FORCECSP hidden"><input id="input_data_WEBSITE_SECURITY_FORCECSP" name="input_data_WEBSITE_SECURITY_FORCECSP"></div></td>';
|
||||
print '<td><div class="div_btn_class_WEBSITE_SECURITY_FORCECSP hidden"><input type="submit" id="btn_WEBSITE_SECURITY_FORCECSP" name="btn_WEBSITE_SECURITY_FORCECSP" class="butAction" value="'.$langs->trans("Add").'"></div></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
print ' ';
|
||||
print '<div class="div_input_data_WEBSITE_SECURITY_FORCECSP hidden inline-block maxwidth200"><input id="input_data_WEBSITE_SECURITY_FORCECSP" name="input_data_WEBSITE_SECURITY_FORCECSP"></div>';
|
||||
print ' ';
|
||||
print '<div class="div_btn_class_WEBSITE_SECURITY_FORCECSP hidden inline-block maxwidth200"><input type="submit" id="btn_WEBSITE_SECURITY_FORCECSP" name="btn_WEBSITE_SECURITY_FORCECSP" class="butAction small smallpaddingimp" value="'.$langs->trans("Add").'"></div>';
|
||||
print '</div>';
|
||||
|
||||
// Content Security Policy list of selected rules
|
||||
|
|
@ -4463,6 +4464,15 @@ if ($action == 'editsecurity') {
|
|||
print '</ul>';
|
||||
print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
print '<script>
|
||||
$(document).ready(function() {
|
||||
$("#select_identifier_WEBSITE_SECURITY_FORCECSP").on("change", function() {
|
||||
|
|
@ -4473,10 +4483,10 @@ if ($action == 'editsecurity') {
|
|||
$(".div_input_data_WEBSITE_SECURITY_FORCECSP").hide();
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").hide();
|
||||
if (key == "none"){
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").show();
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").css("display", "inline-block");
|
||||
} else {
|
||||
console.log("We show div select with key "+key);
|
||||
$("#div_"+key+"_WEBSITE_SECURITY_FORCECSP").show();
|
||||
$("#div_"+key+"_WEBSITE_SECURITY_FORCECSP").css("display", "inline-block");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -4485,12 +4495,12 @@ if ($action == 'editsecurity') {
|
|||
$("#select_source_WEBSITE_SECURITY_FORCECSP").val($(this).val());
|
||||
console.log("We hide and show fields");
|
||||
if (keysource == "data" || keysource == "input") {
|
||||
$(".div_input_data_WEBSITE_SECURITY_FORCECSP").show();
|
||||
$(".div_input_data_WEBSITE_SECURITY_FORCECSP").css("display", "inline-block");
|
||||
} else {
|
||||
$("#input_data_WEBSITE_SECURITY_FORCECSP").val("");
|
||||
$(".div_input_data_WEBSITE_SECURITY_FORCECSP").hide();
|
||||
if (keysource != undefined) {
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").show();
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").css("display", "inline-block");
|
||||
} else {
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").hide();
|
||||
}
|
||||
|
|
@ -4500,7 +4510,7 @@ if ($action == 'editsecurity') {
|
|||
$("#input_data_WEBSITE_SECURITY_FORCECSP").on("change", function(){
|
||||
if ($(this).val() != undefined) {
|
||||
console.log("We show add button");
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").show();
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").css("display", "inline-block");
|
||||
} else {
|
||||
console.log("We hide add button");
|
||||
$(".div_btn_class_WEBSITE_SECURITY_FORCECSP").hide();
|
||||
|
|
|
|||
Loading…
Reference in a new issue