]> scm.dxcluster.org Git - spider.git/blob - cmd/set/lockout.pl
fix EOF detection of incoming nodes
[spider.git] / cmd / set / lockout.pl
1 #
2 # lock a user out
3 #
4 # Copyright (c) 1998 Iain Phillips G0RDI
5 #
6 #
7 #
8 my ($self, $line) = @_;
9 my @args = split /\s+/, $line;
10 my $call;
11 # my $priv = shift @args;
12 my @out;
13 my $user;
14 my $ref;
15
16 if ($self->priv < 9) {
17         Log('DXCommand', $self->call . " attempted to lockout @args");
18         return (1, $self->msg('e5'));
19 }
20
21 foreach $call (@args) {
22         $call = uc $call;
23         unless ($self->remotecmd || $self->inscript) {
24                 if ($ref = DXUser::get_current($call)) {
25                         $ref->lockout(1);
26                         $ref->put();
27                         push @out, $self->msg("lockout", $call);
28                 } else {
29                         $ref = DXUser->new($call);
30                         $ref->lockout(1);
31                         $ref->put();
32                         push @out, $self->msg("lockoutc", $call);
33                 }
34                 Log('DXCommand', $self->call . " locked out $call");
35         } else {
36                 Log('DXCommand', $self->call . " attempted to lockout $call remotely");
37                 push @out, $self->msg('sorry');
38         }
39 }
40 return (1, @out);