Commit graph

135 commits

Author SHA1 Message Date
MDW
e7273973e7
Fix(ci): security access check (#39530) 2026-08-15 01:58:01 +02:00
Laurent Destailleur
fbf476cc5d Restrict some field in api create/update of member for secure purpose -
reported by vulncheck
2026-08-14 20:01:30 +02:00
Laurent Destailleur
52d83c89d6 Disqualified some fields from api 2026-08-14 19:47:17 +02:00
Laurent Destailleur
9e385dc0ab Exclude some keys in api put and post 2026-08-14 19:45:47 +02:00
w3houde
ad2ca4c598
Fix #38279 expose Subscription dates and note under documented names in API (#38674)
GET /api/index.php/members/{id}/subscriptions returned the raw
Subscription object fields (dateh, datef, note_public, amount) while
POST /api/index.php/members/{id}/subscriptions takes start_date,
end_date, amount, label. A client that fetches existing subscriptions
to push them back has to translate the field names by hand.

Per @eldy review on PR #38556, address this with the renaming that
fits the rest of the codebase:

- Add date_start / date_end aliases on the Subscription class. The
  date_start / date_end naming convention is already used by other
  objects (task, expense, holiday), so the alias matches the existing
  contract instead of inventing a new pair of names.
- Do not introduce a 'label' alias. note_public is already the
  documented field on v24; declare it as a real property so phpstan
  stops flagging the dynamic-property write.
- _cleanObjectDatas on the Subscription branch now sets only
  date_start and date_end. note_public is left as the existing
  property name. dateh / datef stay populated for backward
  compatibility with existing consumers.

Develop-branch version of PR #38556 (closed).

Signed-off-by: Dolicraft <contact@dolicraft.com>
Co-authored-by: Dolicraft <contact@dolicraft.com>
2026-06-10 21:16:27 +02:00
Laurent Destailleur
bf432da483 Doc example 2026-05-29 12:16:42 +02:00
Laurent Destailleur
a573a9c521 Merge branch '23.0' of git@github.com:Dolibarr/dolibarr.git into develop 2026-05-18 02:31:38 +02:00
Laurent Destailleur
76821f3c1d Merge branch '22.0' of git@github.com:Dolibarr/dolibarr.git into 23.0 2026-05-18 02:26:17 +02:00
Jon Bendtsen
29aa7648e8
Fix api post member subscription returns negative one (#38280)
* Fix #38278 POST to API /members/{id}/subscriptions returns -1

* return the id of the new subscription

---------

Co-authored-by: Jon Bendtsen <jonbendtsen@jonb.dk>
2026-05-18 01:41:32 +02:00
Laurent Destailleur
85384fb523 Fix sanitize fields in API put and post for extrafields 2026-05-09 01:16:35 +02:00
Yoan Mollard
73fe50af10
Bugfix data validation of is_numeric for subscription start_date (#35578) 2025-10-01 14:48:38 +02:00
MDW
eac44b164a
Qual: Fix phpdoc index(), FIELDS 2025-03-05 13:21:05 +01:00
MDW
035ede5874
Qual: Fix phan notices in API classes 2025-03-02 20:49:46 +01:00
MDW
c02293a880
Qual: Add phpdoc for request_data param 2025-03-02 20:49:45 +01:00
Laurent Destailleur
12f2534a03 Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop 2025-01-27 03:53:46 +01:00
Laurent Destailleur
07febfe70b Fix merge 2025-01-27 01:35:45 +01:00
Laurent Destailleur
158b3c76aa Fix merge 2025-01-27 01:33:32 +01:00
Laurent Destailleur
940e42c1e4 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-01-27 01:30:34 +01:00
MDW
be06fc32af
Qual: Fix ci for new api_memberstypes.class
# Qual: Fix ci for new api_memberstypes.class

This fixes the notifications for the new api_memberstypes.class
2025-01-20 18:25:24 +01:00
MDW
adb1c58d05
Qual: Fix ci for new api_memberstypes.class
# Qual: Fix ci for new api_memberstypes.class

This fixes the notifications for the new api_memberstypes.class
2025-01-20 16:47:27 +01:00
Laurent Destailleur (aka Eldy)
fa9fe2efa7 Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into 21.0 2025-01-20 15:02:37 +01:00
Laurent Destailleur (aka Eldy)
c9ab22782e Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0 2025-01-20 14:57:45 +01:00
Laurent Destailleur (aka Eldy)
1f360ca498 Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0 2025-01-20 12:28:49 +01:00
Laurent Destailleur (aka Eldy)
1b42078d1e Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0 2025-01-20 10:24:30 +01:00
Frédéric FRANCE
46d6714fe0
clean code (#36317)
* clean code

* clean code

* clean doc

* clean doc

* clean doc

* clean doc

* fix

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-11-20 01:47:46 +01:00
Frédéric FRANCE
cd3b74f092
NEW add api for members statistics (#35851)
* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* NEW add api for members statistics

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2025-10-21 02:05:51 +02:00
Jon Bendtsen
387a42c9ea
Api member createSubscription, not all possible RestException numbers was mentioned (#35748)
Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2025-10-15 02:31:08 +02:00
ldestailleur
54dc4452aa Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2025-10-01 17:27:12 +02:00
Frédéric FRANCE
62a7756a43
fix civility_id for webportal member (#35339)
* fix civility_id for webportal member

* Update html.formcardwebportal.class.php

* fix

* fix

* fix

* fix date

* fix translation

* add doc
2025-09-14 11:17:01 +02:00
atm-florian
ba4e97f07b FIX 17.0 API endpoints "PUT": prevent overwriting all extrafields if only some are supplied in the request cf. PR #29237
+ security for Tickets API: disable updating rowid
2025-01-16 10:37:29 +01:00
Thibault Parodi
be72bfa664
FIX #29424 API GET member categories (#31881)
* Fix members categories when user is not found

* Return empty array instead of 0 when member does not have category assigned
2024-11-15 23:57:58 +01:00
Frédéric FRANCE
15490b292f
fix phpstan and fix CI (#31739)
* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan
2024-11-10 11:16:23 +01:00
ptibogxiv
d5d7d484a8
NEW get member by thirdparty account (#31296)
* NEW get member by thirdparty account

* Update api_members.class.php

* Update api_members.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-10-07 14:20:27 +02:00
MDW
76eaf8bd8d
Qual: Fix phan notices in classes related to class using getNextValue. (#30925)
* FIX 🛟 phan

* getToolTip() can take null for $coc

* Fix uninitialized vars & arg types

* PHPDoc typing, argument fixes

* PHPDoc typing, argument fixes for AdherentType

* PHPDoc typing, argument fixes for AdherentStats

* Update baseline to enable adherent notices

* Fix PHPDoc typing in api_members

* Minor bug fixes, typing

* PHPDoc api_subscriptions

* PHPDoc Societe

* Ignore empty foreach notice

* Add initialiser

* Categorie is string, old int mode is deprecated

* Fix missing initialisations

* Fix missing initialisations adherents/note

* Fix typing (cast), initialisation of var

* Fix initialisations

* Fix argument types

* Improve array PHPDoc type

* PHPDoc array type

* PHPDoc: Improve typing

* Correct argument type to getNomUrl

* Improve typing for timespent

* Fix typing for getNextValue args

* Improve typing

* Fix typing hints contrat/card

* Update baseline

* Fix typing

* Fix extraparams property typing

* Fix argument typing

* Qual: Correct covariant type

* Impove typing for timespent

* Remove exclusion no longer matched (level 6)

---------

Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com>
2024-09-12 21:16:42 +02:00
ptibogxiv
98b496ada0
Update api_members.class.php with pagination (#30758)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
2024-08-29 17:42:29 +02:00
Laurent Destailleur
ee0412dd27 Fix phan warning 2024-07-31 18:54:52 +02:00
Jon Bendtsen
eb1c044419
FIX: API GET /members/types/{id} says it deletes member type #29421 (#29423)
Co-authored-by: Jon Bendtsen <xcodeauthor@jonb.dk>
2024-04-20 22:21:47 +01:00
Laurent Destailleur
930c8614b1
Merge branch 'develop' into membertype_update_single_array_option_element 2024-04-02 14:54:13 +02:00
Laurent Destailleur
7715513ac9 Some API HTTP return code were moved from 401 to 403 to better follow
REST specification.
2024-04-02 14:47:49 +02:00
Laurent Destailleur
66f3b438f6
Merge branch 'develop' into membertype_update_single_array_option_element 2024-04-02 13:37:01 +02:00
Laurent Destailleur
51f862ad28 Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into
develop
2024-04-02 13:21:00 +02:00
Laurent Destailleur
990216b13f NEW Api parameters are sanitized by the WAF, same code than GET/POST 2024-04-02 13:07:13 +02:00
Jon Bendtsen
bc56e8f1e7 double fix: do not remove array_options from json + allowing single option_ update without nullifying the other options_ 2024-04-01 19:11:16 +02:00
Jon Bendtsen
c55c0284b1 will allow updating 1 member single Complementary Attribute without specifying complementary attributes that we don't want to change. Similar to # 29115 but just for a member 2024-04-01 12:37:05 +02:00
MDW
fc3cdf51ba
Fix PhanPluginRedundantAssignment 2024-03-13 00:40:32 +01:00
Laurent Destailleur
9a281ed264 Fix undefined property 2024-03-08 21:21:27 +01:00
Laurent Destailleur
afd49868d5 Fix bad route 2024-03-08 16:32:44 +01:00
Laurent Destailleur
a4faa488fd Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop 2024-03-08 11:00:50 +01:00
Laurent Destailleur
fb16af02b4 Clean code. Move member type API in good file. 2024-03-08 11:00:19 +01:00
Laurent Destailleur
e6b2756c19 QUAL The signature for all ->delete() method has been modified to match
the modulebuilder template (so first param is now always $user), except
  the delete for thirdparty (still accept the id of thirdparty to delete
as first parameter). Will probably be modified into another version.
2024-03-07 17:58:02 +01:00