pluizia codice
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user