1c248d023576fc8bac0cc9cee1fb288b3bc361b2
[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 <callsign> <password> 
8 #
9
10 my ($self, $line) = @_;
11 my @args = split /\s+/, $line;
12 my $call = shift @args;
13 my @out;
14 my $user;
15 my $ref;
16
17 return (1, $self->msg('e5')) if $self->priv < 9;
18
19 if ($ref = DXUser->get_current($call)) {
20         $line =~ s/^\s*$call\s+//;
21         $line =~ s/\s+//og;                    # remove any blanks
22         $line =~ s/[{}]//g;   # no braces allowed
23         $ref->passwd($line);
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);