#10076 attachments-plugins access

This commit is contained in:
Jonathan 2023-01-23 11:07:34 +01:00
parent 1d61ef11e7
commit c380a588ea
1 changed files with 108 additions and 8 deletions

View File

@ -225,14 +225,69 @@ if ($filemanager) {
$directory = (string) get_parameter('directory');
if (empty($directory) === true) {
$directory = $fallback_directory;
$base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin';
$setup_url = $base_url.'&filemanager=1&tab=Attachments';
$tab = get_parameter('tab', null);
$tabs = [
'list' => [
'text' => '<a href="'.$base_url.'">'.html_print_image(
'images/eye_show.png',
true,
[
'title' => __('Plugins'),
'class' => 'invert_filter',
]
).'</a>',
'active' => (bool) ($tab != 'Attachments'),
],
'options' => [
'text' => '<a href="'.$setup_url.'">'.html_print_image(
'images/setup.png',
true,
[
'title' => __('Attachments'),
'class' => 'invert_filter',
]
).'</a>',
'active' => (bool) ($tab == 'Attachments'),
],
];
if ($tab === 'Attachments') {
$helpHeader = '';
$titleHeader = __('Index of attachment/plugin');
} else {
$helpHeader = 'servers_ha_clusters_tab';
$titleHeader = __('Plug-ins registered on %s', get_product_name());
}
// Header.
ui_print_standard_header(
$titleHeader,
'images/gm_servers.png',
false,
$helpHeader,
false,
$tabs,
[
[
'link' => '',
'label' => __('Servers'),
],
[
'link' => '&filemanager=1',
'label' => __('Plugins'),
],
]
);
} else {
$directory = str_replace('\\', '/', $directory);
$directory = filemanager_safe_directory($directory, $fallback_directory);
echo '<h4>'.__('Index of %s', $directory).'</h4>';
}
$real_directory = realpath($config['homedir'].'/'.$directory);
echo '<h4>'.__('Index of %s', $directory).'</h4>';
$chunck_url = '&view='.$id_plugin;
if ($id_plugin == 0) {
@ -597,15 +652,60 @@ if (($create != '') || ($view != '')) {
);
}
} else {
ui_print_page_header(
__(
'Plug-ins registered on %s',
get_product_name()
),
$base_url = 'index.php?sec=gservers&sec2=godmode/servers/plugin';
$setup_url = $base_url.'&filemanager=1&tab=Attachments';
$tab = get_parameter('tab', null);
$tabs = [
'list' => [
'text' => '<a href="'.$base_url.'">'.html_print_image(
'images/eye_show.png',
true,
[
'title' => __('Plugins'),
'class' => 'invert_filter',
]
).'</a>',
'active' => (bool) ($tab != 'Attachments'),
],
'options' => [
'text' => '<a href="'.$setup_url.'">'.html_print_image(
'images/setup.png',
true,
[
'title' => __('Attachments'),
'class' => 'invert_filter',
]
).'</a>',
'active' => (bool) ($tab == 'Attachments'),
],
];
if ($tab === 'Attachments') {
$helpHeader = '';
$titleHeader = __('Index of attachment/plugin');
} else {
$helpHeader = 'servers_ha_clusters_tab';
$titleHeader = __('Plug-ins registered on %s', get_product_name());
}
// Header.
ui_print_standard_header(
$titleHeader,
'images/gm_servers.png',
false,
'',
true
$helpHeader,
false,
$tabs,
[
[
'link' => '',
'label' => __('Servers'),
],
[
'link' => '&filemanager=1',
'label' => __('Plugins'),
],
]
);
$management_allowed = is_management_allowed();