Merge remote-tracking branch 'origin/develop' into ent-7074-Command-Center
This commit is contained in:
commit
90af8824de
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.752-210302
|
||||
Version: 7.0NG.752-210304
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210302"
|
||||
pandora_version="7.0NG.752-210304"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1016,7 +1016,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.752';
|
||||
use constant AGENT_BUILD => '210302';
|
||||
use constant AGENT_BUILD => '210304';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210302"
|
||||
PI_BUILD="210304"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{210302}
|
||||
{210304}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210302)")
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210304)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.752(Build 210302))"
|
||||
VALUE "ProductVersion", "(7.0NG.752(Build 210304))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.752-210302
|
||||
Version: 7.0NG.752-210304
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210302"
|
||||
pandora_version="7.0NG.752-210304"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -251,7 +251,16 @@ if (is_ajax()) {
|
|||
|
||||
$tab = (string) get_parameter('tab', 'groups');
|
||||
|
||||
if ($tab != 'credbox' && ! check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ($tab != 'credbox' && ! check_acl(
|
||||
$config['id_user'],
|
||||
0,
|
||||
'PM'
|
||||
) && ! check_acl(
|
||||
$config['id_user'],
|
||||
0,
|
||||
'AW'
|
||||
)
|
||||
) {
|
||||
db_pandora_audit(
|
||||
'ACL Violation',
|
||||
'Trying to access Group Management'
|
||||
|
|
|
@ -1176,7 +1176,11 @@ if ($config['double_auth_enabled'] && check_acl($config['id_user'], 0, 'PM')) {
|
|||
|| ($config['double_auth_enabled'] == '' && $double_auth_enabled)
|
||||
|| check_acl($config['id_user'], 0, 'PM')
|
||||
) {
|
||||
$double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true);
|
||||
if ($new_user === false) {
|
||||
$double_authentication .= html_print_checkbox_switch('double_auth', 1, $double_auth_enabled, true);
|
||||
} else {
|
||||
$double_authentication .= ui_print_help_tip(__('User must be created before activating double authentication.'), true);
|
||||
}
|
||||
}
|
||||
|
||||
// Dialog.
|
||||
|
@ -1582,6 +1586,7 @@ console.log(userID);
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: userID,
|
||||
id_user_auth: userID,
|
||||
get_double_auth_data_page: 1,
|
||||
FA_forced: 1,
|
||||
containerID: $dialogContainer.prop('id')
|
||||
|
@ -1638,6 +1643,8 @@ function show_double_auth_activation () {
|
|||
|
||||
var $loadingSpinner = $("<img src=\"<?php echo $config['homeurl']; ?>/images/spinner.gif\" />");
|
||||
var $dialogContainer = $("div#dialog-double_auth-container");
|
||||
// Uncheck until completed successfully.
|
||||
$("input#checkbox-double_auth").prop( "checked", false );
|
||||
|
||||
$dialogContainer.html($loadingSpinner);
|
||||
|
||||
|
@ -1649,6 +1656,7 @@ function show_double_auth_activation () {
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: userID,
|
||||
id_user_auth: userID,
|
||||
FA_forced: 1,
|
||||
get_double_auth_info_page: 1,
|
||||
containerID: $dialogContainer.prop('id')
|
||||
|
@ -1691,8 +1699,6 @@ function show_double_auth_activation () {
|
|||
request.abort();
|
||||
// Remove the contained html
|
||||
$dialogContainer.empty();
|
||||
|
||||
document.location.reload();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
|
@ -1706,6 +1712,9 @@ function show_double_auth_deactivation () {
|
|||
|
||||
var message = "<p><?php echo __('Are you sure?').'<br>'.__('The double authentication will be deactivated'); ?></p>";
|
||||
var $button = $("<input type=\"button\" value=\"<?php echo __('Deactivate'); ?>\" />");
|
||||
// Prevent switch deactivaction until proceess is done
|
||||
$("input#checkbox-double_auth").prop( "checked", true );
|
||||
|
||||
|
||||
$dialogContainer
|
||||
.empty()
|
||||
|
@ -1740,6 +1749,7 @@ function show_double_auth_deactivation () {
|
|||
}
|
||||
else if (data) {
|
||||
$dialogContainer.html("<?php echo '<b><div class=\"green\">'.__('The double autentication was deactivated successfully').'</div></b>'; ?>");
|
||||
$("input#checkbox-double_auth").prop( "checked", false );
|
||||
}
|
||||
else {
|
||||
$dialogContainer.html("<?php echo '<b><div class=\"red\">'.__('There was an error deactivating the double autentication').'</div></b>'; ?>");
|
||||
|
@ -1770,7 +1780,6 @@ function show_double_auth_deactivation () {
|
|||
// Remove the contained html
|
||||
$dialogContainer.empty();
|
||||
|
||||
document.location.reload();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
|
|
|
@ -18,6 +18,8 @@ check_login();
|
|||
// Security check
|
||||
$id_user = (string) get_parameter('id_user');
|
||||
$FA_forced = (int) get_parameter('FA_forced');
|
||||
$id_user_auth = (string) get_parameter('id_user_auth', $config['id_user']);
|
||||
|
||||
|
||||
if ($id_user !== $config['id_user'] && $FA_forced != 1) {
|
||||
db_pandora_audit(
|
||||
|
@ -70,12 +72,12 @@ if ($validate_double_auth_code) {
|
|||
|
||||
if ($result && $save) {
|
||||
// Delete the actual value (if exists)
|
||||
$where = ['id_user' => $id_user];
|
||||
$where = ['id_user' => $id_user_auth];
|
||||
db_process_sql_delete('tuser_double_auth', $where);
|
||||
|
||||
// Insert the new value
|
||||
$values = [
|
||||
'id_user' => $id_user,
|
||||
'id_user' => $id_user_auth,
|
||||
'secret' => $secret,
|
||||
];
|
||||
$result = (bool) db_process_sql_insert('tuser_double_auth', $values);
|
||||
|
@ -152,12 +154,15 @@ if ($get_double_auth_data_page) {
|
|||
|
||||
ob_clean();
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="../../include/javascript/qrcode.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var secret = "<?php echo $secret; ?>";
|
||||
var userID = "<?php echo $config['id_user']; ?>";
|
||||
var id_user_auth = "<?php echo $id_user_auth; ?>";
|
||||
|
||||
// QR code with the secret to add it to the app
|
||||
paint_qrcode("otpauth://totp/"+userID+"?secret="+secret, $("div#qr-container").get(0), 200, 200);
|
||||
paint_qrcode("otpauth://totp/"+id_user_auth+"?secret="+secret, $("div#qr-container").get(0), 200, 200);
|
||||
|
||||
$("div#qr-container").attr("title", "").find("canvas").remove();
|
||||
// Don't delete this timeout. It's necessary to perform the style change.
|
||||
|
@ -219,6 +224,7 @@ if ($get_double_auth_info_page) {
|
|||
}
|
||||
|
||||
var containerID = "<?php echo $container_id; ?>";
|
||||
var id_user_auth = "<?php echo $id_user_auth; ?>";
|
||||
|
||||
$("#"+containerID).html("<img src=\"<?php echo $config['homeurl']; ?>/images/spinner.gif\" />");
|
||||
|
||||
|
@ -229,6 +235,7 @@ if ($get_double_auth_info_page) {
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: "<?php echo $config['id_user']; ?>",
|
||||
id_user_auth: id_user_auth,
|
||||
get_double_auth_generation_page: 1,
|
||||
containerID: containerID
|
||||
},
|
||||
|
@ -298,10 +305,10 @@ if ($get_double_auth_generation_page) {
|
|||
<script type="text/javascript" src="../../include/javascript/qrcode.js"></script>
|
||||
<script type="text/javascript">
|
||||
var secret = "<?php echo $secret; ?>";
|
||||
var userID = "<?php echo $config['id_user']; ?>";
|
||||
var id_user_auth = "<?php echo $id_user_auth; ?>";
|
||||
|
||||
// QR code with the secret to add it to the app
|
||||
paint_qrcode("otpauth://totp/"+userID+"?secret="+secret, $("div#qr-container").get(0), 200, 200);
|
||||
paint_qrcode("otpauth://totp/"+id_user_auth+"?secret="+secret, $("div#qr-container").get(0), 200, 200);
|
||||
|
||||
$("div#qr-container").attr("title", "").find("canvas").remove();
|
||||
// Don't delete this timeout. It's necessary to perform the style change.
|
||||
|
@ -325,7 +332,8 @@ if ($get_double_auth_generation_page) {
|
|||
dataType: 'html',
|
||||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: userID,
|
||||
id_user: "<?php echo $config['id_user']; ?>",
|
||||
id_user_auth, id_user_auth,
|
||||
get_double_auth_generation_page: 1,
|
||||
containerID: containerID
|
||||
},
|
||||
|
@ -370,6 +378,7 @@ if ($get_double_auth_generation_page) {
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: "<?php echo $config['id_user']; ?>",
|
||||
id_user_auth: id_user_auth,
|
||||
get_double_auth_validation_page: 1,
|
||||
secret: secret,
|
||||
containerID: containerID
|
||||
|
@ -464,6 +473,7 @@ if ($get_double_auth_validation_page) {
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: "<?php echo $config['id_user']; ?>",
|
||||
id_user_auth: id_user_auth,
|
||||
validate_double_auth_code: 1,
|
||||
save: 1,
|
||||
secret: secret,
|
||||
|
@ -479,6 +489,7 @@ if ($get_double_auth_validation_page) {
|
|||
// Valid code
|
||||
if (data === true) {
|
||||
$("#"+containerID).html("<b><?php echo '<b><div class=\"green\">'.__('The code is valid, you can exit now').'</div></b>'; ?></b>");
|
||||
$("input#checkbox-double_auth").prop( "checked", true );
|
||||
}
|
||||
// Invalid code
|
||||
else if (data === false) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC210302';
|
||||
$build_version = 'PC210304';
|
||||
$pandora_version = 'v7.0NG.752';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -595,178 +595,187 @@ function filemanager_file_explorer(
|
|||
|
||||
$files = filemanager_list_dir($real_directory);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->id = 'table_filemanager';
|
||||
if (!defined('METACONSOLE')) {
|
||||
$table->class = 'info_table';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
}
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->class = 'databox_tactical';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
}
|
||||
|
||||
$table->colspan = [];
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->size = [];
|
||||
|
||||
$table->align[1] = 'left';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$table->align[4] = 'left';
|
||||
|
||||
$table->size[0] = '24px';
|
||||
|
||||
$table->head[0] = '';
|
||||
$table->head[1] = __('Name');
|
||||
$table->head[2] = __('Last modification');
|
||||
$table->head[3] = __('Size');
|
||||
$table->head[4] = __('Actions');
|
||||
|
||||
$prev_dir = explode('/', $relative_directory);
|
||||
$prev_dir_str = '';
|
||||
for ($i = 0; $i < (count($prev_dir) - 1); $i++) {
|
||||
$prev_dir_str .= $prev_dir[$i];
|
||||
if ($i < (count($prev_dir) - 2)) {
|
||||
$prev_dir_str .= '/';
|
||||
if (!empty($files)) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->id = 'table_filemanager';
|
||||
if (!defined('METACONSOLE')) {
|
||||
$table->class = 'info_table';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
if (($prev_dir_str != '') && ($father != $relative_directory)) {
|
||||
$table->data[0][0] = html_print_image('images/go_previous.png', true);
|
||||
$table->data[0][1] = '<a href="'.$url.'&directory='.$prev_dir_str.'&hash2='.md5($prev_dir_str.$config['dbpass']).'">';
|
||||
$table->data[0][1] .= __('Parent directory');
|
||||
$table->data[0][1] .= '</a>';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->class = 'databox_tactical';
|
||||
$table->title = '<span>'.__('Index of %s', $relative_directory).'</span>';
|
||||
}
|
||||
|
||||
$table->colspan[0][1] = 5;
|
||||
}
|
||||
$table->colspan = [];
|
||||
$table->data = [];
|
||||
$table->head = [];
|
||||
$table->size = [];
|
||||
|
||||
foreach ($files as $fileinfo) {
|
||||
$fileinfo['realpath'] = str_replace('\\', '/', $fileinfo['realpath']);
|
||||
$relative_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', $fileinfo['realpath']);
|
||||
$table->align[1] = 'left';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$table->align[4] = 'left';
|
||||
|
||||
$data = [];
|
||||
$table->size[0] = '24px';
|
||||
|
||||
switch ($fileinfo['mime']) {
|
||||
case MIME_DIR:
|
||||
$data[0] = html_print_image('images/mimetypes/directory.png', true, ['title' => __('Directory')]);
|
||||
break;
|
||||
$table->head[0] = '';
|
||||
$table->head[1] = __('Name');
|
||||
$table->head[2] = __('Last modification');
|
||||
$table->head[3] = __('Size');
|
||||
$table->head[4] = __('Actions');
|
||||
|
||||
case MIME_IMAGE:
|
||||
$data[0] = html_print_image('images/mimetypes/image.png', true, ['title' => __('Image')]);
|
||||
break;
|
||||
$prev_dir = explode('/', $relative_directory);
|
||||
$prev_dir_str = '';
|
||||
for ($i = 0; $i < (count($prev_dir) - 1); $i++) {
|
||||
$prev_dir_str .= $prev_dir[$i];
|
||||
if ($i < (count($prev_dir) - 2)) {
|
||||
$prev_dir_str .= '/';
|
||||
}
|
||||
}
|
||||
|
||||
case MIME_ZIP:
|
||||
$data[0] = html_print_image('images/mimetypes/zip.png', true, ['title' => __('Compressed file')]);
|
||||
break;
|
||||
if (($prev_dir_str != '') && ($father != $relative_directory)) {
|
||||
$table->data[0][0] = html_print_image('images/go_previous.png', true);
|
||||
$table->data[0][1] = '<a href="'.$url.'&directory='.$prev_dir_str.'&hash2='.md5($prev_dir_str.$config['dbpass']).'">';
|
||||
$table->data[0][1] .= __('Parent directory');
|
||||
$table->data[0][1] .= '</a>';
|
||||
|
||||
case MIME_TEXT:
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
break;
|
||||
$table->colspan[0][1] = 5;
|
||||
}
|
||||
|
||||
case MIME_UNKNOWN:
|
||||
if ($fileinfo['size'] == 0) {
|
||||
if ((strstr($fileinfo['name'], '.txt') !== false) || (strstr($fileinfo['name'], '.conf') !== false) || (strstr($fileinfo['name'], '.sql') !== false) || (strstr($fileinfo['name'], '.pl') !== false)) {
|
||||
$fileinfo['mime'] = MIME_TEXT;
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
foreach ($files as $fileinfo) {
|
||||
$fileinfo['realpath'] = str_replace('\\', '/', $fileinfo['realpath']);
|
||||
$relative_path = str_replace($_SERVER['DOCUMENT_ROOT'], '', $fileinfo['realpath']);
|
||||
|
||||
$data = [];
|
||||
|
||||
switch ($fileinfo['mime']) {
|
||||
case MIME_DIR:
|
||||
$data[0] = html_print_image('images/mimetypes/directory.png', true, ['title' => __('Directory')]);
|
||||
break;
|
||||
|
||||
case MIME_IMAGE:
|
||||
$data[0] = html_print_image('images/mimetypes/image.png', true, ['title' => __('Image')]);
|
||||
break;
|
||||
|
||||
case MIME_ZIP:
|
||||
$data[0] = html_print_image('images/mimetypes/zip.png', true, ['title' => __('Compressed file')]);
|
||||
break;
|
||||
|
||||
case MIME_TEXT:
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
break;
|
||||
|
||||
case MIME_UNKNOWN:
|
||||
if ($fileinfo['size'] == 0) {
|
||||
if ((strstr($fileinfo['name'], '.txt') !== false) || (strstr($fileinfo['name'], '.conf') !== false) || (strstr($fileinfo['name'], '.sql') !== false) || (strstr($fileinfo['name'], '.pl') !== false)) {
|
||||
$fileinfo['mime'] = MIME_TEXT;
|
||||
$data[0] = html_print_image('images/mimetypes/text.png', true, ['title' => __('Text file')]);
|
||||
} else {
|
||||
// unknow
|
||||
$data[0] = '';
|
||||
}
|
||||
} else {
|
||||
// unknow
|
||||
// pdf
|
||||
$data[0] = '';
|
||||
}
|
||||
} else {
|
||||
// pdf
|
||||
$data[0] = '';
|
||||
break;
|
||||
|
||||
default:
|
||||
$data[0] = html_print_image('images/mimetypes/unknown.png', true, ['title' => __('Unknown')]);
|
||||
break;
|
||||
}
|
||||
|
||||
if ($fileinfo['is_dir']) {
|
||||
$data[1] = '<a href="'.$url.'&directory='.$relative_directory.'/'.$fileinfo['name'].'&hash2='.md5($relative_directory.'/'.$fileinfo['name'].$config['dbpass']).'">'.$fileinfo['name'].'</a>';
|
||||
} else if (!empty($url_file)) {
|
||||
// Set the custom url file
|
||||
$url_file_clean = str_replace('[FILE_FULLPATH]', $fileinfo['realpath'], $url_file);
|
||||
|
||||
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
|
||||
} else {
|
||||
$filename = base64_encode($relative_directory.'/'.$fileinfo['name']);
|
||||
$hash = md5($filename.$config['dbpass']);
|
||||
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
|
||||
}
|
||||
|
||||
// Notice that uploaded php files could be dangerous
|
||||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) == 'php'
|
||||
&& (is_readable($fileinfo['realpath']) || is_executable($fileinfo['realpath']))
|
||||
) {
|
||||
$error_message = __('This file could be executed by any user');
|
||||
$error_message .= '. '.__('Make sure it can\'t perform dangerous tasks');
|
||||
$data[1] = '<span class="error forced_title" data-title="'.$error_message.'" data-use_title_for_force_title="1">'.$data[1].'</span>';
|
||||
}
|
||||
|
||||
$data[2] = ui_print_timestamp(
|
||||
$fileinfo['last_modified'],
|
||||
true,
|
||||
['prominent' => true]
|
||||
);
|
||||
if ($fileinfo['is_dir']) {
|
||||
$data[3] = '';
|
||||
} else {
|
||||
$data[3] = ui_format_filesize($fileinfo['size']);
|
||||
}
|
||||
|
||||
// Actions buttons
|
||||
// Delete button
|
||||
$data[4] = '';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||
if (is_writable($fileinfo['realpath'])
|
||||
&& (! is_dir($fileinfo['realpath']) || count(scandir($fileinfo['realpath'])) < 3) && (!$readOnly)
|
||||
) {
|
||||
$data[4] .= '<form method="post" action="'.$url.'" style="">';
|
||||
$data[4] .= '<input type="image" src="images/cross.png" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
|
||||
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['dbpass']), true);
|
||||
$data[4] .= html_print_input_hidden('delete_file', 1, true);
|
||||
|
||||
$relative_dir = str_replace($homedir_filemanager, '', str_replace('\\', '/', dirname($fileinfo['realpath'])));
|
||||
|
||||
if ($relative_dir[0] == '/') {
|
||||
$relative_dir = substr($relative_dir, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$data[0] = html_print_image('images/mimetypes/unknown.png', true, ['title' => __('Unknown')]);
|
||||
break;
|
||||
$hash2 = md5($relative_dir.$config['dbpass']);
|
||||
|
||||
$data[4] .= html_print_input_hidden('directory', $relative_dir, true);
|
||||
$data[4] .= html_print_input_hidden('hash2', $hash2, true);
|
||||
$data[4] .= '</form>';
|
||||
|
||||
if (($editor) && (!$readOnly)) {
|
||||
if (($typefile != 'bin') && ($typefile != 'pdf') && ($typefile != 'png') && ($typefile != 'jpg')
|
||||
&& ($typefile != 'iso') && ($typefile != 'docx') && ($typefile != 'doc') && ($fileinfo['mime'] != MIME_DIR)
|
||||
) {
|
||||
$hash = md5($fileinfo['realpath'].$config['dbpass']);
|
||||
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file')]).'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((!$fileinfo['is_dir']) && ($download_button)) {
|
||||
$filename = base64_encode($fileinfo['name']);
|
||||
$hash = md5($filename.$config['dbpass']);
|
||||
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
|
||||
$data[4] .= html_print_image('images/file.png', true);
|
||||
$data[4] .= '</a>';
|
||||
}
|
||||
|
||||
$data[4] .= '</span>';
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if ($fileinfo['is_dir']) {
|
||||
$data[1] = '<a href="'.$url.'&directory='.$relative_directory.'/'.$fileinfo['name'].'&hash2='.md5($relative_directory.'/'.$fileinfo['name'].$config['dbpass']).'">'.$fileinfo['name'].'</a>';
|
||||
} else if (!empty($url_file)) {
|
||||
// Set the custom url file
|
||||
$url_file_clean = str_replace('[FILE_FULLPATH]', $fileinfo['realpath'], $url_file);
|
||||
|
||||
$data[1] = '<a href="'.$url_file_clean.'">'.$fileinfo['name'].'</a>';
|
||||
} else {
|
||||
$filename = base64_encode($relative_directory.'/'.$fileinfo['name']);
|
||||
$hash = md5($filename.$config['dbpass']);
|
||||
$data[1] = '<a href="'.$hack_metaconsole.'include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'">'.$fileinfo['name'].'</a>';
|
||||
}
|
||||
|
||||
// Notice that uploaded php files could be dangerous
|
||||
if (pathinfo($fileinfo['realpath'], PATHINFO_EXTENSION) == 'php'
|
||||
&& (is_readable($fileinfo['realpath']) || is_executable($fileinfo['realpath']))
|
||||
) {
|
||||
$error_message = __('This file could be executed by any user');
|
||||
$error_message .= '. '.__('Make sure it can\'t perform dangerous tasks');
|
||||
$data[1] = '<span class="error forced_title" data-title="'.$error_message.'" data-use_title_for_force_title="1">'.$data[1].'</span>';
|
||||
}
|
||||
|
||||
$data[2] = ui_print_timestamp(
|
||||
$fileinfo['last_modified'],
|
||||
true,
|
||||
['prominent' => true]
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('No files or directories to show.'),
|
||||
]
|
||||
);
|
||||
if ($fileinfo['is_dir']) {
|
||||
$data[3] = '';
|
||||
} else {
|
||||
$data[3] = ui_format_filesize($fileinfo['size']);
|
||||
}
|
||||
|
||||
// Actions buttons
|
||||
// Delete button
|
||||
$data[4] = '';
|
||||
$data[4] .= '<span style="display: flex">';
|
||||
$typefile = array_pop(explode('.', $fileinfo['name']));
|
||||
if (is_writable($fileinfo['realpath'])
|
||||
&& (! is_dir($fileinfo['realpath']) || count(scandir($fileinfo['realpath'])) < 3) && (!$readOnly)
|
||||
) {
|
||||
$data[4] .= '<form method="post" action="'.$url.'" style="">';
|
||||
$data[4] .= '<input type="image" src="images/cross.png" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
$data[4] .= html_print_input_hidden('filename', $fileinfo['realpath'], true);
|
||||
$data[4] .= html_print_input_hidden('hash', md5($fileinfo['realpath'].$config['dbpass']), true);
|
||||
$data[4] .= html_print_input_hidden('delete_file', 1, true);
|
||||
|
||||
$relative_dir = str_replace($homedir_filemanager, '', str_replace('\\', '/', dirname($fileinfo['realpath'])));
|
||||
|
||||
if ($relative_dir[0] == '/') {
|
||||
$relative_dir = substr($relative_dir, 1);
|
||||
}
|
||||
|
||||
$hash2 = md5($relative_dir.$config['dbpass']);
|
||||
|
||||
$data[4] .= html_print_input_hidden('directory', $relative_dir, true);
|
||||
$data[4] .= html_print_input_hidden('hash2', $hash2, true);
|
||||
$data[4] .= '</form>';
|
||||
|
||||
if (($editor) && (!$readOnly)) {
|
||||
if (($typefile != 'bin') && ($typefile != 'pdf') && ($typefile != 'png') && ($typefile != 'jpg')
|
||||
&& ($typefile != 'iso') && ($typefile != 'docx') && ($typefile != 'doc') && ($fileinfo['mime'] != MIME_DIR)
|
||||
) {
|
||||
$hash = md5($fileinfo['realpath'].$config['dbpass']);
|
||||
$data[4] .= "<a style='vertical-align: top;' href='$url&edit_file=1&hash=".$hash.'&location_file='.$fileinfo['realpath']."' style='float: left;'>".html_print_image('images/edit.png', true, ['style' => 'margin-top: 2px;', 'title' => __('Edit file')]).'</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((!$fileinfo['is_dir']) && ($download_button)) {
|
||||
$filename = base64_encode($fileinfo['name']);
|
||||
$hash = md5($filename.$config['dbpass']);
|
||||
$data[4] .= '<a href="include/get_file.php?file='.urlencode($filename).'&hash='.$hash.'" style="vertical-align: 25%;">';
|
||||
$data[4] .= html_print_image('images/file.png', true);
|
||||
$data[4] .= '</a>';
|
||||
}
|
||||
|
||||
$data[4] .= '</span>';
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if (!$readOnly) {
|
||||
|
|
|
@ -497,11 +497,7 @@ function messages_get_overview(
|
|||
if ($incl_source_info) {
|
||||
$source_fields = ', tns.*';
|
||||
$source_join = 'INNER JOIN tnotification_source tns
|
||||
ON tns.id=tm.id_source
|
||||
INNER JOIN tnotification_source_user nsu
|
||||
ON nsu.id_source=tns.id
|
||||
AND nsu.enabled = 1
|
||||
OR tns.enabled = 1';
|
||||
ON tns.id=tm.id_source';
|
||||
}
|
||||
|
||||
// Using distinct because could be double assignment due group/user.
|
||||
|
|
|
@ -70,8 +70,7 @@ function initialiceLayout(data) {
|
|||
draggable: false
|
||||
});
|
||||
|
||||
var positionGrid = 0; //grid[0].getBoundingClientRect();
|
||||
// var gridHeight = positionGrid.height;
|
||||
var positionGrid = grid.el.getBoundingClientRect();
|
||||
var gridWidth = positionGrid.width;
|
||||
|
||||
getCellsLayout();
|
||||
|
|
|
@ -571,9 +571,9 @@ class Widget
|
|||
}
|
||||
|
||||
if ($this->width === 0) {
|
||||
$width = (((int) $this->position['width'] / 12 * $gridWidth) - 50);
|
||||
$width = (((int) $this->position['width'] / 12 * $gridWidth) - 60);
|
||||
} else {
|
||||
$width = (((int) $this->width / 12 * $gridWidth) - 50);
|
||||
$width = (((int) $this->width / 12 * $gridWidth) - 60);
|
||||
}
|
||||
|
||||
if ($this->height === 0) {
|
||||
|
|
|
@ -395,6 +395,11 @@ class CustomGraphWidget extends Widget
|
|||
break;
|
||||
}
|
||||
|
||||
// Not posible height < 0.
|
||||
if ($height <= 0) {
|
||||
$height = 10;
|
||||
}
|
||||
|
||||
$params = [
|
||||
'period' => $this->values['period'],
|
||||
'width' => ($size['width'] - 10),
|
||||
|
|
|
@ -372,32 +372,54 @@ class MapsMadeByUser extends Widget
|
|||
// it is necessary to modify specific classes of each
|
||||
// of the visual consoles.
|
||||
$output .= '<style type="text/css">';
|
||||
$output .= '.c-'.$uniq.', .c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span { font-size: '.(4 * $ratio_t).'pt; line-height:'.(4 * $ratio_t * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt; line-height:'.(4 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt; line-height:'.(6 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt; line-height:'.(10 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt; line-height:'.(12 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt; line-height:'.(14 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt; line-height:'.(18 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt; line-height:'.(24 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt; line-height:'.(28 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt; line-height:'.(36 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt; line-height:'.(48 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt; line-height:'.(60 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt; line-height:'.(72 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt; line-height:'.(84 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt; line-height:'.(96 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt; line-height:'.(116 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt; line-height:'.(128 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt; line-height:'.(140 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt; line-height:'.(154 * ($ratio_t) * 1.8).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt; line-height:'.(196 * ($ratio_t) * 1.8).'pt; }';
|
||||
// $output .= '.c-'.$uniq.', .c-'.$uniq.' *:not(.parent_graph p table tr td span) { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label > strong { font-size: '.(8 * $ratio_t).'pt; line-height:'.(8 * ($ratio_t) * 1.5).'pt;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label > strong > span { font-size: '.(10 * $ratio_t).'pt;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label p { overflow:initial !important; margin:0px;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item div.label img { height: 100%; width: 100%; object-fit: contain;}';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_4pt, .c-'.$uniq.' .visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt !important; line-height:'.(4 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_6pt, .c-'.$uniq.' .visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt !important; line-height:'.(6 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_8pt, .c-'.$uniq.' .visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_10pt, .c-'.$uniq.' .visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_12pt, .c-'.$uniq.' .visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt !important; line-height:'.(12 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_14pt, .c-'.$uniq.' .visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt !important; line-height:'.(14 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_18pt, .c-'.$uniq.' .visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt !important; line-height:'.(18 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_24pt, .c-'.$uniq.' .visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt !important; line-height:'.(24 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_28pt, .c-'.$uniq.' .visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt !important; line-height:'.(28 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_36pt, .c-'.$uniq.' .visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt !important; line-height:'.(36 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_48pt, .c-'.$uniq.' .visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt !important; line-height:'.(48 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_60pt, .c-'.$uniq.' .visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt !important; line-height:'.(60 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_72pt, .c-'.$uniq.' .visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt !important; line-height:'.(72 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_84pt, .c-'.$uniq.' .visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt !important; line-height:'.(84 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_96pt, .c-'.$uniq.' .visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt !important; line-height:'.(96 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_116pt, .c-'.$uniq.' .visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt !important; line-height:'.(116 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_128pt, .c-'.$uniq.' .visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt !important; line-height:'.(128 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_140pt, .c-'.$uniq.' .visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt !important; line-height:'.(140 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_154pt, .c-'.$uniq.' .visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt !important; line-height:'.(154 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual_font_size_196pt, .c-'.$uniq.' .visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt !important; line-height:'.(196 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td p { overflow:initial !important; margin:0px; font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * $ratio_t * 1.5).'pt !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * $ratio_t * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_4pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_4pt * { font-size: '.(4 * $ratio_t).'pt !important; line-height:'.(4 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_6pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_6pt * { font-size: '.(6 * $ratio_t).'pt !important; line-height:'.(6 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_8pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_8pt * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_10pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_10pt * { font-size: '.(10 * $ratio_t).'pt !important; line-height:'.(10 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_12pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_12pt * { font-size: '.(12 * $ratio_t).'pt !important; line-height:'.(12 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_14pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_14pt * { font-size: '.(14 * $ratio_t).'pt !important; line-height:'.(14 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_18pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_18pt * { font-size: '.(18 * $ratio_t).'pt !important; line-height:'.(18 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_24pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_24pt * { font-size: '.(24 * $ratio_t).'pt !important; line-height:'.(24 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_28pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_28pt * { font-size: '.(28 * $ratio_t).'pt !important; line-height:'.(28 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_36pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_36pt * { font-size: '.(36 * $ratio_t).'pt !important; line-height:'.(36 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_48pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_48pt * { font-size: '.(48 * $ratio_t).'pt !important; line-height:'.(48 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_60pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_60pt * { font-size: '.(60 * $ratio_t).'pt !important; line-height:'.(60 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_72pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_72pt * { font-size: '.(72 * $ratio_t).'pt !important; line-height:'.(72 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_84pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_84pt * { font-size: '.(84 * $ratio_t).'pt !important; line-height:'.(84 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_96pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_96pt * { font-size: '.(96 * $ratio_t).'pt !important; line-height:'.(96 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_116pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_116pt * { font-size: '.(116 * $ratio_t).'pt !important; line-height:'.(116 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_128pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_128pt * { font-size: '.(128 * $ratio_t).'pt !important; line-height:'.(128 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_140pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_140pt * { font-size: '.(140 * $ratio_t).'pt !important; line-height:'.(140 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_154pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_154pt * { font-size: '.(154 * $ratio_t).'pt !important; line-height:'.(154 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_196pt, .c-'.$uniq.' .visual-console-item-label table tr td span.visual_font_size_196pt * { font-size: '.(196 * $ratio_t).'pt !important; line-height:'.(196 * ($ratio_t) * 1.5).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .flot-text, .c-'.$uniq.' .flot-text * { font-size: '.(8 * $ratio_t).'pt !important; line-height:'.(8 * ($ratio_t)).'pt !important; }';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.time {font-size: '.(50 * $ratio_t).'px !important; line-height: '.(50 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.date {font-size: '.(25 * $ratio_t).'px !important; line-height: '.(25 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .digital-clock span.timezone {font-size: '.(25 * $ratio_t).'px !important; line-height: '.(25 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph * {font-size: '.(8 * $ratio_t).'px !important; line-height: '.(8 * $ratio_t).'px !important;}';
|
||||
$output .= '.c-'.$uniq.' .visual-console-item .donut-graph g rect {width:'.(25 * $ratio_t).' !important; height: '.(15 * $ratio_t).' !important;}';
|
||||
$output .= '</style>';
|
||||
|
|
|
@ -123,11 +123,6 @@ final class Clock extends Item
|
|||
*/
|
||||
protected function decode(array $data): array
|
||||
{
|
||||
// Default values.
|
||||
if (empty($data['height']) === true) {
|
||||
$data['height'] = ($data['width'] / 2);
|
||||
}
|
||||
|
||||
$clockData = parent::decode($data);
|
||||
$clockData['type'] = CLOCK;
|
||||
$clockData['clockType'] = static::extractClockType($data);
|
||||
|
@ -405,11 +400,48 @@ final class Clock extends Item
|
|||
}
|
||||
|
||||
if (isset($values['height']) === false) {
|
||||
$values['height'] = 100;
|
||||
$values['height'] = 50;
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetch a vc item data structure from the database using a filter.
|
||||
*
|
||||
* @param array $filter Filter of the Visual Console Item.
|
||||
*
|
||||
* @return array The Visual Console Item data structure stored into the DB.
|
||||
* @throws \InvalidArgumentException When an agent Id cannot be found.
|
||||
*
|
||||
* @override Item::fetchDataFromDB.
|
||||
*/
|
||||
protected static function fetchDataFromDB(
|
||||
array $filter,
|
||||
?float $ratio=0
|
||||
): array {
|
||||
// Due to this DB call, this function cannot be unit tested without
|
||||
// a proper mock.
|
||||
$data = parent::fetchDataFromDB($filter, $ratio);
|
||||
|
||||
// Default values.
|
||||
if ((int) $data['width'] === 0) {
|
||||
$data['width'] = 100;
|
||||
if ($ratio != 0) {
|
||||
$data['width'] *= $ratio;
|
||||
}
|
||||
}
|
||||
|
||||
if ((int) $data['height'] === 0) {
|
||||
$data['height'] = 50;
|
||||
if ($ratio != 0) {
|
||||
$data['height'] *= $ratio;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -107,8 +107,15 @@ final class EventsHistory extends Item
|
|||
if ((int) $data['width'] === 0 && (int) $data['height'] === 0) {
|
||||
$data['width'] = 420;
|
||||
$data['height'] = 80;
|
||||
|
||||
if ($ratio != 0) {
|
||||
$data['width'] = ($data['width'] * $ratio);
|
||||
$data['height'] = ($data['height'] * $ratio);
|
||||
}
|
||||
}
|
||||
|
||||
$data['height'] = ($data['height'] - 20);
|
||||
|
||||
if ((int) $data['width'] < 11) {
|
||||
$data['width'] = 11;
|
||||
}
|
||||
|
@ -122,7 +129,7 @@ final class EventsHistory extends Item
|
|||
$agentId,
|
||||
$moduleId,
|
||||
100,
|
||||
((int) $data['height'] - 20),
|
||||
(int) $data['height'],
|
||||
static::extractMaxTime($data),
|
||||
'',
|
||||
true,
|
||||
|
|
|
@ -31,25 +31,6 @@ final class Label extends Item
|
|||
*/
|
||||
protected function decode(array $data): array
|
||||
{
|
||||
$data['label'] = \preg_replace(
|
||||
'/overflow: hidden;/',
|
||||
'',
|
||||
$data['label']
|
||||
);
|
||||
// Default values.
|
||||
if ((empty($data['width']) === true)
|
||||
&& (empty($data['height']) === true)
|
||||
) {
|
||||
preg_match(
|
||||
'/visual_font_size_(.*)pt/',
|
||||
$data['label'],
|
||||
$matches
|
||||
);
|
||||
|
||||
$data['width'] = (($matches[1] * 10) + 5);
|
||||
$data['height'] = ($matches[1] * 2.5);
|
||||
}
|
||||
|
||||
$return = parent::decode($data);
|
||||
$return['type'] = LABEL;
|
||||
return $return;
|
||||
|
|
|
@ -218,8 +218,13 @@ final class StaticGraph extends Item
|
|||
if ($width === 0 || $height === 0) {
|
||||
if (isset($imagePath) && $imagePath !== false) {
|
||||
$sizeImage = getimagesize($config['homedir'].'/'.$imagePath);
|
||||
$data['width'] = $sizeImage[0];
|
||||
$data['height'] = $sizeImage[1];
|
||||
if ($ratio != 0) {
|
||||
$data['width'] = ($sizeImage[0] * $ratio);
|
||||
$data['height'] = ($sizeImage[1] * $ratio);
|
||||
} else {
|
||||
$data['width'] = $sizeImage[0];
|
||||
$data['height'] = $sizeImage[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ h1 {
|
|||
|
||||
.grid-stack-item-content {
|
||||
color: #2c3e50;
|
||||
text-align: center;
|
||||
/*text-align: center;*/
|
||||
background-color: #ffffff;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: 5px 5px 5px 0px rgba(214, 214, 214, 1);
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.752';
|
||||
$build = '210302';
|
||||
$build = '210304';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -209,23 +209,6 @@ if (($new_msg) && (!empty($dst_user)) && (!$reply)) {
|
|||
);
|
||||
}
|
||||
|
||||
// Create message (destination group).
|
||||
if (($new_msg) && ($dst_group != '') && (!$reply)) {
|
||||
$return = messages_create_message(
|
||||
$config['id_user'],
|
||||
[],
|
||||
[$dst_group],
|
||||
$subject,
|
||||
$message
|
||||
);
|
||||
|
||||
ui_print_result_message(
|
||||
$return,
|
||||
__('Message successfully sent'),
|
||||
__('Error sending message to group %s', groups_get_name($dst_group))
|
||||
);
|
||||
}
|
||||
|
||||
// Message creation form.
|
||||
// User info.
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
|
|
|
@ -426,7 +426,7 @@ if ($config['double_auth_enabled'] || ($config['double_auth_enabled'] == '' && $
|
|||
$double_authentication .= '<div id="dialog-double_auth" style="display:none"><div id="dialog-double_auth-container"></div></div>';
|
||||
}
|
||||
|
||||
if ($double_auth_enabled && $config['double_auth_enabled'] && $config['2FA_all_users'] != '') {
|
||||
if ($double_auth_enabled && $config['double_auth_enabled']) {
|
||||
$double_authentication .= html_print_button(__('Show information'), 'show_info', false, 'javascript:show_double_auth_info();', '', true);
|
||||
}
|
||||
|
||||
|
@ -981,6 +981,7 @@ function show_double_auth_info () {
|
|||
data: {
|
||||
page: 'include/ajax/double_auth.ajax',
|
||||
id_user: userID,
|
||||
id_user_auth: userID,
|
||||
get_double_auth_data_page: 1,
|
||||
containerID: $dialogContainer.prop('id')
|
||||
},
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.752-210302
|
||||
Version: 7.0NG.752-210304
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210302"
|
||||
pandora_version="7.0NG.752-210304"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -277,7 +277,7 @@ autocreate_group 10
|
|||
# If set to 1, new agents will be added to the group specified by autocreate_group (the group specified by the agent will be used as fallback).
|
||||
# If set to 0, new agents will be added to the group specified by the agent (the group specified by autocreate_group will be used as fallback).
|
||||
|
||||
autocreate_group_force 1
|
||||
autocreate_group_force 0
|
||||
|
||||
# Set to 1 if want to autocreate agents with Pandora FMS Data Server,
|
||||
# set to 0 to disable
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.752";
|
||||
my $pandora_build = "210302";
|
||||
my $pandora_build = "210304";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.752";
|
||||
my $pandora_build = "210302";
|
||||
my $pandora_build = "210304";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210302
|
||||
%define release 210304
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210302"
|
||||
PI_BUILD="210304"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210302";
|
||||
my $version = "7.0NG.752 PS210304";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210302";
|
||||
my $version = "7.0NG.752 PS210304";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
|
@ -844,7 +844,8 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
|
||||
if (
|
||||
prevProps &&
|
||||
this.props.isLinkEnabled && prevProps.link !== this.props.link
|
||||
this.props.isLinkEnabled &&
|
||||
prevProps.link !== this.props.link
|
||||
) {
|
||||
if (this.props.link !== null) {
|
||||
this.elementRef.setAttribute("href", this.props.link);
|
||||
|
@ -1024,8 +1025,8 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
this.props.type != ItemType.LINE_ITEM &&
|
||||
this.props.type != ItemType.NETWORK_LINK
|
||||
) {
|
||||
this.childElementRef.style.width = width > 0 ? `${width}px` : "0";
|
||||
this.childElementRef.style.height = height > 0 ? `${height}px` : "0";
|
||||
this.childElementRef.style.width = width > 0 ? `${width}px` : null;
|
||||
this.childElementRef.style.height = height > 0 ? `${height}px` : null;
|
||||
}
|
||||
|
||||
if (this.props.label && this.props.label.length > 0) {
|
||||
|
@ -1037,11 +1038,11 @@ abstract class VisualConsoleItem<Props extends ItemProps> {
|
|||
switch (this.props.labelPosition) {
|
||||
case "up":
|
||||
case "down":
|
||||
table.style.width = width > 0 ? `${width}px` : "0";
|
||||
table.style.width = width > 0 ? `${width}px` : null;
|
||||
break;
|
||||
case "left":
|
||||
case "right":
|
||||
table.style.height = height > 0 ? `${height}px` : "0";
|
||||
table.style.height = height > 0 ? `${height}px` : null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue