spider/cmd/spoof.pl
minima 6c38bca91e 1. added wantgrid (to control display of grid square info on DX Broadcasts)
2. added lastoper for controlling periodic demands for user info from other
nodes.
3. added spiderFAQ stuff from Ian G0VGS and latest update of the admin manual
4. changed updating and deleting from user file in an attempt to keep down
duplicates and possibly corruptions.
5. added a DXUser::export routine to allow the cluster to automatically
export the user data in ascii from cron.
6. added a line in the ISSUED crontab to do the export once a week
7. delete annok and dxok if set to 1 in user records.
8. added export_users command to allow arbitary exporting of user files
9. added set and unset/dxgrid command to allow control over the grid squares
on DX announcements
10. removed export_user.pl from /spider/perl
2000-07-26 12:08:09 +00:00

44 lines
1.0 KiB
Perl

#!/usr/bin/perl
#
# pretend that you are another user, useful for reseting
# those silly things that people insist on getting wrong
# like set/homenode et al
#
# Copyright (c) 1999 Dirk Koopman G1TLH
#
my ($self, $line) = @_;
my $mycall = $self->call;
my $myuser = $self->user;
my ($call, $newline) = split /\s+/, $line, 2;
return (1, $self->msg('nodee1', $call)) if DXChannel->get($call);
if ($self->remotecmd) {
Log('DXCommand', "$mycall is trying to spoof $call remotely");
return (1, $self->msg('e5'));
}
if ($self->priv < 9) {
Log('DXCommand', "$mycall is trying to spoof $call locally");
return (1, $self->msg('e5'));
}
my @out;
$call = uc $call;
my $user = DXUser->get_current($call);
unless ($user) {
$user = DXUser->new($call);
push @out, $self->msg('spf1', $call);
}
# set up basic environment
$self->call($call);
$self->user($user);
Log('DXCommand', "spoof '$newline' as $call by $mycall");
my @in = $self->run_cmd($newline);
push @out, map {"spoof $call: $_"} @in;
$self->call($mycall);
$self->user($myuser);
return (1, @out);