* Replace Gravatar with local avatar generation
Removed Gravatar integration and implemented local avatar generation using DiceBear Identicon for user avatars. Updated Twig templates to use a new `.db-avatar` element and added supporting JavaScript for avatar rendering.
* Replace Gravatar with local avatar generation
Removed Gravatar integration and implemented local avatar generation using DiceBear Identicon for user avatars. Updated Twig templates to use a new `.db-avatar` element and added supporting JavaScript for avatar rendering.
* Add avatar SVG caching and simplify encoding
Introduced a cache for generated avatar SVGs to improve performance by avoiding redundant computations. Also simplified SVG encoding by removing unnecessary character replacements.
* Update src/themes/huraga/assets/js/avatar.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/themes/admin_default/assets/js/avatar.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/themes/huraga/html/layout_default.html.twig
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/themes/huraga/html/mobile_menu.html.twig
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Improve avatar background rendering in themes
Added backgroundSize, backgroundPosition, and backgroundRepeat styles to avatar containers in both admin_default and huraga themes to ensure SVG avatars are properly scaled and centered without repeating.
* Downgrade @dicebear/core and identicon to v9.0.0
* Update live-tests.yml
* Update live-tests.yml
* Update package-lock.json dependencies
Marked several dependencies as peer, removed unused dev dependencies (balanced-match, brace-expansion, concat-map, minimatch), and added sass-embedded-darwin-x64. This cleans up the dependency tree and improves package management.
* Refactor avatar generation to use hashed seed
Replaces email-based avatar generation with a hashed seed using a new Twig filter. Updates all avatar-related HTML and JS to use `data-avatar-seed` and `data-avatar-size` attributes, improving privacy and consistency across admin and client themes.
* Update src/library/Box/TwigExtensions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/library/Box/TwigExtensions.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/modules/Staff/html_admin/mod_staff_index.html.twig
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
* Introduce some simple phone number validation
* Expanded client creation tests to include phone numbers
* Update Admin.php
* Addressed the review
* Ran CS fixes
* Fixed
* Apply PHP Code Styling & Quality Changes
* Remove unwnated file
* Apply PHP Code Styling & Quality Changes
* Remove unwnated file
* Update PHPUnit version to 12 in CI workflow
Bump the PHPUnit version from 10 to 12 in the GitHub Actions CI configuration to ensure tests run against the latest PHPUnit release.
* Refactor HTML sanitizer instantiation
* Refactor object instantiation
---------
Co-authored-by: FOSSBilling Bot <fossbilling-bot>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
* Allow controlling domain options for hosting products
* Redo the domain form
* Make sure at least one option is enabled.
* Domain normalization
* Proper pluralization
* a11y improvements
* API wrapper should handle these by itself
---------
Co-authored-by: Adam Daley <admdly@users.noreply.github.com>
* Remove tab state management via URL hash
* Add global error handling to `admin_defaul`t and `huraga` themes
Introduced global handlers for unhandled Promise rejections and synchronous errors in both `admin_default` and `huraga` themes to improve error reporting. Updated `API.js` to handle errors more gracefully during API requests and when parsing API configuration.
* Remove prevention of default unhandledrejection handling
* Copilot suggested fix
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor error handling in API.js
* Update src/themes/admin_default/assets/js/fossbilling.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/library/Api/API.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor database connection to use `DriverManagerFactory`
* Add Doctrine DBAL connection to DI container
Revert "Add Doctrine DBAL connection to DI container"
This reverts commit bc2f9f4901d8baee4b12cd2795b0ef76156849cf.
Reapply "Add Doctrine DBAL connection to DI container"
This reverts commit 48debb74bbfa6c8cebf27ee20c222c911d508ccb.
* Refactor database access to use Doctrine DBAL
* Refactor DB config to use 'driver' instead of 'type'
* Refactor database connection to use `DriverManagerFactory`
* Add Doctrine DBAL connection to DI container
Revert "Add Doctrine DBAL connection to DI container"
This reverts commit bc2f9f4901d8baee4b12cd2795b0ef76156849cf.
Reapply "Add Doctrine DBAL connection to DI container"
This reverts commit 48debb74bbfa6c8cebf27ee20c222c911d508ccb.
* Refactor database access to use Doctrine DBAL
* Refactor DB config to use 'driver' instead of 'type'
* Refactor tests to use `dbal` mocks
* Replace `getQueryBuilder` with `createQueryBuilder
* Fix handling of empty query results and cleanup exception comment
* Update Composer lock file
* Refactor PDO initialization in DI container
Updated the DI definition for 'pdo' to directly use the PDO instance returned by Doctrine's DriverManagerFactory, removing unnecessary object casting. Also added missing import for DriverManagerFactory. Updated PHPStan config to remove a redundant ctype_alnum rule.
* Refactor query execution and result fetching logic
Updated database query handling in Extension and System Service classes to separate query building from execution and fetching. This improves code clarity and ensures consistent use of fetchOne for single-value results.
* Fix SQL where clause syntax in Service.php
Corrects the syntax of the where clause in several queries by changing 'where('param', ':param')' to 'where('param = :param')' for proper parameter binding and query execution.
* Refactor Stats module to use Doctrine DBAL
* Refactor Custompages Service to use dbal instead of pdo
Replaced all direct PDO usage with dbal methods for database operations in the Custompages Service. This improves consistency, leverages dbal's abstraction, and prepares the codebase for better maintainability and future enhancements.
* Refactor DBAL usage and update test mocks
Refactored DBAL service definitions and query builder usage to improve clarity and consistency. Updated tests to use anonymous classes for DBAL and query builder mocks instead of PHPUnit mock objects, simplifying test setup and improving maintainability.
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor DB queries to use executeQuery and executeStatement
Replaced manual PDO prepare/execute calls with Doctrine DBAL's executeQuery and executeStatement methods in UpdatePatcher and ApiRequestTable. This improves code consistency and leverages DBAL features for query execution and result fetching.
* Add input validation for DB charset, table, and column names
Introduces strict validation for supported database charsets in DriverManagerFactory, allowed column names in Custompages Service, and allowed table names in Stats Service to prevent invalid or unsafe input. Also updates UpdatePatcher with default values for new config keys and adjusts a Stats Service test to use a valid table name.
* Add 'CHARSETS' to cspell custom words list
* Refactor query execution in patcher and product domain
Updated query builder usage in UpdatePatcher and ProductDomainTable to separate query building from execution, aligning with best practices. Removed unused fetchOne stubs from ServiceTest to reflect these changes.
Co-Authored-By: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor `getProductSummary` to use Doctrine DBAL
* Fix parameter binding for category and hash in UpdatePatcher
Updated the insert statement in UpdatePatcher to bind the 'category' and 'hash' parameters explicitly, ensuring correct handling of null values during database insertion.
* Update MySQL charset handling in PDO setup
Removes redundant charset initialization statements for MySQL connections, relying on DBAL to handle connection charset via DSN. Now only sets the server default charset and session timeouts.
* Set default DB driver to `pdo_mysql` in `UpdatePatcher`
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>