2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
< ? php
2019-05-29 10:27:28 +02:00
/**
* Update manager client options .
*
* @ category Update Manager
* @ package Pandora FMS
* @ subpackage Community
* @ version 1.0 . 0
* @ license See below
*
* ______ ___ _______ _______ ________
2023-06-08 12:42:10 +02:00
* | __ \ .-----.--.--.--| |.-----.----.-----. | ___ | | | __ |
* | __ /| _ | | _ || _ | _ | _ | | ___ | | __ |
2019-05-29 10:27:28 +02:00
* | ___ | | ___ . _ | __ | __ | _____ || _____ | __ | | ___ . _ | | ___ | | __ | _ | __ | _______ |
*
* ============================================================================
2023-06-08 11:53:13 +02:00
* Copyright ( c ) 2005 - 2023 Pandora FMS
2023-06-08 13:19:01 +02:00
* Please see https :// pandorafms . com / community / for full contribution list
2019-05-29 10:27:28 +02:00
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
* ============================================================================
*/
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2019-05-29 10:27:28 +02:00
// Begin.
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
global $config ;
2019-05-29 10:37:02 +02:00
require_once __DIR__ . '/../../include/functions_users.php' ;
2021-08-11 11:27:07 +02:00
require_once __DIR__ . '/../../include/functions_update_manager.php' ;
2019-05-29 10:37:02 +02:00
2019-01-30 16:18:44 +01:00
check_login ();
2016-04-13 13:51:01 +02:00
2019-01-30 16:18:44 +01:00
if ( ! check_acl ( $config [ 'id_user' ], 0 , 'PM' ) && ! is_user_admin ( $config [ 'id_user' ])) {
2022-02-01 13:39:18 +01:00
db_pandora_audit (
AUDIT_LOG_ACL_VIOLATION ,
'Trying to access Setup Management'
);
2019-01-30 16:18:44 +01:00
include 'general/noaccess.php' ;
return ;
2016-04-13 13:51:01 +02:00
}
2016-06-16 13:27:19 +02:00
$identification_reminder = get_parameter ( 'identification_reminder' , 1 );
2019-01-30 16:18:44 +01:00
$action_update_url_update_manager = ( bool ) get_parameter (
'action_update_url_update_manager' ,
0
);
2019-05-29 10:37:02 +02:00
if ( users_is_admin ()) {
$update_manager_disconnect = get_parameter (
'um_disconnect_console' ,
0
2019-05-29 10:26:53 +02:00
);
2019-05-29 10:37:02 +02:00
if ( $update_manager_disconnect ) {
config_update_value (
'pandora_uid' ,
'OFFLINE'
);
}
2019-05-29 10:26:53 +02:00
}
2019-01-30 16:18:44 +01:00
if ( ! $action_update_url_update_manager ) {
2019-12-18 17:48:29 +01:00
$url_update_manager = get_parameter (
'url_update_manager' ,
$config [ 'url_update_manager' ]
);
2021-06-14 13:56:42 +02:00
$secure_update_manager = get_parameter (
'secure_update_manager' ,
( $config [ 'secure_update_manager' ] ? ? 1 )
);
if ( $secure_update_manager === '' ) {
$secure_update_manager = 0 ;
}
2019-05-29 10:26:53 +02:00
$update_manager_proxy_server = get_parameter (
'update_manager_proxy_server' ,
$config [ 'update_manager_proxy_server' ]
);
$update_manager_proxy_port = get_parameter (
'update_manager_proxy_port' ,
$config [ 'update_manager_proxy_port' ]
);
$update_manager_proxy_user = get_parameter (
'update_manager_proxy_user' ,
$config [ 'update_manager_proxy_user' ]
);
$update_manager_proxy_password = get_parameter (
'update_manager_proxy_password' ,
$config [ 'update_manager_proxy_password' ]
);
2022-02-17 13:41:40 +01:00
$allow_offline_patches = get_parameter_switch (
'allow_offline_patches' ,
$config [ 'allow_offline_patches' ]
);
2022-03-28 15:09:21 +02:00
$lts_updates = get_parameter_switch (
'lts_updates' ,
$config [ 'lts_updates' ]
);
2019-01-30 16:18:44 +01:00
if ( $action_update_url_update_manager ) {
$result = config_update_value (
'url_update_manager' ,
$url_update_manager
);
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_server' ,
$update_manager_proxy_server
);
}
2021-06-14 13:56:42 +02:00
if ( $result ) {
$result = config_update_value (
'secure_update_manager' ,
$secure_update_manager
);
}
2019-01-30 16:18:44 +01:00
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_port' ,
$update_manager_proxy_port
);
}
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_user' ,
$update_manager_proxy_user
);
}
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_password' ,
$update_manager_proxy_password
);
}
2022-02-17 13:41:40 +01:00
if ( $result ) {
$result = config_update_value (
'allow_offline_patches' ,
$allow_offline_patches
);
}
2022-03-28 15:09:21 +02:00
if ( $result ) {
$result = config_update_value (
'lts_updates' ,
$lts_updates
);
}
2019-01-30 16:18:44 +01:00
if ( $result && license_free ()) {
2019-05-29 10:26:53 +02:00
$result = config_update_value (
'identification_reminder' ,
$identification_reminder
);
2019-01-30 16:18:44 +01:00
}
ui_print_result_message (
$result ,
__ ( 'Succesful Update the url config vars.' ),
__ ( 'Unsuccesful Update the url config vars.' )
);
}
} else {
$url_update_manager = get_parameter ( 'url_update_manager' , '' );
2021-06-14 13:56:42 +02:00
$secure_update_manager = get_parameter_switch ( 'secure_update_manager' , null );
2019-01-30 16:18:44 +01:00
$update_manager_proxy_server = get_parameter ( 'update_manager_proxy_server' , '' );
$update_manager_proxy_port = get_parameter ( 'update_manager_proxy_port' , '' );
$update_manager_proxy_user = get_parameter ( 'update_manager_proxy_user' , '' );
$update_manager_proxy_password = get_parameter ( 'update_manager_proxy_password' , '' );
2022-02-17 13:41:40 +01:00
$allow_offline_patches = get_parameter_switch ( 'allow_offline_patches' , false );
2022-03-28 15:09:21 +02:00
$lts_updates = get_parameter_switch ( 'lts_updates' , false );
2019-01-30 16:18:44 +01:00
if ( $action_update_url_update_manager ) {
$result = config_update_value (
'url_update_manager' ,
$url_update_manager
);
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_server' ,
$update_manager_proxy_server
);
}
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_port' ,
$update_manager_proxy_port
);
}
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_user' ,
$update_manager_proxy_user
);
}
if ( $result ) {
$result = config_update_value (
'update_manager_proxy_password' ,
2019-12-18 17:48:29 +01:00
io_input_password ( $update_manager_proxy_password )
2019-01-30 16:18:44 +01:00
);
}
2021-06-14 13:56:42 +02:00
if ( $result ) {
$result = config_update_value (
'secure_update_manager' ,
io_safe_input ( $secure_update_manager ? ? 0 )
);
}
2022-02-17 13:41:40 +01:00
if ( $result ) {
$result = config_update_value (
'allow_offline_patches' ,
$allow_offline_patches
);
}
2022-03-28 15:09:21 +02:00
if ( $result ) {
$result = config_update_value (
'lts_updates' ,
$lts_updates
);
}
2019-01-30 16:18:44 +01:00
if ( $result && license_free ()) {
$result = config_update_value ( 'identification_reminder' , $identification_reminder );
}
ui_print_result_message (
$result ,
__ ( 'Succesful Update the url config vars.' ),
__ ( 'Unsuccesful Update the url config vars.' )
);
}
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
}
2021-06-14 13:56:42 +02:00
if (( bool ) is_metaconsole () === true ) {
$action = ui_get_full_url (
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup'
);
} else {
$action = ui_get_full_url (
'index.php?sec=gsetup&sec2=godmode/update_manager/update_manager&tab=setup'
);
}
2023-03-23 17:44:04 +01:00
echo '<form method="post" action="' . $action . '" class="max_floating_element_size">' ;
2019-12-18 15:15:25 +01:00
html_print_input_hidden ( 'update_config' , 1 );
2015-06-25 10:07:53 +02:00
$table = new stdClass ();
2015-06-16 16:09:50 +02:00
$table -> width = '100%' ;
2023-03-23 17:44:04 +01:00
$table -> class = 'databox filters filter-table-adv' ;
$table -> size [ 0 ] = '50%' ;
$table -> size [ 1 ] = '50%' ;
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2021-06-14 13:56:42 +02:00
$url_update_manager = update_manager_get_url ();
2023-03-23 17:44:04 +01:00
$table -> data [ 0 ][ 0 ] = html_print_label_input_block (
__ ( 'Warp Update URL' ),
html_print_input_text (
'url_update_manager' ,
$url_update_manager ,
__ ( 'URL update manager' ),
80 ,
255 ,
true ,
true
)
2019-01-30 16:18:44 +01:00
);
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
2023-03-23 17:44:04 +01:00
$table -> data [ 0 ][ 1 ] = html_print_label_input_block (
__ ( 'Use secured Warp Update' ),
html_print_input (
[
'type' => 'switch' ,
'name' => 'secure_update_manager' ,
'value' => ( $secure_update_manager ? ? 1 ),
]
)
2021-06-14 13:56:42 +02:00
);
2023-03-23 17:44:04 +01:00
$table -> data [ 1 ][ 0 ] = html_print_label_input_block (
2019-01-30 16:18:44 +01:00
__ ( 'Proxy server' ),
2023-03-23 17:44:04 +01:00
html_print_input_text (
'update_manager_proxy_server' ,
$update_manager_proxy_server ,
__ ( 'Proxy server' ),
80 ,
60 ,
true
)
2019-01-30 16:18:44 +01:00
);
2015-02-10 16:40:44 +01:00
2023-03-23 17:44:04 +01:00
$table -> data [ 1 ][ 1 ] = html_print_label_input_block (
2019-01-30 16:18:44 +01:00
__ ( 'Proxy port' ),
2023-03-23 17:44:04 +01:00
html_print_input_text (
'update_manager_proxy_port' ,
$update_manager_proxy_port ,
__ ( 'Proxy port' ),
80 ,
60 ,
true
)
2019-01-30 16:18:44 +01:00
);
2015-02-10 16:40:44 +01:00
2023-03-23 17:44:04 +01:00
$table -> data [ 2 ][ 0 ] = html_print_label_input_block (
2019-01-30 16:18:44 +01:00
__ ( 'Proxy user' ),
2023-03-23 17:44:04 +01:00
html_print_input_text (
'update_manager_proxy_user' ,
$update_manager_proxy_user ,
__ ( 'Proxy user' ),
80 ,
60 ,
true
)
2019-01-30 16:18:44 +01:00
);
2015-02-10 16:40:44 +01:00
2023-03-23 17:44:04 +01:00
$table -> data [ 2 ][ 1 ] = html_print_label_input_block (
2019-01-30 16:18:44 +01:00
__ ( 'Proxy password' ),
2023-03-23 17:44:04 +01:00
html_print_input_password (
'update_manager_proxy_password' ,
$update_manager_proxy_password ,
__ ( 'Proxy password' ),
80 ,
60 ,
true
)
2019-01-30 16:18:44 +01:00
);
2015-02-10 16:40:44 +01:00
2023-03-23 17:44:04 +01:00
$table -> data [ 3 ][ 0 ] = html_print_label_input_block (
__ ( 'Allow no-consecutive patches' ),
html_print_switch (
[
'name' => 'allow_offline_patches' ,
'value' => $allow_offline_patches ,
'return' => true ,
]
)
2022-02-17 13:41:40 +01:00
);
2019-05-29 10:26:53 +02:00
2023-03-23 17:44:04 +01:00
$table -> data [ 3 ][ 1 ] = html_print_label_input_block (
__ ( 'Limit to LTS updates' ),
html_print_switch (
[
'name' => 'lts_updates' ,
'value' => $lts_updates ,
'return' => true ,
]
)
2022-03-28 15:09:21 +02:00
);
2023-03-23 17:44:04 +01:00
$table -> data [ 4 ][ 0 ] = html_print_label_input_block (
__ ( 'Registration ID' ),
'<i>' . ( $config [ 'pandora_uid' ] ? ? __ ( 'Not registred yet' )) . '</i>'
);
2019-05-29 10:26:53 +02:00
2019-05-29 10:37:02 +02:00
if ( update_manager_verify_registration () === true && users_is_admin ()) {
2023-03-23 17:44:04 +01:00
$url = '<a href="' ;
2021-06-14 13:56:42 +02:00
if (( bool ) is_metaconsole () === true ) {
2023-03-23 17:44:04 +01:00
$url .= ui_get_full_url (
2021-06-14 13:56:42 +02:00
'index.php?sec=advanced&sec2=advanced/metasetup&pure=0&tab=update_manager_setup&um_disconnect_console=1'
);
} else {
2023-03-23 17:44:04 +01:00
$url .= ui_get_full_url (
2021-06-14 13:56:42 +02:00
'index.php?sec=messages&sec2=godmode/update_manager/update_manager&tab=setup&um_disconnect_console=1'
);
}
2023-03-23 17:44:04 +01:00
$url .= '" onclick="if(confirm(\'Are you sure?\')) {return true;} else { return false; }">' . __ ( 'Unregister' ) . '</a>' ;
$table -> data [ 4 ][ 1 ] = html_print_label_input_block (
__ ( 'Cancel registration' ),
$url
);
2019-05-29 10:26:53 +02:00
}
2016-06-16 13:27:19 +02:00
if ( license_free ()) {
2019-01-30 16:18:44 +01:00
$config [ 'identification_reminder' ] = isset ( $config [ 'identification_reminder' ]) ? $config [ 'identification_reminder' ] : 1 ;
2023-03-23 17:44:04 +01:00
$table -> data [ 4 ][ 1 ] = html_print_label_input_block (
__ ( '%s community reminder' , get_product_name ()) . ui_print_help_tip ( __ ( 'Every 8 days, a message is displayed to admin users to remember to register this %s instance' , get_product_name ()), true ),
' < div class = " inline-radio-button " >
'.__(' Yes ').html_print_radio_button(' realtimestats ', 1, ' ', $config[' realtimestats '], true).' & nbsp ; & nbsp ;
'.__(' No ').html_print_radio_button(' realtimestats ', 0, ' ', $config[' realtimestats '], true).' </ div > '
);
2016-06-16 13:27:19 +02:00
}
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
html_print_input_hidden ( 'action_update_url_update_manager' , 1 );
2019-12-18 15:15:25 +01:00
html_print_input_hidden ( 'update_config' , 1 );
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
html_print_table ( $table );
2023-03-23 17:44:04 +01:00
html_print_action_buttons (
html_print_submit_button (
__ ( 'Update' ),
'update_button' ,
false ,
[ 'icon' => 'wand' ],
true
)
2019-01-30 16:18:44 +01:00
);
2014-06-09 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_config.php, general/login_page.php: improved
the source code style.
* godmode/setup/os.builder.php: fixed the form.
* godmode/update_manager_xxx/*, godmode/menu.php,
include/functions_update_manager.php,
include/ajax/update_manager.ajax.php,
include/graphs/functions_gd.php, include/graphs/functions_flot.php,
include/config_process.php, include/javascript/update_manager.js,
include/javascript/jquery.knob.js,
include/javascript/jquery.iframe-transport.js,
include/javascript/jquery.fileupload.js, images/check-cross.png:
first version of new update manager.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-06-09 15:33:55 +02:00
echo '</form>' ;