pluizia codice

This commit is contained in:
mariano
2026-05-21 10:54:04 +02:00
parent 5fac26040a
commit 223180d1a9
12 changed files with 32 additions and 38 deletions
+3 -9
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
/**
* -------------------------------------------------------------------------
* UrBackup plugin for GLPI
@@ -70,16 +72,8 @@ if (isset($_POST['disconnect'])) {
Html::displayRightError();
}
global $DB;
$link = ServerAsset::getLinkForAsset($itemtype, $items_id, false);
$result = ServerAsset::disconnectAsset($itemtype, $items_id);
if ($link === null) {
Html::displayValidationError(__('Asset is not linked to any server'));
}
$result = $DB->delete('glpi_plugin_urbackup_serverassets', ['id' => (int) $link['id']]);
if ($result) {
$item->getFromDB($items_id);
Html::redirect($item->getLinkURL());
+2
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use GlpiPlugin\Urbackup\Config;
use Html;
+2
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use GlpiPlugin\Urbackup\Profile;
use GlpiPlugin\Urbackup\Server;
use GlpiPlugin\Urbackup\ServerAsset;
+2
View File
@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
use GlpiPlugin\Urbackup\Profile;
use GlpiPlugin\Urbackup\Server;
use Html;
+3
View File
@@ -1,4 +1,7 @@
<?php
declare(strict_types=1);
/**
* AJAX endpoint for testing UrBackup API
*/