diff --git a/pandora_console/include/functions_api.php b/pandora_console/include/functions_api.php index 8ec920530a..db050245fa 100644 --- a/pandora_console/include/functions_api.php +++ b/pandora_console/include/functions_api.php @@ -7036,9 +7036,9 @@ function api_get_graph_module_data($id, $thrash1, $other, $thrash2) { function api_set_new_user($id, $thrash2, $other, $thrash3) { global $config; - if (defined ('METACONSOLE')) { - return; - } + // if (defined ('METACONSOLE')) { + // return; + // } if(!check_acl($config['id_user'], 0, "UM")) { returnError('forbidden', 'string'); @@ -7055,6 +7055,10 @@ function api_set_new_user($id, $thrash2, $other, $thrash3) { $values['phone'] = $other['data'][6]; $values['language'] = $other['data'][7]; $values['comments'] = $other['data'][8]; + $values['time_autorefresh'] = $other['data'][9]; + $values['default_event_filter'] = $other['data'][10]; + $values['section'] = $other['data'][11]; + $values['session_time'] = $other['data'][12]; if (!create_user ($id, $password, $values)) returnError('error_create_user', 'Error create user'); @@ -7098,7 +7102,12 @@ function api_set_update_user($id, $thrash2, $other, $thrash3) { 'language', 'comments', 'is_admin', - 'block_size' + 'block_size', + 'flash_chart', + 'time_autorefresh', + 'default_event_filter', + 'section', + 'session_time' ); if ($id == "") { @@ -8809,9 +8818,9 @@ function api_get_events($trash1, $trash2, $other, $returnType, $user_in_db = nul function api_set_delete_user($id, $thrash1, $thrash2, $thrash3) { global $config; - if (defined ('METACONSOLE')) { - return; - } + // if (defined ('METACONSOLE')) { + // return; + // } if (!check_acl($config['id_user'], 0, "UM")) { returnError('forbidden', 'string'); @@ -12883,4 +12892,29 @@ function api_get_session_timeout($thrash1, $thrash2, $other, $thrash3) { } } +function api_get_users($thrash1, $thrash2, $other, $returnType) { + + global $config; + + $user_info = get_users(); + + if (!isset($returnType) || empty($returnType) || $returnType == '') { + $returnType = "json"; + $data['data'] = "json"; + } + + if (!isset($separator) || empty($separator) || $separator == '') { + $separator = ";"; + } + + $data['data'] = $user_info; + + if (count($data) > 0 and $data !== false) { + returnData($returnType, $data, $separator); + } + else { + returnError('error_users', 'No users retrieved.'); + } + + } ?> diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 1158112fa9..d924a9b98e 100644 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -187,6 +187,7 @@ sub help_screen{ help_screen_line('--disable_eacl', '', 'Disable enterprise ACL system'); help_screen_line('--enable_eacl', '', 'Enable enterprise ACL system'); help_screen_line('--disable_double_auth', '', 'Disable the double authentication for the specified user'); + help_screen_line('--meta_synch_user', " [ \n\t ]", 'Synchronize metaconsole users'); print "\nEVENTS:\n\n" unless $param ne ''; help_screen_line('--create_event', " [ \n\t \n\t \n\t ]", 'Add event'); help_screen_line('--validate_event', " \n\t ", 'Validate events'); @@ -4541,6 +4542,18 @@ sub cli_disable_double_auth () { exit; } +############################################################################### +# Synchronize metaconsole users +# Related option: --meta_synch_user +############################################################################### +sub cli_meta_synch_user() { + my ($user_name,$server_name,$profile_mode,$group,$profiles,$create_groups) = @ARGV[2..7]; + + my $result = api_call(\%conf,'set', 'meta_synch_user', undef, undef, "$user_name|$server_name|$profile_mode|$group|$profiles|$create_groups"); + print "$result \n\n "; + +} + ############################################################################### # Enable user # Related option: --enable_user @@ -5792,6 +5805,10 @@ sub pandora_manage_main ($$$) { param_check($ltotal, 1); cli_disable_double_auth(); } + elsif ($param eq '--meta_synch_user') { + param_check($ltotal, 6, 4); + cli_meta_synch_user(); + } elsif ($param eq '--disable_group') { param_check($ltotal, 1); cli_disable_group();