mirror of
https://github.com/tips-of-mine/gestion-certificats2.git
synced 2025-06-27 20:38:42 +02:00
![google-labs-jules[bot]](/assets/img/avatar_default.png)
1. **`intermediate_cert_name` unique constraint violation**: When creating a perimeter, the intermediate certificate name (`intermediate_cert_name`) stored in the `functional_perimeters` table was always `"intermediate.cert.pem"`. This caused a duplicate error if a unique constraint existed on this column. * Fixed in `PerimeterController.php` by using `$perimeterName . "_intermediate.cert.pem"` as the value for `intermediate_cert_name`, ensuring uniqueness. The physical file name remains `intermediate.cert.pem` in the perimeter's subdirectory. 2. **`Undefined variable $userRole` warning**: On the page listing perimeters (`app/src/Views/perimeters/index.php`), the `$userRole` variable was not defined by the controller. * Fixed in `PerimeterController.php` (method `index()`) by initializing `$userRole = $this->authService->getUserRole();`. 3. **SQL error `Unknown column 'common_name'` during initialization**: During the application initialization process (if no user or root certificate exists), an attempt to insert into the `certificates` table included a `common_name` column that does not exist. * Fixed in `app/public/index.php` by removing the `common_name` column and its value from the insert query for the root certificate. These corrections improve the robustness of perimeter creation and make the application initialization process more reliable.