X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fpassword.pl;h=1c248d023576fc8bac0cc9cee1fb288b3bc361b2;hb=6624dcdf07d628e8d6a16fc6549edf40be25b7b2;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=cce161221036760959ff1d0b7628a55942bf558a;p=spider.git diff --git a/cmd/set/password.pl b/cmd/set/password.pl index e69de29b..1c248d02 100644 --- a/cmd/set/password.pl +++ b/cmd/set/password.pl @@ -0,0 +1,30 @@ +# +# set a user's password +# +# Copyright (c) 1998 Iain Phillips G0RDI +# 21-Dec-1998 +# +# Syntax: set/pass +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my $call = shift @args; +my @out; +my $user; +my $ref; + +return (1, $self->msg('e5')) if $self->priv < 9; + +if ($ref = DXUser->get_current($call)) { + $line =~ s/^\s*$call\s+//; + $line =~ s/\s+//og; # remove any blanks + $line =~ s/[{}]//g; # no braces allowed + $ref->passwd($line); + $ref->put(); + push @out, $self->msg("password", $call); +} else { + push @out, $self->msg('e3', 'User record for', $call); +} + +return (1, @out);