Commit Graph

48 Commits

Author SHA1 Message Date
johnnyq c0af8e8eab Add '' to the date vars under API assets if not empty so they dont error out when inserted into the DB 2023-03-04 16:13:38 -05:00
johnnyq e01dea2fd0 Fix Assets API Missing $ on var and use NULL instead of 0000-00-00 when inserting into the DB similar to POST 2023-03-04 15:58:34 -05:00
johnnyq cdfb61b294 Added a helper if no tags exist when attempting to add them to a client, Added some santizeInput tags to API 2023-02-28 11:58:08 -05:00
Marcus Hill 6374524cfb Prevent 'Undefined variable: asset_row' errors when adding/updating assets via API 2023-02-26 21:55:24 +00:00
Marcus Hill 6f7f679682 Tidy 2023-02-12 15:56:09 +00:00
Marcus Hill 68005723e6 API
- Refactor comments/client id var
- Add basic read endpoint for docs, products, expenses, quotes and invoices
2023-02-12 15:50:45 +00:00
Johnny ffc28dd2b9
Merge pull request #616 from wrongecho/api-payments
Add read api endpoint for payments
2023-02-11 18:54:11 -05:00
Marcus Hill eef70a0cf1 Add read api endpoint for payments; fix requirement for all clients api key 2023-02-11 15:10:27 +00:00
Marcus Hill 073fe953e9 Add read api endpoint for payments 2023-02-11 15:04:10 +00:00
Marcus Hill 85c28f889b Allow setting asset status via API 2023-02-11 14:22:35 +00:00
Marcus Hill b36719eb99 General cleanup/tidying 2023-02-09 11:32:40 +00:00
Marcus Hill f3456ead67 API
- Add PHP logging when API queries fail because of SQL errors
- Add user agent to logging
- Enhance asset update endpoint
2023-02-05 15:07:41 +00:00
Marcus Hill 531bd25f27 Convert custom function names to camelCase 2023-01-26 22:03:31 +00:00
Marcus Hill 10362f86ef Convert custom function names to camelCase 2023-01-26 21:58:27 +00:00
Marcus Hill d7085c4790 Touch ups 2023-01-26 14:41:24 +00:00
Marcus Hill 5d269368f6 Update contact API to support contact_import, contact_billing, contact_technical 2023-01-26 13:34:13 +00:00
Marcus Hill d34c26d176 Tidy 2023-01-21 17:49:10 +00:00
Marcus Hill 447f20c91c Escape potential HTML characters in the API Key name, as this is used in logs 2023-01-02 14:38:52 +00:00
Marcus Hill 1aa87ccaeb API Key error wording 2023-01-02 14:37:56 +00:00
Marcus Hill cf8713fc73 Fix software read API query via key 2023-01-02 14:34:59 +00:00
Marcus Hill 5a35f508c6 Remove unrequired trim & strip tags - only needs sql escape 2023-01-02 14:32:17 +00:00
Marcus Hill 8687f56eb0 Remove unrequired trim & strip tags - only needs sql escape 2023-01-02 14:31:29 +00:00
Marcus Hill ff741c223e API code style tidy 2023-01-01 16:00:07 +00:00
Marcus Hill b23359ff38 Adjust contact API to allow department to be text rather than int due to db schema change 2022-09-11 11:08:48 +01:00
Marcus Hill 3f3854e8c3 Add contact delete endpoint 2022-05-11 20:41:19 +01:00
Johnny 44f8569b50
Merge pull request #455 from wrongecho/api
Add delete asset API endpoint
2022-05-02 11:30:02 -04:00
Marcus Hill c19328f3d8 Typo 2022-05-01 10:37:07 +01:00
Marcus Hill 25c610e963 Rename update_id to update_count - as it's a count, not the insert ID 2022-05-01 10:34:21 +01:00
Marcus Hill 69c1fc6cae Add asset API delete endpoint 2022-05-01 10:30:04 +01:00
Marcus Hill 917377ed17 Remove meshcentral references in api 2022-04-28 21:46:41 +01:00
Marcus Hill 2d6e7dbb37 Add clients/read.php API endpoint.
Adjust asset create/update so that they function without all attributes being provided. Update will default to using the value currently in the database, rather than overwriting blank.
2022-04-18 15:59:09 +01:00
Marcus Hill 467784cb2a Define the number regex as a constant and use that instead 2022-04-17 23:30:10 +01:00
Marcus Hill e55622827d Add support for client-specific API keys
Refactoring API. Added a contact update endpoint.
Small misc changes.
2022-04-15 17:43:06 +01:00
Marcus Hill fca1627c33 Remove delete user post.php code. Deleting users means we'll lose all tickets/replies which isn't great.
Correct user archive behaviour so when users are archived they can no longer login. Need to add ability for quick disable/enable of user accounts, as using archive as permanent.
Refactor "You are not permitted to do that!" wording into a constant instead.
2022-04-15 13:29:27 +01:00
Marcus Hill 17f97ff7bc Deduplicate API GET check into single file 2022-04-14 20:05:15 +01:00
Marcus Hill a3ca268fcf Small code cleanups 2022-04-14 07:54:40 +01:00
Marcus Hill 9040fdf847 Misc small changes/fixes 2022-03-27 22:26:22 +01:00
Marcus Hill 816ba87485 SQL Injection / XSS fixes 2022-03-27 20:02:16 +01:00
Marcus Hill 09b4eab1c3 Correct insert ID for create endpoint. Add contact create API endpoint 2022-03-26 13:39:43 +00:00
Marcus Hill 4b077cf6e0 Add create asset functionality to API 2022-02-27 16:09:21 +00:00
Marcus Hill 706ee68563 Add ticket read to api 2022-02-12 17:41:48 +00:00
Marcus Hill fe5635f1dc Add contact read to api 2022-02-12 17:37:56 +00:00
Marcus Hill b9bbc75ce3 Add/update READ endpoints for assets, certs, domains, networks & software 2022-02-05 14:20:20 +00:00
Marcus Hill d4ea0c984d id > asset_id 2022-02-05 13:34:33 +00:00
johnnyq be0778ab84 Strip slashes on user agent and ip to prevent user header modification for XSS attack in API logging 2022-02-04 16:55:45 -05:00
johnnyq 338c991d21 Updated Logging in both APIs 2022-02-04 16:51:56 -05:00
johnnyq b8e5d5844d Updated new API Validation with api-keys table and added some additonal log fields 2022-02-04 16:37:19 -05:00
Marcus Hill 6e4025dc58 Initial new api 2022-02-02 22:16:08 +00:00