1. Added a bit more checking to the rcmd thing to make more sure that this
[spider.git] / cmd / set / lockout.pl
1 #
2 # lock a user out
3 #
4 # Copyright (c) 1998 Iain Phillips G0RDI
5 #
6 # $Id$
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 return (1, $self->msg('e5')) if $self->priv < 9;
17
18 foreach $call (@args) {
19         $call = uc $call;
20         unless ($self->remotecmd) {
21                 if ($ref = DXUser->get_current($call)) {
22                         $ref->lockout(1);
23                         $ref->put();
24                         push @out, $self->msg("lockout", $call);
25                 } else {
26                         $ref = DXUser->new($call);
27                         $ref->lockout(1);
28                         $ref->put();
29                         push @out, $self->msg("lockoutc", $call);
30                 }
31         } else {
32                 push @out, $self->msg('sorry');
33         }
34 }
35 return (1, @out);