Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
This commit is contained in:
commit
eb3d9799e5
6 changed files with 40 additions and 25 deletions
|
|
@ -272,7 +272,7 @@ print '<br>';
|
|||
if (file_exists($installlock)) { // If install not locked, no need to show this.
|
||||
if (file_exists($upgradeunlock)) {
|
||||
print '<strong>'.$langs->trans("DolibarrUpgrade").'</strong>: ';
|
||||
print img_warning().' '.$langs->trans("UpgradeHasBeenUnlocked", $upgradeunlock);
|
||||
print img_warning().' '.$langs->trans("WarningUpgradeHasBeenUnlocked", $upgradeunlock);
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
|
|
@ -754,10 +754,10 @@ print '<strong>WEBSITE_MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString('W
|
|||
print ' <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self' 'unsafe-inline'; style-src https://cdnjs.cloudflare.com *.googleapis.com; script-src *.transifex.com *.google-analytics.com *.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src * data:;\")</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or")." \"strict-origin-when-cross-origin\")</span><br>";
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("Undefined")."=\"strict-origin\" ".$langs->trans("or")." \"strict-origin-when-cross-origin\")</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCESTS</strong> = '.getDolGlobalString('>WEBSITE_MAIN_SECURITY_FORCESTS', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")</span><br>";
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCESTS</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")</span><br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>WEBSITE_MAIN_SECURITY_FORCEPP</strong> = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' <span class="opacitymedium">('.$langs->trans("Example").": \"camera: (); microphone: ();\")</span><br>";
|
||||
|
|
|
|||
|
|
@ -7330,7 +7330,7 @@ abstract class CommonObject
|
|||
$isDependList = 1;
|
||||
}
|
||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||
$out .= '>'.$valb.'</option>';
|
||||
$out .= '>'.$langs->trans($valb).'</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
} elseif ($type == 'sellist') {
|
||||
|
|
@ -7954,7 +7954,7 @@ abstract class CommonObject
|
|||
} elseif ($type == 'select') {
|
||||
$value = isset($param['options'][$value]) ? $param['options'][$value] : '';
|
||||
if (strpos($value, "|") !== false) {
|
||||
$value = explode('|', $value)[0];
|
||||
$value = $langs->trans(explode('|', $value)[0]);
|
||||
}
|
||||
} elseif ($type == 'sellist') {
|
||||
$param_list = array_keys($param['options']);
|
||||
|
|
|
|||
|
|
@ -8014,22 +8014,22 @@ class Form
|
|||
* Can use autocomplete with ajax after x key pressed or a full combo, depending on setup.
|
||||
* This is the generic method that will replace all specific existing methods.
|
||||
*
|
||||
* @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc.
|
||||
* @param string $htmlname Name of HTML select component
|
||||
* @param int $preselectedvalue Preselected value (ID of element)
|
||||
* @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
|
||||
* @param string $searchkey Search criteria
|
||||
* @param string $placeholder Place holder
|
||||
* @param string $morecss More CSS
|
||||
* @param string $moreparams More params provided to ajax call
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @param int $disabled 1=Html component is disabled
|
||||
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
||||
* @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
|
||||
* @param string $objectdesc 'ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'. For hard coded custom needs. Try to prefer method using $objectfield instead of $objectdesc.
|
||||
* @param string $htmlname Name of HTML select component
|
||||
* @param int $preSelectedValue Preselected value (ID of element)
|
||||
* @param string $showempty ''=empty values not allowed, 'string'=value show if we allow empty values (for example 'All', ...)
|
||||
* @param string $searchkey Search criteria
|
||||
* @param string $placeholder Place holder
|
||||
* @param string $morecss More CSS
|
||||
* @param string $moreparams More params provided to ajax call
|
||||
* @param int $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @param int $disabled 1=Html component is disabled
|
||||
* @param string $selected_input_value Value of preselected input text (for use with ajax)
|
||||
* @param string $objectfield Object:Field that contains the definition (in table $fields or $extrafields). Example: 'Object:xxx' or 'Module_Object:xxx' or 'Object:options_xxx' or 'Module_Object:options_xxx'
|
||||
* @return string Return HTML string
|
||||
* @see selectForFormsList(), select_thirdparty_list()
|
||||
*/
|
||||
public function selectForForms($objectdesc, $htmlname, $preselectedvalue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '')
|
||||
public function selectForForms($objectdesc, $htmlname, $preSelectedValue, $showempty = '', $searchkey = '', $placeholder = '', $morecss = '', $moreparams = '', $forcecombo = 0, $disabled = 0, $selected_input_value = '', $objectfield = '')
|
||||
{
|
||||
global $conf, $extrafields, $user;
|
||||
|
||||
|
|
@ -8128,10 +8128,23 @@ class Form
|
|||
if (!empty($conf->use_javascript_ajax) && getDolGlobalString($confkeyforautocompletemode) && !$forcecombo) {
|
||||
// No immediate load of all database
|
||||
$placeholder = '';
|
||||
if ($preselectedvalue && empty($selected_input_value)) {
|
||||
$objecttmp->fetch($preselectedvalue);
|
||||
|
||||
if ($preSelectedValue && empty($selected_input_value)) {
|
||||
$objecttmp->fetch($preSelectedValue);
|
||||
$selected_input_value = ($prefixforautocompletemode == 'company' ? $objecttmp->name : $objecttmp->ref);
|
||||
//unset($objecttmp);
|
||||
|
||||
$oldValueForShowOnCombobox = 0;
|
||||
foreach ($objecttmp->fields as $fieldK => $fielV) {
|
||||
if (!$fielV['showoncombobox'] || empty($objecttmp->$fieldK)) continue;
|
||||
|
||||
if (!$oldValueForShowOnCombobox) {
|
||||
$selected_input_value = '';
|
||||
}
|
||||
|
||||
$selected_input_value .= $oldValueForShowOnCombobox ? ' - ' : '';
|
||||
$selected_input_value .= $objecttmp->$fieldK;
|
||||
$oldValueForShowOnCombobox = empty($fielV['showoncombobox']) ? 0 : $fielV['showoncombobox'];
|
||||
}
|
||||
}
|
||||
|
||||
// Set url and param to call to get json of the search results
|
||||
|
|
@ -8139,12 +8152,12 @@ class Form
|
|||
$urloption = 'htmlname=' . urlencode($htmlname) . '&outjson=1&objectdesc=' . urlencode($objectdescorig) . '&objectfield='.urlencode($objectfield) . ($sortfield ? '&sortfield=' . urlencode($sortfield) : '');
|
||||
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0, array());
|
||||
$out .= ajax_autocompleter($preSelectedValue, $htmlname, $urlforajaxcall, $urloption, getDolGlobalString($confkeyforautocompletemode), 0);
|
||||
$out .= '<!-- force css to be higher than dialog popup --><style type="text/css">.ui-autocomplete { z-index: 1010; }</style>';
|
||||
$out .= '<input type="text" class="' . $morecss . '"' . ($disabled ? ' disabled="disabled"' : '') . ' name="search_' . $htmlname . '" id="search_' . $htmlname . '" value="' . $selected_input_value . '"' . ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '') . ' />';
|
||||
} else {
|
||||
// Immediate load of table record.
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preSelectedValue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled, $sortfield, $filter);
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
|
|
|||
|
|
@ -9738,6 +9738,7 @@ function dol_eval($s, $returnvalue = 0, $hideerrors = 1, $onlysimplestring = '1'
|
|||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("fopen", "file_put_contents", "fputs", "fputscsv", "fwrite", "fpassthru", "require", "include", "mkdir", "rmdir", "symlink", "touch", "unlink", "umask"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("get_defined_functions", "get_defined_vars", "get_defined_constants", "get_declared_classes"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("function", "call_user_func"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("require", "include", "require_once", "include_once"));
|
||||
$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array("eval", "create_function", "assert", "mb_ereg_replace")); // function with eval capabilities
|
||||
|
||||
$forbiddenphpmethods = array('invoke', 'invokeArgs'); // Method of ReflectionFunction to execute a function
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ WarningConfFileMustBeReadOnly=Warning, your config file (<b>htdocs/conf/conf.php
|
|||
WarningsOnXLines=Warnings on <b>%s</b> source record(s)
|
||||
WarningNoDocumentModelActivated=No model, for document generation, has been activated. A model will be chosen by default until you check your module setup.
|
||||
WarningLockFileDoesNotExists=Warning, once setup is finished, you must disable the installation/migration tools by adding a file <b>install.lock</b> into directory <b>%s</b>. Omitting the creation of this file is a grave security risk.
|
||||
WarningUpgradeHasBeenUnlocked=Warning, upgrade process has been unlocked for everybody
|
||||
WarningUntilDirRemoved=This security warning will remain active as long as the vulnerability is present.
|
||||
WarningCloseAlways=Warning, closing is done even if amount differs between source and target elements. Enable this feature with caution.
|
||||
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
|
||||
|
|
|
|||
|
|
@ -1669,9 +1669,9 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
|
|||
|
||||
// Referrer-Policy
|
||||
// Say if we must provide the referrer when we jump onto another web page.
|
||||
// Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'same-origin' so browser doesn't send any referrer when going into another web site domain.
|
||||
// Default browser are 'strict-origin-when-cross-origin' (only domain is sent on other domain switching), we want more so we use 'strict-origin' so browser doesn't send any referrer when going into another web site domain.
|
||||
if (!defined('MAIN_SECURITY_FORCERP')) {
|
||||
$referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "same-origin");
|
||||
$referrerpolicy = getDolGlobalString('MAIN_SECURITY_FORCERP', "strict-origin");
|
||||
|
||||
header("Referrer-Policy: ".$referrerpolicy);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue