* 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.
* 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.
* Remove php-http/message-factory
* Don't report error reporting changes on preview builds
We don't have a way to reliably track / compare this, so the message would otherwise almost always be displayed.
Hiding the massage on preview builds resolves that
* Downgrade errors in the API controller
None of these are really errors, so let's convert them to InformationException so they aren't captured and sent to Sentry
* 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
* 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>
* Apply PHP Code Styling & Quality Changes
* Delete these
* Update .gitignore
* Fixes for PHPStan
* Ignore spelling in the gitnore
* Allow null for that type
Honestly doing so makes ZERO sense, but it matches the current behavior.
---------
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
* 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.
* +Central Alerts System
* Added a link to the pull request
* Bugfix
* Refactored to use symfony/cache
* Reverted the database patch
* Update foss-update.php
* Reverted the table structure
* Restore src/install/sql/structure.sql
* Fixed the HTTP client
* Restore src/foss-update.php
---------
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
* Update System update message to link to updater
Update the System module to provide a link to the updater in the update available message. Also update admin template to permit passing arbitrary HTML (such as links) in system messages.
* Improve system message handling with optional URL
Update System module message handling, and admin template, to better handle an optional URL for each message.
* 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.
* 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 :)
* 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.
* 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.