Commit graph

10 commits

Author SHA1 Message Date
Frédéric FRANCE
750145e663
NEW: #0 Resolve password generator/validator classes via modules_parts['models'] (#39486)
Password generator/validator classes (USER_PASSWORD_GENERATED,
modGeneratePassXxx extends ModeleGenPassword) could previously only live
under htdocs/core/modules/security/generate/ — every call site resolving
one by name hardcoded that path, so no third-party module could
contribute its own generator without patching core.

Reuse the modules_parts['models'] extension point already populated for
any enabled module declaring $this->module_parts['models'] = 1 (the same
mechanism every numbering-module scan in Dolibarr already uses — see e.g.
Facture::getNextNumRef()), and wire it into the password-generator scan
too:

- admin/security.php's generator listing now scans core plus every
  enabled module declaring module_parts['models'], instead of only
  core/modules/security/generate/.
- Added ModeleGenPassword::loadAndInstantiate($id, ...) in
  modules_genpassword.php, a shared factory doing that same multi-root
  resolution once, used by the four runtime call sites that previously
  hardcoded the core-only path: User::setPassword(), getRandomPassword()
  (security2.lib.php), FormSetupItem::generateInputFieldPassword()
  (html.formsetup.class.php), and PasswordField::verifyFieldValue()
  (passwordfield.class.php). getRandomPassword() falls back to the
  'standard' generator (with a warning logged) if the configured
  generator's class can't be resolved, rather than silently generating
  and persisting an empty password.

Behavior for the built-in Standard/None/Perso generators is unchanged —
core is always the first root scanned, so it always wins for those ids.
2026-08-14 16:19:48 +02:00
MDW
6196491e1b
Qual: Fix 'SqlInjection' notices (#39224)
# Qual: Fix 'SqlInjection' notices

Batch of 25 files with changes to fix 'SqlInjection' Notices
2026-07-20 02:51:54 +02:00
MDW
4eaa846739
Fix: Avoid double escapes in sql values (#38940)
* Fix: values already escaped for db in 'isInDb'

# Fix: values already escaped for db in 'isInDb'

The values of $value_arr were escaped before the call to 'isInDb' resulting
in a potential double escape'

* Fix: escape values only once in sqlFilterSearchField

# Fix: escape values only once in sqlFilterSearchField

The values of $value were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

* Fix: escape values only once in sqlFilterSearchField

# Fix: escape values only once in sqlFilterSearchField

The values of $value were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

* Fix: escape values only once in getOptions

# Fix: escape values only once in getOptions

The values of $selectedValues were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

* Fix: escape values only once in sqlFilterSearchField

# Fix: escape values only once in sqlFilterSearchField

The values of $value were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

* Fix: escape values only once in sqlFilterSearchField

# Fix: escape values only once in sqlFilterSearchField

The values of $value were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

* Fix: escape values only once in sqlFilterSearchField

# Fix: escape values only once in sqlFilterSearchField

The values of $value were escaped before appending them to the sql expression where they were also escaped, resulting in a potential double escape'

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2026-06-21 23:03:22 +02:00
Laurent Destailleur
b254f9ac5d Fix duplicate escaping 2026-06-21 15:31:13 +02:00
Laurent Destailleur
37d7d16b05 Fix bad type 2026-05-22 12:45:59 +02:00
Laurent Destailleur
b3d355885a Clean code 2026-04-14 17:57:48 +02:00
Laurent Destailleur
3fb593e758 NEW Move deprecated option
MAIN_DISALLOW_UNSECURED_SELECT_INTO_EXTRAFIELDS_FILTER into conf.php
file.
2026-03-25 22:33:03 +01:00
John BOTELLA
4140591621 Fix form price currency 2025-12-16 11:31:33 +01:00
Regis Houssin
1e484dda55
NEW webportal member authentication only with WEBPORTAL_LOGIN_BY_MEMBER_ACCOUNT (#36259)
* NEW webportal member authentication only

* FIX missing translation

* FIX php-stan errors

* FIX php-stan : cryptType is always "auto" !

* FIX remove CrypType

* FIX php-stan error

* FIX phan error

* FIX CI versions

* FIX remove wrong fix

* FIX pre-commit error

* FIX phan error

* FIX php-stan error

* FIX avoid php warning

* FIXME this check is not valid
2025-11-25 14:39:30 +01:00
kkhelifa-opendsi
548bb94e4f
NEW: Rework of the management of the card and fields on the web portal (#36076)
* NEW: Rework of the management of the card and fields on the web portal

* Correction pre-commit check

* Correction affichage logo login

* Ajout hook

* Ajout params fonction FormWebPortal::convertAllLink()

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction phpstan

* Correction travis

* Correction travis

* Correction travis

* Correction travis

* Correction

* Fix get options of sellist by AJAX in webportal scope

* Correction pre-commit

* Correction pre-commit

* Add hook and change hook name for viewImage controller

* Correction phan

* Corrections

* Corrections
2025-11-19 15:14:53 +01:00