Started on the dx cluster database stuff
[spider.git] / cmd / show / channel.pl
1 #
2 # show the channel status
3 #
4 # $Id$
5 #
6
7 my $self = shift;
8 #return (0) if ($self->priv < 9); # only console users allowed
9 my @list = split;                 # generate a list of callsigns
10 @list = ($self->call) if !@list;  # my channel if no callsigns
11
12 my $call;
13 my @out;
14 foreach $call (@list) {
15   my $ref = DXChannel->get($call);
16   return (0, "Channel: $call not found") if !$ref;
17
18   my @fields = $ref->fields;
19   my $field;
20   push @out, "User Information $call";
21   foreach $field (@fields) {
22     my $prompt = $ref->field_prompt($field);
23     my $val = $ref->{$field};
24     push @out, "$prompt: $val";
25   } 
26 }
27
28 return (1, @out);
29
30