fix - profile in install
This commit is contained in:
+16
-6
@@ -433,12 +433,14 @@ class Server extends CommonDBTM
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
$canUpdate = Session::haveRight(self::$rightname, UPDATE);
|
||||
$canEdit = $ID > 0
|
||||
? Session::haveRight(self::$rightname, UPDATE)
|
||||
: Session::haveRight(self::$rightname, CREATE);
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td>" . htmlspecialchars(__('API username', 'urbackup')) . "</td>";
|
||||
echo "<td>";
|
||||
if ($canUpdate) {
|
||||
if ($canEdit) {
|
||||
echo Html::input('api_username', [
|
||||
'value' => $this->fields['api_username'] ?? '',
|
||||
'size' => 40,
|
||||
@@ -451,7 +453,7 @@ class Server extends CommonDBTM
|
||||
|
||||
echo "<td>" . htmlspecialchars(__('API password', 'urbackup')) . "</td>";
|
||||
echo "<td>";
|
||||
if ($canUpdate) {
|
||||
if ($canEdit) {
|
||||
echo "<input type='password' name='api_password' value='" .
|
||||
htmlspecialchars((string) ($this->fields['api_password'] ?? '')) .
|
||||
"' autocomplete='new-password'>";
|
||||
@@ -1126,6 +1128,7 @@ class Server extends CommonDBTM
|
||||
$itemtypes = Config::getEnabledItemtypes();
|
||||
$missingAssets = [];
|
||||
$candidatesByType = [];
|
||||
$totalAssets = 0;
|
||||
|
||||
foreach ($itemtypes as $itemtype) {
|
||||
if (!class_exists($itemtype)) {
|
||||
@@ -1148,6 +1151,7 @@ class Server extends CommonDBTM
|
||||
]);
|
||||
|
||||
foreach ($iterator as $assetRow) {
|
||||
$totalAssets++;
|
||||
$name = (string) ($assetRow['name'] ?? '');
|
||||
if ($name === '') {
|
||||
continue;
|
||||
@@ -1204,9 +1208,15 @@ class Server extends CommonDBTM
|
||||
unset($asset);
|
||||
|
||||
if (count($missingAssets) === 0) {
|
||||
echo '<div class="alert alert-success">';
|
||||
echo htmlspecialchars(__('All assets in this location are linked or already on the UrBackup server.', 'urbackup'));
|
||||
echo '</div>';
|
||||
if ($totalAssets === 0) {
|
||||
echo '<div class="alert alert-info">';
|
||||
echo htmlspecialchars(__('No assets', 'urbackup'));
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="alert alert-success">';
|
||||
echo htmlspecialchars(__('All assets in this location are linked or already on the UrBackup server.', 'urbackup'));
|
||||
echo '</div>';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user