#8228 Fixed print_log
This commit is contained in:
parent
90739088f4
commit
f52dc0c319
|
@ -343,6 +343,23 @@ sub update_conf_txt ($$$$) {
|
|||
return $result;
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# PRINT HELP AND CHECK ERRORS FUNCTIONS
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# log wrapper
|
||||
###############################################################################
|
||||
sub print_log ($) {
|
||||
my ($msg) = @_;
|
||||
|
||||
print $msg; # show message
|
||||
|
||||
$msg =~ s/\n+$//;
|
||||
logger( $conf, "($progname) $msg", 10); # save to logging file
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Disable a entire group
|
||||
|
@ -759,11 +776,6 @@ sub pandora_validate_event_id ($$$) {
|
|||
sub pandora_update_user_from_hash ($$$$) {
|
||||
my ($parameters, $where_column, $where_value, $dbh) = @_;
|
||||
|
||||
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
|
||||
print_log "[ERROR] This node is configured with centralized mode. To update a user go to metaconsole. \n\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
my $user_id = db_process_update($dbh, 'tusuario', $parameters, {$where_column => $where_value});
|
||||
return $user_id;
|
||||
}
|
||||
|
@ -990,7 +1002,7 @@ sub pandora_get_calendar_id ($$) {
|
|||
sub pandora_get_same_day_id ($$) {
|
||||
my ($dbh, $same_day) = @_;
|
||||
|
||||
my $weeks = { 'monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8};
|
||||
my %weeks = ('monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8);
|
||||
|
||||
return defined ($weeks{$same_day}) ? $weeks{$same_day} : -1;
|
||||
}
|
||||
|
@ -1012,25 +1024,6 @@ sub pandora_delete_special_day ($$) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
# PRINT HELP AND CHECK ERRORS FUNCTIONS
|
||||
###############################################################################
|
||||
###############################################################################
|
||||
|
||||
###############################################################################
|
||||
# log wrapper
|
||||
###############################################################################
|
||||
sub print_log ($) {
|
||||
my ($msg) = @_;
|
||||
|
||||
print $msg; # show message
|
||||
|
||||
$msg =~ s/\n+$//;
|
||||
logger( $conf, "($progname) $msg", 10); # save to logging file
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Print a parameter error and exit the program.
|
||||
###############################################################################
|
||||
|
@ -3051,10 +3044,15 @@ sub cli_create_user() {
|
|||
|
||||
sub cli_user_update() {
|
||||
my ($user_id,$field,$new_value) = @ARGV[2..4];
|
||||
|
||||
|
||||
if(is_metaconsole($conf) != 1 && pandora_get_tconfig_token ($dbh, 'centralized_management', '')) {
|
||||
print_log "[ERROR] This node is configured with centralized mode. To update a user go to metaconsole. \n\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
my $user_exists = get_user_exists ($dbh, $user_id);
|
||||
exist_check($user_exists,'user',$user_id);
|
||||
|
||||
|
||||
if($field eq 'email' || $field eq 'phone' || $field eq 'is_admin' || $field eq 'language' || $field eq 'id_skin') {
|
||||
# Fields admited, no changes
|
||||
}
|
||||
|
@ -5537,7 +5535,7 @@ sub cli_get_agents() {
|
|||
|
||||
my $head_print = 0;
|
||||
|
||||
use Data::Dumper;
|
||||
# use Data::Dumper;
|
||||
|
||||
|
||||
foreach my $agent (@agents) {
|
||||
|
|
Loading…
Reference in New Issue