Commit Graph
56 Commits
Author SHA1 Message Date
3ee7f29689 Reworked Password-Reset flow (#1627)
* Reworked Password-Reset flow
- No more Passwords sent via E-Mail
- Correct redirects.

* Fixed spelling & last redirect

* Small fixes and updated tests for pw-reset-flow

* Fixed tests for pw-reset-flow

* Fixed tests for the Password reset flow

* Fixed typos, resolved Feedback

* Renamed event before password reset

* Renamed event after password reset

* Tweak a few comments, send the reset email instantly

---------

Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-09-22 18:15:18 -07:00
Christoph SchlaepferandChristoph Schläpfer 4dd38a0479 Removed random static key in email setVars & getVars (#1629)
* Removed random static key in email setVars & getVars

* Added config mock to Tests, fixed feedback

* Added config mock to Tests, fixed feedback

---------

Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch>
2023-09-22 15:43:36 -07:00
Belle Aerni 3d7132321a Prune the filesystem cache during cron (#1596)
* Prune the filesystem cache during cron

* Something something fix the tests

* Move it to the system module
2023-09-20 00:08:47 +02:00
RonandBelle Aerni 756fab9308 #1342 Fix Email Queue (#1592)
* #1342 fix processing emails from queue

* #1342 fix code style

* #1342 temp fix email send test

* Remove the commented out code as it's not needed

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-09-14 08:27:34 -07:00
Belle Aerni df0c300d23 Remove payment gateways we can't really maintain (#1535)
* Remove payment gateways we can't really maintain

I've moved these to their own separate repos so others can easily contribute to them if needed, however since we can't (and don't plan to) maintain these, it's best to remove them from the main repo and no longer ship them with every installation.
The only known-working one is TwoCheckout which I'll get added to the extension directory

* Fix the tests
2023-08-14 11:03:12 +02:00
Belle AerniandJaap Marcus d2a18581c4 Fix / change invoice incrementation logic (#1474)
* Fix invoice incrementation logic

Co-Authored-By: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>

* Oh I hate these tests

* Remove duplicated semicolon

---------

Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
2023-08-12 02:19:01 +01:00
Christoph SchlaepferandBelle Aerni 7a38450458 Make system version & company info visibility through the guest API configurable (#1504)
* Add feature to hide public FOSSBilling version and Company information

* Cleaned up

* Added Test cases for Version & Company information

* Fixed Authorization Mock

* Fixed Tests so isAdminLoggedIn is false when testing Public Access

* Cleaned up

* Implemented Suggested code and fixed tests.

* Removed manual Version for API.js string and replaced with twig filter "script_tag"

* Added Twig filter for Version and replaced guest.system_version

* Added Message to Admin Settings

* Now let's do all of that, but better

- A filter is the wrong way to get the system version to the front end
- The wording in the admin panel for these settings didn't correctly describe what they did and they had poor grammar
- The version check should be returning a string, not an array & the code can be significantly cleaned up.
- Inverting the behavior of these toggles means that existing installations will continue to have the same behavior as before without us forcibly changing it. Otherwise, we need to introduce a DB patch to add the new values with them being on to match what was the old behavior.
- For new installations, we can pretty safely turn these options off to give a bit more privacy / security and allow them to be turned back on if wanted.
- New installations can keep the current behavior. We will highlight that this feature is added & if it's something the administrator wants, they can adjust the settings for themselves

* Cursed spelling *angry hand movements*

* That should have never been an array to being with

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-08-02 19:40:43 +02:00
Christoph SchlaepferandAnuril e466b0a425 Prevent deletion of Servers, Hosting Plans and TLDs that have active Products. (#1492)
* Started to rework deletion checks so no unintended database issues can arise.

We should really start working with referential integrity, otherwise this will become unmanageable soon.

That would also require things like Taxes be referred to by their IDs, not their names.

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L575

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L1365

* Fixed the tests for the _delete functions

* Started to rework deletion checks so no unintended database issues can arise.

We should really start working with referential integrity, otherwise this will become unmanageable soon.

That would also require things like Taxes be referred to by their IDs, not their names.

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L575

https://github.com/FOSSBilling/FOSSBilling/blob/ad94a9f3255801817f393cda36bc0a38796e1eb9/src/install/sql/structure.sql#L1365

* Fixed the tests for the _delete functions

* Fixed tests

* Fixed tests

* Fixed tests

* Fixed tests

* Fixed testhp_delete tests

* Add words to ignorelist

* Add words to ignorelist

* Fixed count placeholder & cleaned up code

---------

Co-authored-by: Anuril <ta@TAPC01.localdomain>
2023-07-30 20:38:53 +02:00
9e4e3023fa Fixed Password Reset handling (#1365)
* Fixed Passwort Reset handling so the message is the same whether the E-Mail address exists or not.

* Fixed spelling & Test

* Fixed Typo

* Improved Staff PW Reset handling and removed both Exceptions to return true

* Improved grammar & wording

---------

Co-authored-by: Christoph Schläpfer <c.schlaepfer@datact.ch>
Co-authored-by: Anuril <ta@TAPC01.localdomain>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-07-30 06:58:11 -07:00
Belle Aerni dfcabdd80b Remove the "remember me" checkbox (#1471)
The functionality for this isn't actually implemented and it doesn't work
2023-07-26 08:14:28 -07:00
Belle Aerni 20c23b051e Invalidate existing sessions during PW reset (#1435) 2023-07-20 13:23:44 +01:00
Belle Aerni c83f80cc2d Fix / improve flawed email confirmation system (#1451)
* Fix / improve flawed email confirmation system

* Don't check email confirmation during login

This will prevent them from being able to change it if they had a typo and is not needed now that it's checked on page-load

* Removed the unneeded test
2023-07-18 13:04:39 +02:00
Belle Aerni ee623529ca Minor improvements to cron (#1436)
* Minor improvements to cron

* I swear these tests are high sometimes

Seriously. Why did this check pass before?

* Update Service.php

* Update ServiceTest.php
2023-07-14 17:03:22 +03:00
Belle AerniandJohn @ S4 20e38a162f Exception messages cleanup (#1376)
* Misc exception messages improvements

* Cleanup / improve server manager exceptions

* Tests :)

* Some registrar exception cleanup

* Clean up payment gateway exceptions

* Some other misc improvements

* Update Resellerclub.php

* Fix typo in Namecheap error message

---------

Co-authored-by: John @ S4 <64874788+John-S4@users.noreply.github.com>
2023-07-03 14:54:23 -07:00
Belle Aerni 3dccf978ad Fix some malformed search statements (#1400)
* Fix some malformed search statements

* Fix these stupidly written tests
2023-07-02 22:55:56 +03:00
Jaap MarcusandBelle Aerni 2ddb7438ee Limit "LIMIT" to numbers only + Disable upload theme (#1392)
* Prevent non numeric values being used in limits

Potential abuse for Sql injection
Only allow integers to be used


Adjust exception

* Disable upload assets via Theme pages

File upload was removed in an earlier PR

* Make sure the test run fine

* Fix the tests

* Use limit instead of per_page

* And another fix

---------

Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2023-06-30 22:51:50 +02:00
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
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
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
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
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
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
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
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