* Begin reworking permission management
* Tests
* This.. tested functionality that didn't exist in the app
* Fixes
* Added permission checks for the system module
* Implemented extension settings permission
The "extension" settings page will now check for permission before allowing a staff member to even visit the settings page for a client.
FOSSBilling will also check for permission before saving a new config so the API can't be used to bypass this limitation.
I also removed a test as it was checking a function which only ever had one possible return value, no point in updating it to work with this PR
* This should fix the test
* I got a little mixed up with that, but this should work
* Fixed the tests
* Implemented give all & revoke all buttons
* Implemented more, enhancements, & bugfix
* Rename function
* Fix tests
* Optimize, address comment
* Now let's make the tests happy again
* Deduplicate code, cleanup a bit
* Bugfix
* Added selectbox support to the front-end
* Quick bugfix
* Fix issue PHPStan detected
* Bug fix
* Improved page layout & styling
* Implemented more checks
* Fix the tests
* Update error.html.twig
* Cleanup
* Fix the tests
* Updated the design to be more space efficient
* Don't list module access when always given
* Updated the exception type
* setMethod -> onlyMethods
* I donno how that got goofed up
* Fix the test, email module should always be accessible
* Removed the broken test
It's.. not really checking anything anyways. Just that the `extension` module is in a hardcoded array.
* Update rector config to include tests
* Run Rector against the tests
* Delete test-results
* Update .gitignore
* Correctly set the PHP min to 8.1, split the configs
* Corrected PHPDoc
* Deleted tests we can't really get to pass
PHPunit is hard-coded to fail when a class has a return type of `never`, which is the correct return type of our redirect function (and rightfully so).
No way to disable the exception as far as we can tell
* Update PHPUnit to version 10
Update composer and CI version of PHPUnit to 10, and migrate XML config to updated schema.
* Update tests for PHPUnit 10
Update tests to replace depreciated functions in PHPUnit 10. Also, remove risky tests which don't assert anything.
* Remove the Queue module and update massmailer
Queue module was only used by the massmailer module & it duplicated the functionality of the email service, resulting in added complexity for no real benefit.
This commit removes the Queue module outright and points the massmailer to the email service instead, which already implements queing, retires, and time limits.
* Added the ability to view the email queue
* Minor front-end improvements, added removal patch
* Cleanly handle a client being removed
* Fix PATH_DATA constant to use config
Update `PATH_DATA` constant to use the `path_data` config option.
* Replace direct config references with constants
Replace direct references to `config.php` file and specific config options in favour of global constants, where available.
* Drop BB prefix on global constants
Rename global constants to drop `BB_` prefix, where appropriate.
* Merge Kb and Support modules
Merge the Kb and Support modules as they contain related functionality.
* General improvements to Support module UI
Update Support module copy and navigation to be more consistent, and other general improvements.
* This was missed.. and now it's not 😉
---------
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
* Began implementing Sentry.io support
* Added to the installer
* Added the ID to the bug report template and UI
* Hook it into our error handler, added the ability to filter by error code
* Attempting to add the DSN via GH actions
* Spelling and making PHPstan happy
* Skip exceptions for various incomplete configurations
Also brings in some of the category suggestions made by @Anuril in #195
* Update tests to account for changes
* Added & renamed exception classes
* Fix tests
* Change a bunch of items to be InformationExceptions
* Use a lighter HTTP client, fixed API error reporting
* I guess that's not needed now?
Arighty then
* Improvements, additional info added
* Update SentryHelper.php
* Improved error logging, added instance ID to error page
Also made it so that errors are correctly sent to Sentry rather than exclusively exceptions
* Make the tests happy
* Added the link, improved wording
Also removed the "performance" part of the reporting as it needs to be added to the front-end and I'm not currently implementing that
* Began implementing UI alerts and info
* Added the ability to toggle, fixed tests, use path constants
* Added some useful info & links to the page
* These should be InformationException
* Fix the automated Sentry DSN entry
* Fix the install number text
* Minor cleanup, converted more to InformationException
* Replaced some direct config references with constants
We have the BB_DEBUG constant to indicate if we have debug mode enabled or not, so we shouldn't be directly referencing it in the config file unless we actually need to do so.
Using the constant means there's less locations to update the reference if the config structure is changed
* Bugfix
* Consistency & fixed a PHPDoc
* Corrections
* We actually do want exceptions thrown here
* Change how we get the instance ID
* Stability improvements
Having support for translatable error pages was proving to be problematic, so I had to remove it.
I also had to update the exception class to handle cases where the trans function wasn't setup yet (needed for the /run-patcher page if an error occurs)
* Missed this change on git
* Also fix the variable names...
* Re-added new deps after rebase
* This should also accept "Error" types
* Added more info to the bug report and removed a dug line
* This wasn't supposed to get renamed
* Updated some missed references to Box_Exception
* When you press the "Mark as paid" Button on the invoice, you can now enter a transaction id.
If the Payment gateway of the Invoice is "Custom" and it's enabled, the transaction ID will be used to add transactions that add funds in the amount of the invoice to the customer. Then, it will be marked as paid, just like with any other payment provider.
* Added processTransaction method to the Custom Payment Gateway.
* Fixed tests by removing unnecessary tests for Payment Adapters that don't have the processTransaction method.
---------
Co-authored-by: Christoph Schläpfer <chris+github@cleverly.ch>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
* Rewritten bin/prepare & +FOSSBilling_Environment
* -redundancy
* - unnecessary bits
* nothing much
* Fix inverted logic, use new function in missed location
---------
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
* 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>
* #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>
* 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
* 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>
* 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>
* 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
* Minor improvements to cron
* I swear these tests are high sometimes
Seriously. Why did this check pass before?
* Update Service.php
* Update ServiceTest.php
* 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>
* 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
* 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.
* 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