diff --git a/admin_customers.php b/admin_customers.php index ae4f434a..05f9656a 100644 --- a/admin_customers.php +++ b/admin_customers.php @@ -235,10 +235,7 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != ' $result_json = BackupStorages::getLocal($userinfo)->listing(); $result_decoded = json_decode($result_json, true)['data']['list']; foreach ($result_decoded as $storagedata) { - $backup_storages[] = [ - 'label' => $storagedata['description'] . '(' . $storagedata['type'] . ')', - 'value' => $storagedata['id'] - ]; + $backup_storages[$storagedata['id']] = $storagedata['description'] . ' (' . $storagedata['type'] . ')'; } } catch (Exception $e) { /* just none */ @@ -337,10 +334,7 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != ' $result_json = BackupStorages::getLocal($userinfo)->listing(); $result_decoded = json_decode($result_json, true)['data']['list']; foreach ($result_decoded as $storagedata) { - $backup_storages[] = [ - 'label' => $storagedata['description'] . '(' . $storagedata['type'] . ')', - 'value' => $storagedata['id'] - ]; + $backup_storages[$storagedata['id']] = $storagedata['description'] . ' (' . $storagedata['type'] . ')'; } } catch (Exception $e) { /* just none */ diff --git a/lib/Froxlor/UI/Callbacks/Backup.php b/lib/Froxlor/UI/Callbacks/Backup.php index 035da2f5..e4b1b217 100644 --- a/lib/Froxlor/UI/Callbacks/Backup.php +++ b/lib/Froxlor/UI/Callbacks/Backup.php @@ -32,7 +32,7 @@ class Backup { public static function backupStorageLink(array $attributes) { - $sel_stmt = Database::prepare("SELECT `description` FROM `" . TABLE_PANEL_BACKUPSTORAGES . "` WHERE `id` = :id"); + $sel_stmt = Database::prepare("SELECT `description` FROM `" . TABLE_PANEL_BACKUP_STORAGES . "` WHERE `id` = :id"); $backupstorage = Database::pexecute_first($sel_stmt, ['id' => $attributes['data']]); if ((int)UI::getCurrentUser()['adminsession'] == 1 && UI::getCurrentUser()['change_serversettings']) { $linker = UI::getLinker(); diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 9afef260..5210307a 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -90,21 +90,6 @@ return [ 'checked' => Settings::Get('api.enabled') == '1' && Settings::Get('api.customer_default'), 'visible' => Settings::Get('api.enabled') == '1' ], - 'backup' => [ - 'label' => lng('backup.backup_storage.title'), - 'desc' => lng('backup.backup_storage.description'), - 'type' => 'select', - 'select_var' => $backup_storages, - 'selected' => Settings::Get('backup.default_storage'), - 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' - ], - 'access_backup' => [ - 'label' => lng('backup.access_backup'), - 'type' => 'checkbox', - 'value' => '1', - 'checked' => Settings::Get('backup.enabled') == '1' && Settings::Get('backup.default_customer_access'), - 'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '1' || Settings::Get('backup.default_customer_access')) - ], ] ], 'section_b' => [ @@ -321,7 +306,22 @@ return [ 'type' => 'checkbox', 'value' => '1', 'checked' => true - ] + ], + 'backup' => [ + 'label' => lng('backup.backup_storage.title'), + 'desc' => lng('backup.backup_storage.description'), + 'type' => 'select', + 'select_var' => $backup_storages, + 'selected' => Settings::Get('backup.default_storage'), + 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' + ], + 'access_backup' => [ + 'label' => lng('backup.access_backup'), + 'type' => 'checkbox', + 'value' => '1', + 'checked' => Settings::Get('backup.enabled') == '1' && Settings::Get('backup.default_customer_access'), + 'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '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 0f95330f..7ef5f62d 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -88,21 +88,6 @@ return [ 'checked' => $result['api_allowed'], 'visible' => Settings::Get('api.enabled') == '1' ], - 'backup' => [ - 'label' => lng('backup.backup_storage.title'), - 'desc' => lng('backup.backup_storage.description'), - 'type' => 'select', - 'select_var' => $backup_storages, - 'selected' => $result['backup'], - 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' - ], - 'access_backup' => [ - 'label' => lng('backup.access_backup'), - 'type' => 'checkbox', - 'value' => '1', - 'checked' => $result['access_backup'], - 'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '1' || Settings::Get('backup.default_customer_access')) - ], ] ], 'section_b' => [ @@ -329,7 +314,22 @@ return [ 'type' => 'checkbox', 'value' => '1', 'checked' => $result['logviewenabled'] - ] + ], + 'backup' => [ + 'label' => lng('backup.backup_storage.title'), + 'desc' => lng('backup.backup_storage.description'), + 'type' => 'select', + 'select_var' => $backup_storages, + 'selected' => $result['backup'], + 'visible' => Settings::Get('backup.enabled') == '1' && $userinfo['change_serversettings'] == '1' + ], + 'access_backup' => [ + 'label' => lng('backup.access_backup'), + 'type' => 'checkbox', + 'value' => '1', + 'checked' => $result['access_backup'], + 'visible' => Settings::Get('backup.enabled') == '1' && ($userinfo['change_serversettings'] == '1' || Settings::Get('backup.default_customer_access')) + ], ] ], 'section_d' => [ diff --git a/lib/tablelisting/admin/tablelisting.customers.php b/lib/tablelisting/admin/tablelisting.customers.php index a3ca05c3..f96b3273 100644 --- a/lib/tablelisting/admin/tablelisting.customers.php +++ b/lib/tablelisting/admin/tablelisting.customers.php @@ -23,6 +23,7 @@ * @license https://files.froxlor.org/misc/COPYING.txt GPLv2 */ +use Froxlor\Settings; use Froxlor\UI\Callbacks\Backup; use Froxlor\UI\Callbacks\Customer; use Froxlor\UI\Callbacks\Impersonate;