Merged two branches into one

Former-commit-id: 1e15cd80a5ef0a03834c4d835c7ff0fe77b4c7e0
This commit is contained in:
samucarc 2019-01-21 18:41:46 +01:00
parent 5ecc9276e0
commit 75dc82f42f
1 changed files with 17 additions and 0 deletions

View File

@ -183,6 +183,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', '<user_name>', 'Disable the double authentication for the specified user');
help_screen_line('--meta_synch_user', "<user_name1,user_name2..> <server_name> [<profile_mode> <group_name>\n\t <profile1,profile2..> <create_groups>]", 'Synchronize metaconsole users');
print "\nEVENTS:\n\n" unless $param ne '';
help_screen_line('--create_event', "<event> <event_type> <group_name> [<agent_name> <module_name>\n\t <event_status> <severity> <template_name> <user_name> <comment> \n\t <source> <id_extra> <tags> <critical_instructions> <warning_instructions> <unknown_instructions> \n\t <custom_data_json> <force_create_agent>]", 'Add event');
help_screen_line('--validate_event', "<agent_name> <module_name> <datetime_min> <datetime_max>\n\t <user_name> <criticity> <template_name>", 'Validate events');
@ -4445,6 +4446,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
@ -5696,6 +5709,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();