mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Security fix: unauthorized access Affects nginx users: Moved php files outside of public html directory (Apache was protected by .htaccess) Affects all users: Some files did not check for authentication and could disclose some info. Better checks before including files from user input * git mv html/includes/ includes/html git mv html/pages/ includes/html/
66 lines
1.6 KiB
PHP
66 lines
1.6 KiB
PHP
<?php
|
|
|
|
require_once('includes/html/application/proxmox.inc.php');
|
|
$graphs['proxmox'] = array(
|
|
'netif'
|
|
);
|
|
|
|
$pmxcl = dbFetchRows("SELECT DISTINCT(`app_instance`) FROM `applications` WHERE `app_type` = ?", array('proxmox'));
|
|
|
|
|
|
print_optionbar_start();
|
|
|
|
echo "<span style='font-weight: bold;'>Proxmox Clusters</span> » ";
|
|
|
|
unset($sep);
|
|
|
|
foreach ($pmxcl as $pmxc) {
|
|
if (isset($sep)) {
|
|
echo $sep;
|
|
};
|
|
|
|
if (var_eq('instance', $pmxc['app_instance']) || (!isset($vars['instance']) && !isset($sep))) {
|
|
echo "<span class='pagemenu-selected'>";
|
|
}
|
|
|
|
echo generate_link(nicecase($pmxc['app_instance']), array('page' => 'apps', 'app' => 'proxmox', 'instance' => $pmxc['app_instance']));
|
|
|
|
if (var_eq('instance', $pmxc['app_instance'])) {
|
|
echo '</span>';
|
|
}
|
|
|
|
$sep = ' | ';
|
|
}
|
|
|
|
print_optionbar_end();
|
|
|
|
$pagetitle[] = 'Proxmox';
|
|
$pagetitle[] = $instance;
|
|
|
|
if (!isset($vars['instance'])) {
|
|
$instance = $pmxcl[0]['app_instance'];
|
|
} else {
|
|
$instance = var_get('instance');
|
|
}
|
|
|
|
if (isset($vars['vmid'])) {
|
|
include("includes/html/pages/apps/proxmox/vm.inc.php");
|
|
$pagetitle[] = $vars['vmid'];
|
|
} else {
|
|
echo '
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="row">';
|
|
foreach (proxmox_cluster_vms($instance) as $pmxvm) {
|
|
echo '
|
|
<div class="col-sm-4 col-md-3 col-lg-2">'.generate_link($pmxvm['vmid']." (".$pmxvm['description'].")", array('page' => 'apps', 'app' => 'proxmox', 'instance' => $instance, 'vmid' => $pmxvm['vmid'])).'</div>';
|
|
}
|
|
echo '
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
';
|
|
}
|