Change DXUser->get* to DXUser::get*
[spider.git] / cmd / unset / password.pl
1 #
2 # unset a user's password
3 #
4 # Copyright (c) 2001 Dirk Koopman G1TLH
5 #
6 # Syntax:       unset/pass <callsign> ... 
7 #
8
9 my ($self, $line) = @_;
10 my @args = split /\s+/, $line;
11 my @out;
12 my $user;
13 my $ref;
14
15 if ($self->remotecmd || $self->inscript) {
16         Log('DXCommand', $self->call . " attempted to unset password for @args remotely");
17         return (1, $self->msg('e5'));
18 }
19
20 if ($self->priv < 9) {
21         Log('DXCommand', $self->call . " attempted to unset password for @args");
22         return (1, $self->msg('e5'));
23 }
24
25 for (@args) {
26         my $call = uc $_;
27         if ($ref = DXUser::get_current($call)) {
28                 $ref->unset_passwd;
29                 $ref->put();
30                 push @out, $self->msg("passwordu", $call);
31                 Log('DXCommand', $self->call . " unset password for $call");
32         } else {
33                 push @out, $self->msg('e3', 'User record for', $call);
34         }
35 }
36
37 return (1, @out);