minor fixes in customer-backup-flags integration
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -235,10 +235,7 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != '
|
|||||||
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
||||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||||
foreach ($result_decoded as $storagedata) {
|
foreach ($result_decoded as $storagedata) {
|
||||||
$backup_storages[] = [
|
$backup_storages[$storagedata['id']] = $storagedata['description'] . ' (' . $storagedata['type'] . ')';
|
||||||
'label' => $storagedata['description'] . '(' . $storagedata['type'] . ')',
|
|
||||||
'value' => $storagedata['id']
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* just none */
|
/* just none */
|
||||||
@@ -337,10 +334,7 @@ if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != '
|
|||||||
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
$result_json = BackupStorages::getLocal($userinfo)->listing();
|
||||||
$result_decoded = json_decode($result_json, true)['data']['list'];
|
$result_decoded = json_decode($result_json, true)['data']['list'];
|
||||||
foreach ($result_decoded as $storagedata) {
|
foreach ($result_decoded as $storagedata) {
|
||||||
$backup_storages[] = [
|
$backup_storages[$storagedata['id']] = $storagedata['description'] . ' (' . $storagedata['type'] . ')';
|
||||||
'label' => $storagedata['description'] . '(' . $storagedata['type'] . ')',
|
|
||||||
'value' => $storagedata['id']
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
/* just none */
|
/* just none */
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Backup
|
|||||||
{
|
{
|
||||||
public static function backupStorageLink(array $attributes)
|
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']]);
|
$backupstorage = Database::pexecute_first($sel_stmt, ['id' => $attributes['data']]);
|
||||||
if ((int)UI::getCurrentUser()['adminsession'] == 1 && UI::getCurrentUser()['change_serversettings']) {
|
if ((int)UI::getCurrentUser()['adminsession'] == 1 && UI::getCurrentUser()['change_serversettings']) {
|
||||||
$linker = UI::getLinker();
|
$linker = UI::getLinker();
|
||||||
|
|||||||
@@ -90,21 +90,6 @@ return [
|
|||||||
'checked' => Settings::Get('api.enabled') == '1' && Settings::Get('api.customer_default'),
|
'checked' => Settings::Get('api.enabled') == '1' && Settings::Get('api.customer_default'),
|
||||||
'visible' => Settings::Get('api.enabled') == '1'
|
'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' => [
|
'section_b' => [
|
||||||
@@ -321,7 +306,22 @@ return [
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'checked' => true
|
'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'))
|
||||||
|
],
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -88,21 +88,6 @@ return [
|
|||||||
'checked' => $result['api_allowed'],
|
'checked' => $result['api_allowed'],
|
||||||
'visible' => Settings::Get('api.enabled') == '1'
|
'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' => [
|
'section_b' => [
|
||||||
@@ -329,7 +314,22 @@ return [
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'checked' => $result['logviewenabled']
|
'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' => [
|
'section_d' => [
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Froxlor\Settings;
|
||||||
use Froxlor\UI\Callbacks\Backup;
|
use Froxlor\UI\Callbacks\Backup;
|
||||||
use Froxlor\UI\Callbacks\Customer;
|
use Froxlor\UI\Callbacks\Customer;
|
||||||
use Froxlor\UI\Callbacks\Impersonate;
|
use Froxlor\UI\Callbacks\Impersonate;
|
||||||
|
|||||||
Reference in New Issue
Block a user