6 # Copyright (c) Dirk Koopman, G1TLH
20 use vars qw(@ISA %pings);
28 if ($self->{to} eq $main::mycall) {
31 my $cmd = $self->{content};
33 if ($self->{u} && $self->{u} eq $dxchan->call) { # online user or node
34 @in = (DXCommandmode::run_cmd($dxchan, $cmd));
37 my $ref = DXUser->get_current($self->{o});
38 my $cref = Route::Node::get($self->{o});
41 if ($cmd !~ /^\s*rcmd/i && $cref && $ref && $cref->call eq $ref->homenode) { # not allowed to relay RCMDS!
42 $self->{remotecmd} = 1; # for the benefit of any command that needs to know
43 my $oldpriv = $dxchan->{priv};
44 $dxchan->{priv} = $ref->{priv}; # assume the user's privilege level
45 @in = (DXCommandmode::run_cmd($dxchan, $cmd));
46 $dxchan->{priv} = $oldpriv;
47 delete $dxchan->{remotecmd};
52 Log('rcmd', 'in', $ref->{priv}, $self->{o}, "$self->{content}($answer)");
54 my $rep = DXXml::Text->new(u=>$self->{u}, to=>$self->{o}, content=>join('%0A', map {"$main::mycall:$_"} @in));
55 $rep->route($main::me); # because it's coming from me!
57 $self->route($dxchan);
65 my $ref = DXUser->get_current($self->{to});
68 if ($ref && $ref->is_clx && $self->{u}) {
69 $s = DXProt::pc84(($self->{o} || $main::mycall), $self->{to}, $self->{u}, $self->{content});
71 $s = DXProt::pc34(($self->{o} || $main::mycall), $self->{to}, $self->{content});
73 return $self->{'-pcxx'} = $s;