Before sanitization

This commit is contained in:
mariano
2026-05-28 11:44:51 +02:00
parent 0bdd5476cb
commit 425f8cb5a4
2 changed files with 22 additions and 1 deletions
+18
View File
@@ -147,6 +147,24 @@ class AssetTab extends CommonDBTM
echo "<td colspan='2'>"; echo "<td colspan='2'>";
echo "<div class='alert alert-warning'>"; echo "<div class='alert alert-warning'>";
echo htmlspecialchars(__('No UrBackup server available for the root location of this asset.', 'urbackup')); echo htmlspecialchars(__('No UrBackup server available for the root location of this asset.', 'urbackup'));
if (Session::isDebugActive()) {
$loc_id = LocationHelper::getAssetLocationId($item);
$root_id = LocationHelper::getRootLocationIdForAsset($item);
echo "<br><small class='text-muted'>";
echo "Asset locations_id: " . htmlspecialchars((string) $loc_id);
echo " | Root location ID: " . htmlspecialchars((string) $root_id);
echo " | glpi_plugin_urbackup_servers with this root ID + is_active=1: ";
global $DB;
$count = $DB->request([
'FROM' => Server::getTable(),
'WHERE' => [
'locations_id' => $root_id,
'is_active' => 1,
],
]);
echo htmlspecialchars((string) count($count));
echo "</small>";
}
echo "</div>"; echo "</div>";
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";
+4 -1
View File
@@ -350,7 +350,10 @@ class Server extends CommonDBTM
echo "<td>" . htmlspecialchars(__('Active')) . "</td>"; echo "<td>" . htmlspecialchars(__('Active')) . "</td>";
echo "<td>"; echo "<td>";
Dropdown::showYesNo('is_active', (int) ($this->fields['is_active'] ?? 1)); Dropdown::showYesNo(
'is_active',
($ID !== null && $ID > 0) ? (int) ($this->fields['is_active'] ?? 1) : 1
);
echo "</td>"; echo "</td>";
echo "</tr>"; echo "</tr>";