fix access_backup*s* paramter name
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -278,7 +278,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
* optional, either 0 to disable backup for this customer or a backup-storage-id
|
* optional, either 0 to disable backup for this customer or a backup-storage-id
|
||||||
* where backups are to be stored, requires change_serversettings permissions,
|
* where backups are to be stored, requires change_serversettings permissions,
|
||||||
* default is system-setting backup.default_storage
|
* default is system-setting backup.default_storage
|
||||||
* @param bool $access_backup
|
* @param bool $access_backups
|
||||||
* optional, where the customer is allowed to view backups, default is system-setting
|
* optional, where the customer is allowed to view backups, default is system-setting
|
||||||
* default_customer_access
|
* default_customer_access
|
||||||
*
|
*
|
||||||
@@ -379,10 +379,10 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
$backup = Settings::Get('backup.default_storage');
|
$backup = Settings::Get('backup.default_storage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$access_backup = $this->getBoolParam('access_backup', true, Settings::Get('backup.default_customer_access'));
|
$access_backups = $this->getBoolParam('access_backups', true, Settings::Get('backup.default_customer_access'));
|
||||||
} else {
|
} else {
|
||||||
$backup = Settings::Get('backup.default_storage');
|
$backup = Settings::Get('backup.default_storage');
|
||||||
$access_backup = Settings::Get('backup.default_customer_access');
|
$access_backups = Settings::Get('backup.default_customer_access');
|
||||||
}
|
}
|
||||||
|
|
||||||
// validation
|
// validation
|
||||||
@@ -561,7 +561,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
'custom_notes_show' => $custom_notes_show,
|
'custom_notes_show' => $custom_notes_show,
|
||||||
'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver),
|
'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver),
|
||||||
'backup' => $backup,
|
'backup' => $backup,
|
||||||
'access_backup' => $access_backup
|
'access_backups' => $access_backups
|
||||||
];
|
];
|
||||||
|
|
||||||
$ins_stmt = Database::prepare("
|
$ins_stmt = Database::prepare("
|
||||||
@@ -606,7 +606,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
`custom_notes_show` = :custom_notes_show,
|
`custom_notes_show` = :custom_notes_show,
|
||||||
`allowed_mysqlserver`= :allowed_mysqlserver,
|
`allowed_mysqlserver`= :allowed_mysqlserver,
|
||||||
`backup` = :backup,
|
`backup` = :backup,
|
||||||
`access_backup` = :access_backup
|
`access_backups` = :access_backups
|
||||||
");
|
");
|
||||||
Database::pexecute($ins_stmt, $ins_data, true, true);
|
Database::pexecute($ins_stmt, $ins_data, true, true);
|
||||||
|
|
||||||
@@ -1058,7 +1058,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
* optional, either 0 to disable backup for this customer or a backup-storage-id
|
* optional, either 0 to disable backup for this customer or a backup-storage-id
|
||||||
* where backups are to be stored, requires change_serversettings permissions,
|
* where backups are to be stored, requires change_serversettings permissions,
|
||||||
* default is system-setting backup.default_storage
|
* default is system-setting backup.default_storage
|
||||||
* @param bool $access_backup
|
* @param bool $access_backups
|
||||||
* optional, where the customer is allowed to view backups, default is system-setting
|
* optional, where the customer is allowed to view backups, default is system-setting
|
||||||
* default_customer_access
|
* default_customer_access
|
||||||
*
|
*
|
||||||
@@ -1135,10 +1135,10 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
$backup = $result['backup'];
|
$backup = $result['backup'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$access_backup = $this->getBoolParam('access_backup', true, Settings::Get('backup.default_customer_access'));
|
$access_backups = $this->getBoolParam('access_backups', true, Settings::Get('backup.default_customer_access'));
|
||||||
} else {
|
} else {
|
||||||
$backup = $result['backup'];
|
$backup = $result['backup'];
|
||||||
$access_backup = $result['access_backup'];
|
$access_backups = $result['access_backups'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// allowed parameters
|
// allowed parameters
|
||||||
@@ -1447,7 +1447,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
'api_allowed' => $api_allowed,
|
'api_allowed' => $api_allowed,
|
||||||
'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver),
|
'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver),
|
||||||
'backup' => $backup,
|
'backup' => $backup,
|
||||||
'access_backup' => $access_backup
|
'access_backups' => $access_backups
|
||||||
];
|
];
|
||||||
$upd_data += $admin_upd_data;
|
$upd_data += $admin_upd_data;
|
||||||
}
|
}
|
||||||
@@ -1492,7 +1492,7 @@ class Customers extends ApiCommand implements ResourceEntity
|
|||||||
`api_allowed` = :api_allowed,
|
`api_allowed` = :api_allowed,
|
||||||
`allowed_mysqlserver` = :allowed_mysqlserver,
|
`allowed_mysqlserver` = :allowed_mysqlserver,
|
||||||
`backup`= :backup,
|
`backup`= :backup,
|
||||||
`access_backup` = :access_backup";
|
`access_backups` = :access_backups";
|
||||||
$upd_query .= $admin_upd_query;
|
$upd_query .= $admin_upd_query;
|
||||||
}
|
}
|
||||||
$upd_query .= " WHERE `customerid` = :customerid";
|
$upd_query .= " WHERE `customerid` = :customerid";
|
||||||
|
|||||||
@@ -315,8 +315,8 @@ return [
|
|||||||
'selected' => Settings::Get('backup.default_storage'),
|
'selected' => Settings::Get('backup.default_storage'),
|
||||||
'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1'
|
'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1'
|
||||||
],
|
],
|
||||||
'access_backup' => [
|
'access_backups' => [
|
||||||
'label' => lng('backup.access_backup'),
|
'label' => lng('backup.access_backups'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'checked' => Settings::Get('backup.enabled') == '1' && Settings::Get('backup.default_customer_access'),
|
'checked' => Settings::Get('backup.enabled') == '1' && Settings::Get('backup.default_customer_access'),
|
||||||
|
|||||||
@@ -323,11 +323,11 @@ return [
|
|||||||
'selected' => $result['backup'],
|
'selected' => $result['backup'],
|
||||||
'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1'
|
'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1'
|
||||||
],
|
],
|
||||||
'access_backup' => [
|
'access_backups' => [
|
||||||
'label' => lng('backup.access_backup'),
|
'label' => lng('backup.access_backups'),
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'checked' => $result['access_backup'],
|
'checked' => $result['access_backups'],
|
||||||
'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '1' || Settings::Get('backup.default_customer_access'))
|
'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '1' || Settings::Get('backup.default_customer_access'))
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -158,9 +158,9 @@ return [
|
|||||||
'callback' => [Backup::class, 'backupStorageLink'],
|
'callback' => [Backup::class, 'backupStorageLink'],
|
||||||
'visible' => (bool)Settings::Get('backup.enabled'),
|
'visible' => (bool)Settings::Get('backup.enabled'),
|
||||||
],
|
],
|
||||||
'c.access_backup' => [
|
'c.access_backups' => [
|
||||||
'label' => lng('backup.access_backup'),
|
'label' => lng('backup.access_backups'),
|
||||||
'field' => 'access_backup',
|
'field' => 'access_backups',
|
||||||
'class' => 'text-center',
|
'class' => 'text-center',
|
||||||
'callback' => [Text::class, 'boolean'],
|
'callback' => [Text::class, 'boolean'],
|
||||||
'visible' => (bool)Settings::Get('backup.enabled'),
|
'visible' => (bool)Settings::Get('backup.enabled'),
|
||||||
|
|||||||
Reference in New Issue
Block a user