pulsanti e create client
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use GlpiPlugin\Urbackup\Profile;
|
||||
use GlpiPlugin\Urbackup\Server;
|
||||
use GlpiPlugin\Urbackup\ServerAsset;
|
||||
use Html;
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
@@ -17,6 +18,18 @@ if (!Profile::canCurrentUser(UPDATE)) {
|
||||
$server = new Server();
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (isset($_POST['link_asset'])) {
|
||||
$itemtype = (string) ($_POST['itemtype'] ?? '');
|
||||
$items_id = (int) ($_POST['items_id'] ?? 0);
|
||||
$server_id = (int) ($_POST['id'] ?? 0);
|
||||
|
||||
if ($itemtype !== '' && $items_id > 0 && $server_id > 0) {
|
||||
ServerAsset::connectAssetToServer($itemtype, $items_id, $server_id);
|
||||
}
|
||||
|
||||
Html::redirect(PLUGIN_URBACKUP_WEB_DIR . '/front/server.php?id=' . $server_id);
|
||||
}
|
||||
|
||||
$id = $_POST['id'] ?? 0;
|
||||
|
||||
if ($id > 0) {
|
||||
|
||||
Reference in New Issue
Block a user