X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cmd%2Funset%2Fpassword.pl;fp=cmd%2Funset%2Fpassword.pl;h=6fdc92576e9e3ff27d4496289cd4edcf4e8f1813;hb=9971e7bd96ea646b7921528a2f74edca508a5dc1;hp=0000000000000000000000000000000000000000;hpb=299bbec5a5628c3333cdf4ed45fed3e0c21ca753;p=spider.git diff --git a/cmd/unset/password.pl b/cmd/unset/password.pl new file mode 100644 index 00000000..6fdc9257 --- /dev/null +++ b/cmd/unset/password.pl @@ -0,0 +1,37 @@ +# +# unset a user's password +# +# Copyright (c) 2001 Dirk Koopman G1TLH +# +# Syntax: unset/pass ... +# + +my ($self, $line) = @_; +my @args = split /\s+/, $line; +my @out; +my $user; +my $ref; + +if ($self->remotecmd) { + Log('DXCommand', $self->call . " attempted to unset password for @args remotely"); + return (1, $self->msg('e5')); +} + +if ($self->priv < 9) { + Log('DXCommand', $self->call . " attempted to unset password for @args"); + return (1, $self->msg('e5')); +} + +for (@args) { + my $call = uc $_; + if ($ref = DXUser->get_current($call)) { + $ref->unset_passwd; + $ref->put(); + push @out, $self->msg("passwordu", $call); + Log('DXCommand', $self->call . " unset password for $call"); + } else { + push @out, $self->msg('e3', 'User record for', $call); + } +} + +return (1, @out);