Change DXUser->get* to DXUser::get*
[spider.git] / cmd / unset / lockout.pl
1 #
2 # unlock a locked out user 
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 un-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(0);
26                         $ref->put();
27                         push @out, $self->msg("lockoutun", $call);
28                         Log('DXCommand', $self->call . " un-locked out $call");
29                 } else {
30                         push @out, $self->msg('e3', 'unset/lockout', $call);
31                 }
32         } else {
33                 Log('DXCommand', $self->call . " attempted to un-lockout $call remotely");
34                 push @out, $self->msg('sorry');
35         }
36 }
37 return (1, @out);