421 Commits
Author SHA1 Message Date
Belle Aerni 3752db5096 Beef up invoice & ticket hash generation (#1309)
* Beef up invoice & ticket hash generation

* Update test for the new length
2023-06-22 09:51:27 +03:00
Belle Aerni ef0200c45a Fix disabling client signups / email changing (#1347)
* Fix disabling client signups / email changing

* Right - I needed to invert these params for the tests
2023-06-20 05:31:00 -07:00
Belle Aerni b9c35a1747 Replace Box_Session and improve session handling (#1332)
* Replace Box_Session and improve session handling

* Improve weights, capitalize class name correctly

* Make the tests pass, update the SQL structure

* Tweak to the fingerprint class, fix more tests

* Regenerate session IDs when logging in

* Improve readability

* Update ServiceTest.php

* Tweak weights and added Huntr badge to the readme

* Improve readability, add PHPDocs, and updated weight

* Update SECURITY.md
2023-06-19 04:14:29 -07:00
Belle Aerni a02b1b32fe Re-check promo code validity during checkout (#1316)
* Re-check promo code validity during checkout

* Add tools mock to the failing test

* Properly resolve issue with the tests
2023-06-12 06:30:45 +02:00
Belle Aerni b95f92554e Fix logical error in Servicedownloadable module (#1311)
* Fix logical error in Servicedownloadable module

* Fix the tests now
2023-06-12 06:28:36 +02:00
Belle Aerni 25a0090c5d Bump AntLoader to v2.0.0 (#1280) 2023-05-30 12:26:24 +03:00
Adam Daley 0e5109a0a5 Refactor System Updater (#1252)
* Refactor System Updater

Refactor Box/Update to clean things up, merge related functionality, improve error checking, and move to FOSSBilling namespace.

Also refactor foss-update.php into core class, `UpdatePatcher`.

* Refactor file system actions to use Symfony Filesystem

Refactor file system actions to use Symfony Filesystem component, and declare all used resources at start of files rather than duplicating throughout.
2023-05-26 15:30:39 +01:00
Belle Aerni 048fd6bc6a Replace composer's dev autoloader with AntLoader (#1228)
* Replace composer's dev autoloader with AntLoader

This way, people don't need to specifically remember to remove dev deps before uploading to a server.

* Move to the tests bootstrap file
2023-05-09 23:32:32 +01:00
Adam Daley 8708d9d895 Fix error with PHPUnit tests (#1217)
Fix error with PHPUnit tests introduced by changes to `FOSSBilling\Validate` class.
2023-05-08 14:06:09 -07:00
Yağızhan d909d77f7e -Unnecessary whitespace in the class headers (#1219) 2023-05-07 13:24:29 -07:00
Yağızhan 412e4a9fbd Standardized the class headers (#1212) 2023-05-06 13:06:17 +01:00
Adam Daley e54569d2cd Introduce namespaces and strict typing for FOSSBilling library classes (#1206) 2023-05-04 01:02:06 +01:00
YağızhanandAdam Daley 4928ebf932 Implemented Monolog (#1155)
* Implemented Monolog

* Doesn't need to look for BB_DEBUG. It won't be logged on prod anyway.

* Doesn't need to be an array

* -Box_LogStream

* Reverted squash

* Fixed a duplicate

* Type hinting

* This got lost in a merge commit

* Kind of distracted today. Good thing squash and merge exists.

* Cleaning

* Rebased composer.json & lockfile

* Enabled the check again

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2023-05-02 09:32:40 +01:00
Yağızhan 950e4dccef Type hinting the DI methods and variables (#1201) 2023-05-01 21:01:35 +03:00
Adam Daley 053f22a8bb Remove Box DI class in favour of native dependencies (#1193) 2023-04-30 08:47:52 +01:00
Belle AerniandAdam Daley e3d6bc9ad9 Introduce a cspell workflow (#1192)
* Introduce a cspell workflow

* Update cspell.yml

* Update cspell.yml

* Why is it seemingly ignoring the config?

* Waiit a min

* Fixed a bunch of spelling mistakes

* And set it back to incremental mode

* That is actually supposed to be spelled wrong..

Because BoxBilling :)

* Capitalization

* I swear I fixed this as well

* Update cspell.json

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2023-04-30 00:05:25 -07:00
Adam Daley e3967dfe96 Move composer files to project root (#1191) 2023-04-30 07:17:06 +01:00
Yağızhan 54f4f40f2c Removed tests for the Zend Framework (#1187) 2023-04-29 13:46:36 +01:00
Yağızhan ef7e060525 Implemented symfony/cache (#1184) 2023-04-29 14:38:53 +03:00
Adam Daley d4e4207d83 Update locations with extension manager naming (#1169)
Update remaining locations with new `extension_manager` naming.
2023-04-26 02:46:56 +02:00
Adam Daley 7b5d12be2b Remove Box\Config in favour of native functionality (#1150) 2023-04-24 10:31:47 +01:00
Adam Daley 67fd972efd Repace DI http-client with direct calls to symfomy/http-client (#1153) 2023-04-22 22:29:42 -07:00
YağızhanandAdam Daley 63d5847da2 New ExtensionDirectory class (#1141)
* Caught a typo

* New ExtensionDirectory class

* Tests

* Tests and error handling

* Stuff

* Literally the same outcome anyway. Will write this in the future.

* Removed tests for a function that does nothing

* "stable" -> "release"

* Fix misnamed exception errors

* Update class name to ExtensionManager

---------

Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
2023-04-22 23:45:24 +01:00
Yağızhan 191233ff86 Renamed Box_Requirements and Box_Version (#1146)
* Renamed Box_Requirements and Box_Version

* Fixed the reference in the GitHub workflow
2023-04-22 18:55:48 +02:00
Yağızhan 98b8a804ab Minor changes to the extension directory templates (#1130) 2023-04-22 14:24:52 +03:00
Adam Daley 69193e402f Remove Box/Zip in favour of library (#1123)
Remove custom Box/Zip class in favour of nelexa/zip library.
2023-04-22 07:21:34 +02:00
Adam Daley ca67aeb44f Refactor request handling to use native functionality (#1122)
Refactor request handling to remove custom library/Box/Request class where possible and instead use native PHP functionality.
2023-04-21 15:07:59 +02:00
Belle Aerni 3c0ef5b4da Remove a few more useless classes (#1129)
* Remove a few more useless classes

* Fix a small typo

* Fix that test

Unless I am missing something, this must have never worked correctly.
2023-04-21 02:35:21 -07:00
Adam Daley a2abdbddfa Refactor Box/Tools to remove unnecessary functions (#1115)
* Refactor Box/Tools to remove unnecessary functions

Refactor Box/Tools to remove functions which essentially duplicate PHP functionality, or provide a thin wrapper around such functions.

* Move config migrate/update to relevant class

Move config update functionality from Box/Tools to Box/Update.

* Move Gravatar function to class where used

Moved Gravatar function to Twig filter where it is used, rather than in a custom Box/Tool function.
2023-04-17 20:48:49 -07:00
Adam Daley 1360b4d81c Move system update functionality to System module (#1116)
Move system update, and config update, config migration/update to relevant System module.
2023-04-17 20:48:28 -07:00
Belle Aerni 16c929f5e7 Automatically select locale based on browser info (#1109)
* Detect browser locale

* Workaround for two char locales being detected
2023-04-16 19:28:03 +02:00
Belle Aerni 0a5fb92b05 Various improvements to translatable strings (#1108)
* Various improvements to translatable strings

* Tests
2023-04-15 03:51:18 -07:00
Belle Aerni a6e5ba88a0 Move to using symfony/mailer for emails (#1091)
* Move to using symfony/mailer for emails

* Is now working as intended

* Missed removals

* Fix front-end & allow usage of custom DSN

* Also remove the old package files

And fixed the fact that I put the admin_default cleanup under a patch that was for a previous release we made.
2023-04-09 02:11:08 -07:00
Adam Daley b08fc53d72 Update rewrite rules, improve error handling, and some related cleanup (#1075)
* Rename htaccess to be applied automatically

Rename the htaccess file, improve handling when .htaccess is missing, and remove from .gitignore so that rules are automatically applied on supported web servers.

* Clean up .gitignore file

* Update .htaccess to improve security

Update .htaccess file to improve general security, handle missing mod_rewrite, and to simplify the required rules.

* Improve HTTP and generic error handling

Improve handling of HTTP errors, and make the error handling code more generic to permit catching more errors.

* Remove outdated example web server config files

Remove the outdated and unmaintained example web server configuration files in favour of FOSSBilling/config-generator.

* Remove support for non-search engine friendly URLs

Remove support for non-search engine friendly URLs as these are depreciated.

* Revert "Remove support for non-search engine friendly URLs"

This reverts commit 724b1eb274.

* Update config migration backup handling
2023-04-06 21:59:25 +02:00
Belle Aerni 9faa981c58 Replace usage of array_get (#989)
* Replace usage of array_get

* Fixes

* And a few more

* Remove remaining references

* Update Service.php

* Few more fixes

* Fix.. I think?

* Fix Client / Invoice updates

* Fix stats

* Fix issues noticed during code review

* More fixes

* And some more fixes :)
2023-03-27 23:44:30 -07:00
Adam Daley 9fb19e02d7 Improve date/datetime format handling and customisability (#948)
* Replace custom Twig bb_date/bb_datetime filters

Replace bb_date and bb_datetime Twig filters with format_date / format_datetime to better support i18n and customisability.

* Update templates to use format_date/format_datetime

Update all templates to use format_date/format_datetime (where appropriate and where not already used).

* Update locale configuration options

Update configuration options to include new locale settings, and ensure new options are used throughout.

* Add reset button to admin theme date picker

Add a reset button to the admin_default theme date picker to allow dates to be cleared, and fix an issue with Order module not allow blank dates. Resolves #938.
2023-03-24 23:16:07 +00:00
Belle Aerni 789189c24e Fix downloading extensions (#979)
* Fix extension downloading & cleanup functionality

* Update ServiceTest.php
2023-03-23 21:50:56 +00:00
Adam de0bed20ec Replace various HTTP client implementations with symfony/http-client (#861)
* Replace guzzlehttp/guzzle with symfony/http-client

Replace guzzlehttp/guzzle with symfony/http-client to standardise around one globally available HTTP client.

* Replace Box\Curl library and native cURL with symfony/http-client

Replace the Box\Curl library and native cURL with symfony/http-client to standardise around one well supported HTTP client, reduce unnecessary code, and improve compatibility.

* Remove obsolete functionality from Spamchecker module

Remove obsolete functions from Spamchecker module which depended upon cURL.
2023-03-15 11:11:28 +01:00
Belle Aerni e43a450934 Remove the example module (#909)
* Remove the example module

* Update Box_ModTest.php

* Update Box_TwigLoaderTest.php
2023-03-07 21:33:49 -08:00
Adam 11a1906ee7 Fix broken module tests (#867)
* Fix typo in Email module tests

Fix missing semicolon in tests for Email module causing PHPUnit to fail.

* Fix module test errors due to RedBean

Fix module tests causing error due to RedBean when being mocked in PHPUnit.

* Fix module test failures

Update module tests to fix failures, and remove obsoleted tests causing failure.
2023-02-27 10:38:20 -08:00
Belle Aerni 7ecaf786d5 Move RedBeanPHP to composer (#767)
* Move RedBeanPHP to composer

* Remove missed references to rb.php

* This *should* fix the tests

* Update DummyBean.php

* Remove payment adapter tests

They.. honestly didn't test much and are proving to cause issues when moving rb.php to composer
2023-02-05 08:43:37 -08:00
Belle Aerni 4d7b341e03 Removed / cleaned up deprecated functions (#755)
* Add PHPStan extension for deprecation function usage

* Removed some deprecated functions

* And a few more

* Also remove the deprecated API calls

* Fix references to deprecated API calls

* Oh, and this too
2023-02-01 03:36:02 -08:00
Belle Aerni d8d04b24fa Revert "Improved period strings for non-plural periods"
This reverts commit df5610ea57.
2023-01-26 16:03:27 -08:00
Belle Aerni df5610ea57 Improved period strings for non-plural periods 2023-01-26 15:31:48 -08:00
Belle Aerni 226c4766d4 Fix that test, and add another one 2023-01-26 15:08:09 -08:00
Belle Aerni efa70f1019 Fix the period strings (#667)
* Fix the period strings

* Update Box_PeriodTest.php
2023-01-06 11:41:58 +01:00
Belle Aerni 3011c8a4b0 Move PHPStan to it's own action & bump the scanning level (#629)
* Move PHPStan to it's own action

* Bump PHPStan to level 1

* This fix it?

* Update Box_MailTest.php

* And fix a typo in the action

* Update phpstan.yml

* Update phpstan.yml

* Test
2022-12-28 04:32:17 -08:00
Jaap Marcus c96a45157f Feature | Disable email when in Demo mode (#570)
* Disable Email when Demo mode is enabled

* And for mass mail

* Fix tests
2022-12-11 02:57:09 -08:00
Belle Aerni a68c1d7261 Fix checks 2022-12-08 17:06:32 -08:00
Belle Aerni c243f91b3d Create custom "__trans" function & use that 2022-12-08 12:18:22 -08:00