X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fspoof.pl;h=d4be673fbb24a5d905785710a73a5697730f6cb0;hb=4b207544da78b182bd12e94eab01451694749012;hp=8c8fda85c6b516afc3d769eb6e4a4c38a085c5cc;hpb=a453254d687774f352822492d500330a09fd7ebe;p=spider.git diff --git a/cmd/spoof.pl b/cmd/spoof.pl index 8c8fda85..d4be673f 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -10,11 +10,12 @@ my ($self, $line) = @_; my $mycall = $self->call; my $myuser = $self->user; +my $mylang = $self->lang; my ($call, $newline) = split /\s+/, $line, 2; -return (1, $self->msg('nodee1', $call)) if DXChannel->get($call); +return (1, $self->msg('nodee1', $call)) if DXChannel::get($call); -if ($self->remotecmd) { +if ($self->remotecmd || $self->inscript) { Log('DXCommand', "$mycall is trying to spoof $call remotely"); return (1, $self->msg('e5')); } @@ -25,7 +26,7 @@ if ($self->priv < 9) { my @out; $call = uc $call; -my $user = DXUser->get($call); +my $user = DXUser::get_current($call); unless ($user) { $user = DXUser->new($call); push @out, $self->msg('spf1', $call); @@ -34,10 +35,12 @@ unless ($user) { # set up basic environment $self->call($call); $self->user($user); -Log('DXCommand', "spoof '$newline' as $call by $mycall"); +my $addr = $self->hostname || '127.0.0.1'; +Log('cmd', "$self->{call}|$addr|spoof|$line"); my @in = $self->run_cmd($newline); push @out, map {"spoof $call: $_"} @in; $self->call($mycall); $self->user($myuser); +$self->lang($mylang); return (1, @out);