From c668c180d5ab91ed81cba662756144bf21c8168e Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Wed, 7 Jun 2023 21:14:01 +0200 Subject: [PATCH] fix access_backup*s* paramter name Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/Customers.php | 20 +++++++++---------- .../admin/customer/formfield.customer_add.php | 4 ++-- .../customer/formfield.customer_edit.php | 6 +++--- .../admin/tablelisting.customers.php | 6 +++--- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/Froxlor/Api/Commands/Customers.php b/lib/Froxlor/Api/Commands/Customers.php index 20105077..d299b462 100644 --- a/lib/Froxlor/Api/Commands/Customers.php +++ b/lib/Froxlor/Api/Commands/Customers.php @@ -278,7 +278,7 @@ class Customers extends ApiCommand implements ResourceEntity * optional, either 0 to disable backup for this customer or a backup-storage-id * where backups are to be stored, requires change_serversettings permissions, * 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 * default_customer_access * @@ -379,10 +379,10 @@ class Customers extends ApiCommand implements ResourceEntity $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 { $backup = Settings::Get('backup.default_storage'); - $access_backup = Settings::Get('backup.default_customer_access'); + $access_backups = Settings::Get('backup.default_customer_access'); } // validation @@ -561,7 +561,7 @@ class Customers extends ApiCommand implements ResourceEntity 'custom_notes_show' => $custom_notes_show, 'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver), 'backup' => $backup, - 'access_backup' => $access_backup + 'access_backups' => $access_backups ]; $ins_stmt = Database::prepare(" @@ -606,7 +606,7 @@ class Customers extends ApiCommand implements ResourceEntity `custom_notes_show` = :custom_notes_show, `allowed_mysqlserver`= :allowed_mysqlserver, `backup` = :backup, - `access_backup` = :access_backup + `access_backups` = :access_backups "); 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 * where backups are to be stored, requires change_serversettings permissions, * 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 * default_customer_access * @@ -1135,10 +1135,10 @@ class Customers extends ApiCommand implements ResourceEntity $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 { $backup = $result['backup']; - $access_backup = $result['access_backup']; + $access_backups = $result['access_backups']; } } else { // allowed parameters @@ -1447,7 +1447,7 @@ class Customers extends ApiCommand implements ResourceEntity 'api_allowed' => $api_allowed, 'allowed_mysqlserver' => empty($allowed_mysqlserver) ? "" : json_encode($allowed_mysqlserver), 'backup' => $backup, - 'access_backup' => $access_backup + 'access_backups' => $access_backups ]; $upd_data += $admin_upd_data; } @@ -1492,7 +1492,7 @@ class Customers extends ApiCommand implements ResourceEntity `api_allowed` = :api_allowed, `allowed_mysqlserver` = :allowed_mysqlserver, `backup`= :backup, - `access_backup` = :access_backup"; + `access_backups` = :access_backups"; $upd_query .= $admin_upd_query; } $upd_query .= " WHERE `customerid` = :customerid"; diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 5210307a..8df804c4 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -315,8 +315,8 @@ return [ 'selected' => Settings::Get('backup.default_storage'), 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' ], - 'access_backup' => [ - 'label' => lng('backup.access_backup'), + 'access_backups' => [ + 'label' => lng('backup.access_backups'), 'type' => 'checkbox', 'value' => '1', 'checked' => Settings::Get('backup.enabled') == '1' && Settings::Get('backup.default_customer_access'), diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 7ef5f62d..92f3d88f 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -323,11 +323,11 @@ return [ 'selected' => $result['backup'], 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' ], - 'access_backup' => [ - 'label' => lng('backup.access_backup'), + 'access_backups' => [ + 'label' => lng('backup.access_backups'), 'type' => 'checkbox', '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')) ], ] diff --git a/lib/tablelisting/admin/tablelisting.customers.php b/lib/tablelisting/admin/tablelisting.customers.php index f96b3273..847b12f2 100644 --- a/lib/tablelisting/admin/tablelisting.customers.php +++ b/lib/tablelisting/admin/tablelisting.customers.php @@ -158,9 +158,9 @@ return [ 'callback' => [Backup::class, 'backupStorageLink'], 'visible' => (bool)Settings::Get('backup.enabled'), ], - 'c.access_backup' => [ - 'label' => lng('backup.access_backup'), - 'field' => 'access_backup', + 'c.access_backups' => [ + 'label' => lng('backup.access_backups'), + 'field' => 'access_backups', 'class' => 'text-center', 'callback' => [Text::class, 'boolean'], 'visible' => (bool)Settings::Get('backup.enabled'),