diff --git a/SECURITY.md b/SECURITY.md index df7b1e76ce5..8115a818687 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -12,12 +12,12 @@ Security report are valid only on any current stable version for the last 5 majo To report a vulnerability, for a private report, you can: -- Send your report on Vulnerability Disclosure Program (VDP): https://github.com/Dolibarr/dolibarr/issues or https://github.com/Dolibarr/dolibarr/security/advisories (recommended for everybody) +- Send your report as an issue on https://github.com/Dolibarr/dolibarr/issues or on GitHub Vulnerability Disclosure Program tool (VDP): https://github.com/Dolibarr/dolibarr/security/advisories (recommended for everybody) -- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary. +- Or send an email to security@dolibarr.org with clear textual description of the report along with steps to reproduce the issue, include attachments such as screenshots or proof of concept code as necessary (in such a case, the issue may be created by the developer that will fix the vulnerability or the Release Manager). ## Hunting vulnerabilities on Dolibarr @@ -114,3 +114,8 @@ Scope is the web application (backoffice) and the APIs. * Invalid or missing SPF (Sender Policy Framework) records (Incomplete or missing SPF/DKIM/DMARC) * Physical or social engineering attempts or issues that require physical access to a victim’s computer/device * Vulnerabilities of type XSS exploited by using javascript into a website page of the website module or by using php code into a website page (being able to set javascript or php code is the expected behaviour in the website module), except if the user does not have the permission to edit page or php code. + + +## Be informed of a new vulnerability + +You can get more information on how to be informed on a new vulnerability on the page https://wiki.dolibarr.org/index.php/Security_information diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 96d846ffb62..08d8d4b7a68 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -431,7 +431,7 @@ class Categorie extends CommonObject 'cat_fk' => (empty($this->MAP_CAT_FK[$mapCode]) ? $mapCode : $this->MAP_CAT_FK[$mapCode]), 'cat_table' => (empty($this->MAP_CAT_TABLE[$mapCode]) ? $mapCode : $this->MAP_CAT_TABLE[$mapCode]), 'obj_class' => (empty($this->MAP_OBJ_CLASS[$mapCode]) ? $mapCode : $this->MAP_OBJ_CLASS[$mapCode]), - 'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]) + 'obj_table' => (empty($this->MAP_OBJ_TABLE[$mapCode]) ? $mapCode : $this->MAP_OBJ_TABLE[$mapCode]), ); } @@ -469,7 +469,7 @@ class Categorie extends CommonObject } $sql = "SELECT rowid, fk_parent, entity, label, description, color, position, fk_soc, visible, type, ref_ext"; - $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif"; + $sql .= ", date_creation, tms, fk_user_creat, fk_user_modif, import_key"; $sql .= " FROM ".MAIN_DB_PREFIX."categorie"; if ($id) { $sql .= " WHERE rowid = ".((int) $id); @@ -502,8 +502,9 @@ class Categorie extends CommonObject $this->date_modification = $this->db->jdate($res['tms']); $this->user_creation_id = (int) $res['fk_user_creat']; $this->user_modification_id = (int) $res['fk_user_modif']; + $this->import_key = $res['import_key']; - // Retrieve all extrafield + // Retrieve all extrafields // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1b086b033ea..f07e0ae0a68 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -177,7 +177,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { //var_dump($key.' '.$value.' '.$object->fields[$key]['type'].' '.$object->fields[$key]['notnull']); $object->$key = $value; - if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] == '(PROV)') { + if (!empty($val['notnull']) && $val['notnull'] > 0 && $object->$key == '' && isset($val['default']) && $val['default'] === '(PROV)') { $object->$key = '(PROV)'; } if ($key == 'pass_crypted') { diff --git a/htdocs/core/class/fields/pricecyfield.class.php b/htdocs/core/class/fields/pricecyfield.class.php index 1e64f20ffff..a473b2b361d 100644 --- a/htdocs/core/class/fields/pricecyfield.class.php +++ b/htdocs/core/class/fields/pricecyfield.class.php @@ -94,7 +94,7 @@ class PricecyField extends CommonField $out = self::$form->inputType('text', $htmlName, (string) $value, $htmlName, $moreCss, $moreAttrib . $autoFocus); $out .= self::$form->selectCurrency($currency, $htmlName . 'currency_id'); - return $out; + return ''.$out.''; } /** diff --git a/htdocs/public/webportal/css/form-input-special.css b/htdocs/public/webportal/css/form-input-special.css new file mode 100644 index 00000000000..8e2b3b2ada7 --- /dev/null +++ b/htdocs/public/webportal/css/form-input-special.css @@ -0,0 +1,117 @@ + +:root{ + --form-input-margin-bottom : calc(var(--form-element-spacing-vertical)*3); +} + +/** + * STARS INPUT + */ +.star-selection { + font-size: 1rem; + cursor: pointer; + display: flex; + white-space: nowrap; +} +.star { + color: #ccc; + transition: color 0.4s; +} +.star:hover, .star.active { + color: var(--butactionbg); +} + +/** + * SELECT 2 + */ + +.select2-container, .select2-container .selection, .select2-selection.select2-selection--single{ + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; +} +.select2.select2-container{ + margin-bottom: var(--form-input-margin-bottom); +} +.select2-selection--single .select2-selection__rendered, .select2-selection__arrow{ + line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) * 2) !important; +} + +.select2-selection--multiple .select2-selection__rendered{ + line-height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) + var(--border-width) * 2) !important; + height: calc(1rem * var(--line-height) + var(--form-element-spacing-vertical) * 3 + var(--border-width) * 2 ) !important; +} + +.select2-search__field[type="search"] { + margin-bottom: 3px; +} +.select2-search.select2-search--dropdown{ + border-bottom : 1px solid rgba(0,0,0,0.1); +} + +.select2-container--default.select2-container--focus .select2-selection--multiple { + border :var(--border-width) solid var(--border-color) !important; /* fix select 2 to be compatible pico css */ +} + +.select2-container--default.select2-container--focus .select2-selection--multiple{ + --border-color: var(--primary); +} + +.select2-container .select2-selection--multiple .select2-selection__rendered { + display: block !important; /* fix select 2 to be compatible pico css */ + overflow: auto; +} + +.select2-container--default .select2-selection--multiple .select2-selection__choice{ + border: 0px solid #aaa !important; /* fix select 2 to be compatible pico css */ +} + +/** + * DATE + */ + +[class*="fieldname_options_"] > input { + width: auto; + max-width: none; + box-sizing: border-box; /* pour que padding/border ne débordent pas */ +} + +[class*="fieldname_options_"] .nowraponall { + display: inline-flex; + align-items: center; + gap: 0.25rem; +} + + + +[class*="fieldname_options_"] .dpInvisibleButtons{ + display: inline-block; + width: auto; + vertical-align: baseline; +} + +/** +* Inlines forms + */ + +.nowraponall :is(input:not([type=checkbox], [type=radio]), select, textarea){ + margin-bottom: 0; +} + +.nowraponall:has(input:not([type=checkbox], [type=radio]), select, textarea){ + margin-bottom: var(--form-input-margin-bottom); +} + + +/** + * Form currency + */ +.form-select-price-currency-container { + display: flex; + align-items: center; + justify-content: center; + line-height: 1; + gap: 0.25rem; + margin-bottom: var(--form-input-margin-bottom); +} +.form-select-price-currency-container > input { + text-align: right; +} diff --git a/htdocs/public/webportal/css/style.css.php b/htdocs/public/webportal/css/style.css.php index edeb7e85c01..bb7d5da5f2f 100644 --- a/htdocs/public/webportal/css/style.css.php +++ b/htdocs/public/webportal/css/style.css.php @@ -102,6 +102,7 @@ if (empty($dolibarr_nocache)) { @import "card.css"; @import "dialog.css"; @import "btn.css"; +@import "form-input-special.css"; /** This file can overwrite default pico css */ diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index 35e3a8f9508..a46885296be 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -1670,4 +1670,19 @@ class FormWebPortal extends Form return $html; } + + /** + * Retourne la liste des devises, dans la langue de l'utilisateur + * + * @param string $selected Preselected currency code + * @param string $htmlname Name of HTML select list + * @param int $mode 0 = Add currency symbol into label, 1 = Add 3 letter iso code, 2 = Add both symbol and code + * @param string $useempty '1'=Allow empty value + * @return string HTML component + */ + public function selectCurrency($selected = '', $htmlname = 'currency_id', $mode = 0, $useempty = '') + { + + return ''.parent::selectCurrency($selected, $htmlname, $mode, $useempty).''; + } }