Subversion Repositories camp_sysinfo_client_3

Rev

Rev 104 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 104 Rev 108
Line 65... Line 65...
65
 
65
 
66
sub setUpTransport {
66
sub setUpTransport {
67
   my ($priority, $transport, $fields, $type ) = @_;
67
   my ($priority, $transport, $fields, $type ) = @_;
68
   $priority = getAnswer( 'Priority', $priority );
68
   $priority = getAnswer( 'Priority', $priority );
69
   $$transport{'sendScript'} = $$fields{'sendScript'} unless $$transport{'sendScript'};
69
   $$transport{'sendScript'} = $$fields{'sendScript'} unless $$transport{'sendScript'};
70
   $$transport{'-name-'} = $type unless $$transport{'-name-'};
70
   $$transport{'name'} = $type unless $$transport{'name'};
71
   my $allKeys = $$fields{'keys'};
71
   my $allKeys = $$fields{'keys'};
72
   foreach my $key ( @$allKeys ) {
72
   foreach my $key ( @$allKeys ) {
73
      if ( $key eq 'sendEmailScriptLocation' && ! -e $$transport{$key} ) {
73
      if ( $key eq 'sendEmailScriptLocation' && ! -e $$transport{$key} ) {
74
         my $temp = &findSendEmail( $$transport{$key} );
74
         my $temp = &findSendEmail( $$transport{$key} );
75
         $$transport{$key} = $temp if $temp;
75
         $$transport{$key} = $temp if $temp;
Line 87... Line 87...
87
   }
87
   }
88
}   
88
}   
89
 
89
 
90
sub showTransports {
90
sub showTransports {
91
   my ( $priority,$thisOne )  = @_;
91
   my ( $priority,$thisOne )  = @_;
92
   print $$thisOne{'-name-'} . " has priority $priority\n";
92
   print $$thisOne{'name'} . " has priority $priority\n";
93
   foreach my $key ( sort keys %$thisOne ) {
93
   foreach my $key ( sort keys %$thisOne ) {
94
      next if $key =~ m/^-.*-$/;
94
      next if $key =~ m/^-.*-$/;
95
      print "$key = $$thisOne{$key}\n";
95
      print "$key = $$thisOne{$key}\n";
96
   }
96
   }
97
}
97
}
98
 
98
 
99
sub doTransports {
99
sub doTransports {
100
   my ( $transports ) = @_;
100
   my ( $transports ) = @_;
101
   
101
   
102
   foreach my $priority ( sort { $a <=> $b } keys %$transports ) {
102
   foreach my $priority ( sort { $a <=> $b } keys %$transports ) {
103
      if ( &yesno( $$transports{$priority}{'-name-'} . " has a priority of $priority, edit it?") ) {
103
      if ( &yesno( $$transports{$priority}{'name'} . " has a priority of $priority, edit it?") ) {
104
         #print Dumper( $sendTypes{$$transports{$priority}{'-name-'}} );
104
         #print Dumper( $sendTypes{$$transports{$priority}{'name'}} );
105
         #die;
105
         #die;
106
         my ( $newpriority,$temp ) = &setUpTransport( $priority, $$transports{$priority}, $sendTypes{$$transports{$priority}{'-name-'}} );
106
         my ( $newpriority,$temp ) = &setUpTransport( $priority, $$transports{$priority}, $sendTypes{$$transports{$priority}{'name'}} );
107
         if ( $newpriority != $priority ) {
107
         if ( $newpriority != $priority ) {
108
            delete $$transports{$priority};
108
            delete $$transports{$priority};
109
            $priority = $newpriority;
109
            $priority = $newpriority;
110
         }
110
         }
111
         $$transports{$priority} = $temp;
111
         $$transports{$priority} = $temp;