3 # pretend that you are another user, execute a command
4 # as that user, then send the output back to them.
6 # This is for educating users....
8 # Copyright (c) 2002 Dirk Koopman G1TLH
10 my ($self, $line) = @_;
12 my $mycall = $self->call;
13 my $myuser = $self->user;
14 my $mypriv = $self->priv;
16 my ($call, $newline) = split /\s+/, $line, 2;
18 my $dxchan = DXChannel->get($call);
20 return (1, $self->msg('e7', $call)) unless $dxchan;
21 if ($self->remotecmd) {
22 Log('DXCommand', "$mycall is trying to 'input' $call remotely");
23 return (1, $self->msg('e5'));
26 Log('DXCommand', "$mycall is trying to 'input' $call locally");
27 return (1, $self->msg('e5'));
31 my $user = $dxchan->user;
33 # set up basic environment
36 $self->priv($dxchan->priv);
37 Log('DXCommand', "input '$newline' as $call by $mycall");
38 my @in = $self->run_cmd($newline);
43 $dxchan->send($newline, @in);
45 return (1, map { "->$call: $_" } @in);