Merge branch 'ent-8421-extension-antigua-backups' into 'develop'

Ent 8421 extension antigua backups

Closes pandora_enterprise#8421

See merge request artica/pandorafms!4614
This commit is contained in:
Daniel Rodriguez 2022-01-11 10:10:29 +00:00
commit 0f82255904
6 changed files with 109 additions and 64 deletions

View File

@ -116,3 +116,5 @@ mobile/include/javascript/jquery.mobile-1.3.1.js
mobile/include/style/jquery.mobile-1.3.1.css
godmode/alerts/configure_alert_special_days.php
godmode/admin_access_logs.php
enterprise/extensions/backup/main.php
enterprise/extensions/backup.php

View File

@ -628,20 +628,20 @@ $table->data[5][1] = "
<tr><td>".ui_get_using_system_timezone_warning().'</td></tr>
<tr>
<td>'.__('Type Periodicity:').'&nbsp;'.html_print_select(
[
'weekly' => __('Weekly'),
'monthly' => __('Monthly'),
],
'type_periodicity',
$type_periodicity,
'change_type_periodicity();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
[
'weekly' => __('Weekly'),
'monthly' => __('Monthly'),
],
'type_periodicity',
$type_periodicity,
'change_type_periodicity();',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
)."</td>
</tr>
<tr>
@ -661,31 +661,31 @@ $table->data[5][1] = "
<tr>
<td>".__('From day:').'</td>
<td>'.html_print_select(
$days,
'periodically_day_from',
$periodically_day_from,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
$days,
'periodically_day_from',
$periodically_day_from,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).'</td>
<td>'.__('To day:').'</td>
<td>'.html_print_select(
$days,
'periodically_day_to',
$periodically_day_to,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
$days,
'periodically_day_to',
$periodically_day_to,
'',
'',
0,
true,
false,
true,
'',
$disabled_in_execution
).'</td>
<td>'.ui_print_help_tip(__('The end day must be higher than the start day'), true).'</td>
</tr>
@ -694,26 +694,26 @@ $table->data[5][1] = "
<tr>
<td>'.__('From hour:').'</td>
<td>'.html_print_input_text(
'periodically_time_from',
$periodically_time_from,
'',
7,
7,
true,
$disabled_in_execution
'periodically_time_from',
$periodically_time_from,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_help_tip(
__('The end time must be higher than the start time'),
true
).'</td>
<td>'.__('To hour:').'</td>
<td>'.html_print_input_text(
'periodically_time_to',
$periodically_time_to,
'',
7,
7,
true,
$disabled_in_execution
'periodically_time_to',
$periodically_time_to,
'',
7,
7,
true,
$disabled_in_execution
).ui_print_help_tip(
__('The end time must be higher than the start time'),
true
@ -997,13 +997,13 @@ $table->data['module'][1] = "
<td class='cell_delete_button' style='text-align: right; width:10%;' id=''>".'<a class="link_delete"
onclick="if(!confirm(\''.__('Are you sure?').'\')) return false;"
href="">'.html_print_image(
'images/cross.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
'class' => 'invert_filter',
]
'images/cross.png',
true,
[
'border' => '0',
'alt' => __('Delete'),
'class' => 'invert_filter',
]
).'</a>'."</td>
</tr>
<tr class='datos2' id='add_modules_row'>

View File

@ -406,6 +406,7 @@ if (check_acl($config['id_user'], 0, 'PM') || check_acl($config['id_user'], 0, '
$sub['extensions/dbmanager']['text'] = __('DB Interface');
$sub['extensions/dbmanager']['id'] = 'DB Interface';
$sub['extensions/dbmanager']['sec'] = 'gbman';
enterprise_hook('dbBackupManager');
enterprise_hook('elasticsearch_interface_menu');
}
}

View File

@ -2435,6 +2435,38 @@ function html_print_div(
}
/**
* Render an <pre> tag for show code.
* For debug purposes, see for `hd()` function.
*
* @param string $content Content of tag.
* @param boolean $return Return the tag string formed.
* @param array $attributes Attributes availables for pre tags.
*
* @return string
*/
function html_print_code(
string $content,
bool $return=true,
array $attributes=[]
) {
$output = '<pre';
if (empty($attributes) === false) {
foreach ($attributes as $attribute => $value) {
$output .= ' '.$attribute.'="'.io_safe_input_html($value).'"';
}
}
$output .= sprintf('>%s</pre>', $content);
if ($return === true) {
return $output;
} else {
echo $output;
}
}
/**
* Render an anchor <a> html element.
*

View File

@ -545,11 +545,12 @@ function io_input_password($password)
* Process the given password read from the Pandora FMS Database,
* decrypting it if necessary.
*
* @param string password Password read from the DB.
* @param string $password Password read from the DB.
* @param string $wrappedBy Wrap the password with the informed character.
*
* @return string The processed password.
*/
function io_output_password($password)
function io_output_password($password, $wrappedBy='')
{
global $config;
@ -562,11 +563,14 @@ function io_output_password($password)
]
);
if ($plaintext === ENTERPRISE_NOT_HOOK) {
return io_safe_output($password);
}
$output = ($plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
return io_safe_output($plaintext);
return sprintf(
'%s%s%s',
$wrappedBy,
io_safe_output($output),
$wrappedBy
);
}

View File

@ -8435,6 +8435,12 @@ div.stat-win-spinner img {
font-size: 12px;
}
/* For backups dt, can be useful for others */
#backups_list > thead > tr > th:last-child,
#backups_list > tbody > tr > td:last-child {
text-align: center;
}
/* err_msg_centralised */
div#err_msg_centralised div {
margin-top: 1em;