fix client connet redirect to scheda on page

This commit is contained in:
test
2026-08-31 11:00:33 +02:00
parent dec82edf60
commit 47af0c6bad
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -12,7 +12,8 @@ Audit statico (IA) + confronto contro sorgente C++ del backend UrBackup e core G
6. **Bug 6 — server_test.ajax.php auth + CSRF** (`front/server_test.ajax.php`): sostituito `Profile::canCurrentUser(UPDATE)` (non entity-aware) con `$server->check($id, UPDATE)` in try/catch → 403 JSON; creato `public/js/urbackup.js` (registrato via `Hooks::ADD_JAVASCRIPT` in setup.php) che legge meta `glpi:csrf_token` e invia header `X-Glpi-Csrf-Token` su ogni POST AJAX del plugin (pre-requisito del listener GLPI 11 `CheckCsrfListener`). 6. **Bug 6 — server_test.ajax.php auth + CSRF** (`front/server_test.ajax.php`): sostituito `Profile::canCurrentUser(UPDATE)` (non entity-aware) con `$server->check($id, UPDATE)` in try/catch → 403 JSON; creato `public/js/urbackup.js` (registrato via `Hooks::ADD_JAVASCRIPT` in setup.php) che legge meta `glpi:csrf_token` e invia header `X-Glpi-Csrf-Token` su ogni POST AJAX del plugin (pre-requisito del listener GLPI 11 `CheckCsrfListener`).
7. **Bug 7 — dropdown_host.ajax.php info-disclosure** (`front/dropdown_host.ajax.php`): aggiunto check `Profile::canCurrentUser(READ)`. 7. **Bug 7 — dropdown_host.ajax.php info-disclosure** (`front/dropdown_host.ajax.php`): aggiunto check `Profile::canCurrentUser(READ)`.
8. **Traduzioni**: aggiunta la nuova stringa "Client not found on UrBackup server. Check that the asset name matches the client name." a it_IT/de_DE/en_GB `.po`, ricompilati i `.mo` (msgfmt). Versione header coerente (0.7.3). Changelog README aggiornato. 8. **Traduzioni**: aggiunta la nuova stringa "Client not found on UrBackup server. Check that the asset name matches the client name." a it_IT/de_DE/en_GB `.po`, ricompilati i `.mo` (msgfmt). Versione header coerente (0.7.3). Changelog README aggiornato.
- Verifica IA: `php -l` OK su tutti i file; `git diff` autorevisione OK; `Hooks::ADD_JAVASCRIPT` verificato in `src/Glpi/Plugin/Hooks.php:60`; meta `glpi:csrf_token` verificato in `templates/layout/parts/head.html.twig:68`. **Verifica UI utente OBBLIGATORIA** (vedi checklist). 9. **File residui root** (verificati 31/08): `messages.mo` è un **duplicato obsoleto di `locales/en_GB.mo`** (184 msg, Language en_GB, Project-Id-Version 0.7.3): data `ago 7`, proprietario `root`, non contiene la nuova stringa del Bug 2, mai referenziato da alcun codice → **residuo inutile** (l'utente lo aggiunge a `.gitignore`). `ecs.php` è la config di **ECS (Easy Coding Standard)** solo per development (`vendor/bin/ecs check/fix` su `src/`), NON caricato a runtime — da tenere tracciato per standard di stile coerenti.
- Verifica IA: `php -l` OK su tutti i file; `git diff` autorevisione OK; `Hooks::ADD_JAVASCRIPT` verificato in `src/Glpi/Plugin/Hooks.php:60`; meta `glpi:csrf_token` verificato in `templates/layout/parts/head.html.twig:68`; `msgfmt -c` valido su tutti i `.po`. **Verifica UI utente OBBLIGATORIA** (vedi checklist).
## 31/08/2026 — Fix campi API username/password non editabili in prod (solo UI) ## 31/08/2026 — Fix campi API username/password non editabili in prod (solo UI)
- **Sintomo utente**: installato il plugin sul server produttivo, nel form Server non si vede il campo API username e il campo API password è bloccato (asterischi fissi non editabili), anche per l'utente che ha installato il plugin. - **Sintomo utente**: installato il plugin sul server produttivo, nel form Server non si vede il campo API username e il campo API password è bloccato (asterischi fissi non editabili), anche per l'utente che ha installato il plugin.
+1 -1
View File
@@ -28,7 +28,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
ServerAsset::connectAssetToServer($itemtype, $items_id, $server_id); ServerAsset::connectAssetToServer($itemtype, $items_id, $server_id);
} }
Html::redirect(PLUGIN_URBACKUP_WEB_DIR . '/front/server.form.php?id=' . $server_id); Html::redirect(PLUGIN_URBACKUP_WEB_DIR . '/front/server.form.php?id=' . $server_id . '#tab-unlinked');
} }
$id = $_POST['id'] ?? 0; $id = $_POST['id'] ?? 0;