dolibarr/htdocs/core/class/fields
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
..
booleanfield.class.php Clean code 2026-04-14 17:57:48 +02:00
checkboxfield.class.php Fix: Avoid double escapes in sql values (#38940) 2026-06-21 23:03:22 +02:00
chkbxlstfield.class.php Fix: Avoid double escapes in sql values (#38940) 2026-06-21 23:03:22 +02:00
commonfield.class.php Fix bad type 2026-05-22 12:45:59 +02:00
commongeofield.class.php
commonselectfield.class.php
commonsellistfield.class.php Qual: Fix 'SqlInjection' notices (#39224) 2026-07-20 02:51:54 +02:00
datefield.class.php Clean code 2026-04-14 17:57:48 +02:00
datetimefield.class.php Clean code 2026-04-14 17:57:48 +02:00
datetimegmtfield.class.php Clean code 2026-04-14 17:57:48 +02:00
doublefield.class.php Fix bad type 2026-05-22 12:45:59 +02:00
durationfield.class.php
emailfield.class.php
htmlfield.class.php
iconfield.class.php
intfield.class.php
ipfield.class.php
linestrgfield.class.php
linkfield.class.php
multiptsfield.class.php
passwordfield.class.php NEW: #0 Resolve password generator/validator classes via modules_parts['models'] (#39486) 2026-08-14 16:19:48 +02:00
phonefield.class.php
pointfield.class.php
polygonfield.class.php
pricecyfield.class.php Fix bad type 2026-05-22 12:45:59 +02:00
pricefield.class.php Fix bad type 2026-05-22 12:45:59 +02:00
radiofield.class.php Fix: Avoid double escapes in sql values (#38940) 2026-06-21 23:03:22 +02:00
realfield.class.php Fix bad type 2026-05-22 12:45:59 +02:00
selectfield.class.php Fix: Avoid double escapes in sql values (#38940) 2026-06-21 23:03:22 +02:00
sellistfield.class.php Fix: Avoid double escapes in sql values (#38940) 2026-06-21 23:03:22 +02:00
starsfield.class.php
textfield.class.php
timestampfield.class.php Clean code 2026-04-14 17:57:48 +02:00
urlfield.class.php
varcharfield.class.php