|
|
|
@ -88,7 +88,7 @@ function config_update_config () {
|
|
|
|
|
$style = (string) get_parameter ('style', $config["style"]);
|
|
|
|
|
if ($style != $config['style'])
|
|
|
|
|
$style = substr ($style, 0, strlen ($style) - 4);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('language', (string) get_parameter ('language', $config["language"]));
|
|
|
|
|
config_update_value ('remote_config', (string) get_parameter ('remote_config', $config["remote_config"]));
|
|
|
|
|
config_update_value ('block_size', (int) get_parameter ('block_size', $config["block_size"]));
|
|
|
|
@ -126,7 +126,7 @@ function config_update_config () {
|
|
|
|
|
config_update_value ('flash_charts', (bool) get_parameter ('flash_charts', $config["flash_charts"]));
|
|
|
|
|
config_update_value ('attachment_store', (string) get_parameter ('attachment_store', $config["attachment_store"]));
|
|
|
|
|
config_update_value ('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('custom_logo', (string) get_parameter ('custom_logo', $config["custom_logo"]));
|
|
|
|
|
config_update_value ('history_db_enabled', (bool) get_parameter ('history_db_enabled', $config['history_db_enabled']));
|
|
|
|
|
config_update_value ('history_db_host', (string) get_parameter ('history_db_host', $config['history_db_host']));
|
|
|
|
@ -157,31 +157,31 @@ function config_update_config () {
|
|
|
|
|
config_update_value ('autocreate_blacklist', get_parameter ('autocreate_blacklist', $config['autocreate_blacklist']));
|
|
|
|
|
config_update_value ('default_remote_profile', get_parameter ('default_remote_profile', $config['default_remote_profile']));
|
|
|
|
|
config_update_value ('default_remote_group', get_parameter ('default_remote_group', $config['default_remote_group']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('ldap_server', get_parameter ('ldap_server', $config['ldap_server']));
|
|
|
|
|
config_update_value ('ldap_port', get_parameter ('ldap_port', $config['ldap_port']));
|
|
|
|
|
config_update_value ('ldap_version', get_parameter ('ldap_version', $config['ldap_version']));
|
|
|
|
|
config_update_value ('ldap_start_tls', get_parameter ('ldap_start_tls', $config['ldap_start_tls']));
|
|
|
|
|
config_update_value ('ldap_base_dn', get_parameter ('ldap_base_dn', $config['ldap_base_dn']));
|
|
|
|
|
config_update_value ('ldap_login_attr', get_parameter ('ldap_login_attr', $config['ldap_login_attr']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('ad_server', get_parameter ('ad_server', $config['ad_server']));
|
|
|
|
|
config_update_value ('ad_port', get_parameter ('ad_port', $config['ad_port']));
|
|
|
|
|
config_update_value ('ad_start_tls', get_parameter ('ad_start_tls', $config['ad_start_tls']));
|
|
|
|
|
config_update_value ('ad_domain', get_parameter ('ad_domain', $config['ad_domain']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('rpandora_server', get_parameter ('rpandora_server', $config['rpandora_server']));
|
|
|
|
|
config_update_value ('rpandora_port', get_parameter ('rpandora_port', $config['rpandora_port']));
|
|
|
|
|
config_update_value ('rpandora_dbname', get_parameter ('rpandora_dbname', $config['rpandora_dbname']));
|
|
|
|
|
config_update_value ('rpandora_user', get_parameter ('rpandora_user', $config['rpandora_user']));
|
|
|
|
|
config_update_value ('rpandora_pass', get_parameter ('rpandora_pass', $config['rpandora_pass']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('rbabel_server', get_parameter ('rbabel_server', $config['rbabel_server']));
|
|
|
|
|
config_update_value ('rbabel_port', get_parameter ('rbabel_port', $config['rbabel_port']));
|
|
|
|
|
config_update_value ('rbabel_dbname', get_parameter ('rbabel_dbname', $config['rbabel_dbname']));
|
|
|
|
|
config_update_value ('rbabel_user', get_parameter ('rbabel_user', $config['rbabel_user']));
|
|
|
|
|
config_update_value ('rbabel_pass', get_parameter ('rbabel_pass', $config['rbabel_pass']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('rintegria_server', get_parameter ('rintegria_server', $config['rintegria_server']));
|
|
|
|
|
config_update_value ('rintegria_port', get_parameter ('rintegria_port', $config['rintegria_port']));
|
|
|
|
|
config_update_value ('rintegria_dbname', get_parameter ('rintegria_dbname', $config['rintegria_dbname']));
|
|
|
|
@ -200,17 +200,11 @@ function config_update_config () {
|
|
|
|
|
config_update_value ('api_password', get_parameter('api_password', ""));
|
|
|
|
|
|
|
|
|
|
config_update_value ('collection_max_size', get_parameter('collection_max_size', $config['collection_max_size']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config_update_value ('font_size', get_parameter('font_size', $config['font_size']));
|
|
|
|
|
config_update_value ('refr', get_parameter('refr', $config['refr']));
|
|
|
|
|
config_update_value ('refr', get_parameter('refr', $config['refr']));
|
|
|
|
|
config_update_value ('vc_refr', get_parameter('vc_refr', $config['vc_refr']));
|
|
|
|
|
|
|
|
|
|
config_update_value ('agent_size_text_small', get_parameter('agent_size_text_small', $config['agent_size_text_small']));
|
|
|
|
|
config_update_value ('agent_size_text_medium', get_parameter('agent_size_text_medium', $config['agent_size_text_medium']));
|
|
|
|
|
config_update_value ('module_size_text_small', get_parameter('module_size_text_small', $config['module_size_text_small']));
|
|
|
|
|
config_update_value ('module_size_text_medium', get_parameter('module_size_text_medium', $config['module_size_text_medium']));
|
|
|
|
|
config_update_value ('description_size_text', get_parameter('description_size_text', $config['description_size_text']));
|
|
|
|
|
config_update_value ('item_title_size_text', get_parameter('item_title_size_text', $config['item_title_size_text']));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enterprise_include_once('include/functions_policies.php');
|
|
|
|
|
$enterprise = enterprise_include_once ('include/functions_skins.php');
|
|
|
|
@ -235,7 +229,7 @@ function config_update_config () {
|
|
|
|
|
|
|
|
|
|
# Update of Pandora FMS license
|
|
|
|
|
$update_manager_installed = db_get_value('value', 'tconfig', 'token', 'update_manager_installed');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($update_manager_installed == 1) {
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['license_info_key'])) {
|
|
|
|
@ -252,7 +246,7 @@ function config_update_config () {
|
|
|
|
|
*/
|
|
|
|
|
function config_process_config () {
|
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$configs = db_get_all_rows_in_table ('tconfig');
|
|
|
|
|
|
|
|
|
|
if (empty ($configs)) {
|
|
|
|
@ -262,13 +256,13 @@ function config_process_config () {
|
|
|
|
|
|
|
|
|
|
/* Compatibility fix */
|
|
|
|
|
foreach ($configs as $c) {
|
|
|
|
|
$config[$c['token']] = $c['value'];
|
|
|
|
|
$config[$c['token']] = $c['value'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['language'])) {
|
|
|
|
|
config_update_value ('language', 'en');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset ($config['homeurl']) && $config['homeurl'][0] != '/') {
|
|
|
|
|
$config['homeurl'] = '/'.$config['homeurl'];
|
|
|
|
|
}
|
|
|
|
@ -410,55 +404,55 @@ function config_process_config () {
|
|
|
|
|
if (!isset ($config['fontpath'])) {
|
|
|
|
|
config_update_value ( 'fontpath', $config['homedir'].'/include/fonts/smallfont.ttf');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['style'])) {
|
|
|
|
|
config_update_value ( 'style', 'pandora');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['flash_charts'])) {
|
|
|
|
|
config_update_value ( 'flash_charts', true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config["custom_logo"])){
|
|
|
|
|
config_update_value ('custom_logo', 'none.png');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_enabled'])) {
|
|
|
|
|
config_update_value ( 'history_db_enabled', false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_host'])) {
|
|
|
|
|
config_update_value ( 'history_db_host', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_port'])) {
|
|
|
|
|
config_update_value ( 'history_db_port', 3306);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_name'])) {
|
|
|
|
|
config_update_value ( 'history_db_name', 'pandora');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_user'])) {
|
|
|
|
|
config_update_value ( 'history_db_user', 'pandora');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_pass'])) {
|
|
|
|
|
config_update_value ( 'history_db_pass', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_days'])) {
|
|
|
|
|
config_update_value ( 'history_db_days', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_step'])) {
|
|
|
|
|
config_update_value ( 'history_db_step', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['history_db_delay'])) {
|
|
|
|
|
config_update_value ( 'history_db_delay', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['activate_gis'])) {
|
|
|
|
|
config_update_value ( 'activate_gis', 0);
|
|
|
|
|
}
|
|
|
|
@ -482,119 +476,119 @@ function config_process_config () {
|
|
|
|
|
if (!isset ($config['auth'])) {
|
|
|
|
|
config_update_value ( 'auth', 'mysql');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['autocreate_remote_users'])) {
|
|
|
|
|
config_update_value ('autocreate_remote_users', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['autocreate_blacklist'])) {
|
|
|
|
|
config_update_value ('autocreate_blacklist', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['default_remote_profile'])) {
|
|
|
|
|
config_update_value ('default_remote_profile', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['default_remote_group'])) {
|
|
|
|
|
config_update_value ('default_remote_group', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_server'])) {
|
|
|
|
|
config_update_value ( 'ldap_server', 'localhost');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_port'])) {
|
|
|
|
|
config_update_value ( 'ldap_port', 389);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_version'])) {
|
|
|
|
|
config_update_value ( 'ldap_version', '3');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_start_tls'])) {
|
|
|
|
|
config_update_value ( 'ldap_start_tls', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_base_dn'])) {
|
|
|
|
|
config_update_value ( 'ldap_base_dn', 'ou=People,dc=edu,dc=example,dc=org');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ldap_login_attr'])) {
|
|
|
|
|
config_update_value ( 'ldap_login_attr', 'uid');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ad_server'])) {
|
|
|
|
|
config_update_value ( 'ad_server', 'localhost');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ad_port'])) {
|
|
|
|
|
config_update_value ( 'ad_port', 389);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ad_start_tls'])) {
|
|
|
|
|
config_update_value ( 'ad_start_tls', 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['ad_domain'])) {
|
|
|
|
|
config_update_value ( 'ad_domain', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rpandora_server'])) {
|
|
|
|
|
config_update_value ( 'rpandora_server', 'localhost');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rpandora_port'])) {
|
|
|
|
|
config_update_value ( 'rpandora_port', 3306);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rpandora_dbname'])) {
|
|
|
|
|
config_update_value ( 'rpandora_dbname', 'pandora');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rpandora_user'])) {
|
|
|
|
|
config_update_value ( 'rpandora_user', 'pandora');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rpandora_pass'])) {
|
|
|
|
|
config_update_value ( 'rpandora_pass', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rbabel_server'])) {
|
|
|
|
|
config_update_value ( 'rbabel_server', 'localhost');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rbabel_port'])) {
|
|
|
|
|
config_update_value ( 'rbabel_port', 3306);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rbabel_dbname'])) {
|
|
|
|
|
config_update_value ( 'rbabel_dbname', 'babel');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rbabel_user'])) {
|
|
|
|
|
config_update_value ( 'rbabel_user', 'babel');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rbabel_pass'])) {
|
|
|
|
|
config_update_value ( 'rbabel_pass', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rintegria_server'])) {
|
|
|
|
|
config_update_value ( 'rintegria_server', 'localhost');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rintegria_port'])) {
|
|
|
|
|
config_update_value ( 'rintegria_port', 3306);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rintegria_dbname'])) {
|
|
|
|
|
config_update_value ( 'rintegria_dbname', 'integria');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rintegria_user'])) {
|
|
|
|
|
config_update_value ( 'rintegria_user', 'integria');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['rintegria_pass'])) {
|
|
|
|
|
config_update_value ( 'rintegria_pass', '');
|
|
|
|
|
}
|
|
|
|
@ -624,9 +618,31 @@ function config_process_config () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset ($config['relative_path']) && (isset ($_POST['nick']) || isset ($config['id_user'])) && isset($config['enterprise_installed'])) {
|
|
|
|
|
|
|
|
|
|
$isFunctionSkins = enterprise_include_once ('include/functions_skins.php');
|
|
|
|
|
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
|
if(isset($config['id_user']))
|
|
|
|
|
if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
|
|
|
|
|
|
// Try to update user table in order to refresh skin inmediatly
|
|
|
|
|
$is_user_updating = get_parameter("sec2", "");
|
|
|
|
|
|
|
|
|
|
if ($is_user_updating == 'operation/users/user_edit') {
|
|
|
|
|
$id = get_parameter_get ("id", $config["id_user"]); // ID given as parameter
|
|
|
|
|
$user_info = get_user_info ($id);
|
|
|
|
|
|
|
|
|
|
//If current user is editing himself or if the user has UM (User Management) rights on any groups the user is part of AND the authorization scheme allows for users/admins to update info
|
|
|
|
|
if (($config["id_user"] == $id || check_acl ($config["id_user"], users_get_groups ($id), "UM")) && $config["user_can_update_info"]) {
|
|
|
|
|
$view_mode = false;
|
|
|
|
|
} else {
|
|
|
|
|
$view_mode = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset ($_GET["modified"]) && !$view_mode) {
|
|
|
|
|
$upd_info["id_skin"] = get_parameter ("skin", $user_info["id_skin"]);
|
|
|
|
|
$return_update_skin = update_user ($id, $upd_info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($config['id_user']))
|
|
|
|
|
$relative_path = enterprise_hook('skins_set_image_skin_path',array($config['id_user']));
|
|
|
|
|
else
|
|
|
|
|
$relative_path = enterprise_hook('skins_set_image_skin_path',array($_POST['nick']));
|
|
|
|
@ -646,35 +662,11 @@ function config_process_config () {
|
|
|
|
|
config_update_value ('refr', '');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['agent_size_text_small'])) {
|
|
|
|
|
config_update_value ('agent_size_text_small', 15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['agent_size_text_medium'])) {
|
|
|
|
|
config_update_value ('agent_size_text_medium', 50);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['module_size_text_small'])) {
|
|
|
|
|
config_update_value ('module_size_text_small', 15);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['module_size_text_medium'])) {
|
|
|
|
|
config_update_value ('module_size_text_medium', 50);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['description_size_text'])) {
|
|
|
|
|
config_update_value ('description_size_text', 50);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isset($config['item_title_size_text'])) {
|
|
|
|
|
config_update_value ('item_title_size_text', 40);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Finally, check if any value was overwritten in a form */
|
|
|
|
|
config_update_config();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function config_check () {
|
|
|
|
|
function config_check (){
|
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
|
|
// At this first version I'm passing errors using session variables, because the error management
|
|
|
|
@ -773,7 +765,7 @@ function config_check () {
|
|
|
|
|
'no_close' => true, 'force_style' => 'color: #000000 !important'), '', true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pandora_update_manager_login();
|
|
|
|
|
//pandora_update_manager_login();
|
|
|
|
|
if (isset($_SESSION['new_update'])) {
|
|
|
|
|
if (!empty($_SESSION['return_installation_open'])) {
|
|
|
|
|
if (!$_SESSION['return_installation_open']['return']) {
|
|
|
|
|