added set/password
[spider.git] / cmd / set / password.pl
1 #
2 # set a user's password
3 #
4 # Copyright (c) 1998 Iain Phillips G0RDI
5 # 21-Dec-1998
6 #
7 # Syntax:       set/pass <password> <callsign>
8 #
9
10 my ($self, $line) = @_;
11 my @args = split /\s+/, $line;
12 my $call;
13 my $pass = shift @args;
14 my @out;
15 my $user;
16 my $ref;
17
18 return (1, $self->msg('e5')) if $self->priv < 9;
19
20 foreach $call (@args) {
21         $call = uc $call;
22         if ($ref = DXUser->get_current($call)) {
23                 $ref->passwd($pass);
24                 $ref->put();
25                 push @out, $self->msg("password", $call);
26         } else {
27                 push @out, $self->msg('e3', 'User record for', $call);
28         }
29 }
30 return (1, @out);