5 use Apache2
::Authen
::Passphrase qw
/pwset USER_REGEX/;
7 use IO
::Prompter
[qw
/-e* -stdio/];
9 die "Usage: aap-passwd [rootdir] username\n" unless $#ARGV >= 0 && $#ARGV <= 1;
10 ($Apache2::Authen
::Passphrase
::rootdir
) = (shift =~ /(.*)/) if $#ARGV == 1;
13 die "Invalid username" unless $username =~ USER_REGEX
;
14 ($username) = ($username =~ /(.*)/);
16 my $passwd = prompt
'Enter new Apache2::Authen::Passphrase password: ';
17 my $confirm = prompt
'Retype new Apache2::Authen::Passphrase password: ';
19 die "Sorry, passwords do not match\n" unless $passwd eq $confirm;
20 pwset
$username, $passwd;
21 say "Password updated successfully";
27 aap-passwd - passwd utility for Apache2::Authen::Passphrase
31 user@hostname:~$ aap-passwd /path/to/rootdir marius
32 Enter new Apache2::Authen::Passphrase password: ***
33 Retype new Apache2::Authen::Passphrase password: ***
34 Password updated successfully
38 aap-passwd updates the password of an Apache2::Authen::Passphrase user.
42 aap-passwd /path/to/rootdir username
44 where the C<rootdir> is the first argument and the username whose password is to be changed is the second argument, or like this:
48 where the C<rootdir> is taken from the environment and the username is the only argument.
56 The default Apache2::Authen::Passphrase C<rootdir>, used if the C<rootdir> is not explicitly given.
62 Marius Gavrilescu C<< <marius@ieval.ro> >>
64 =head1 COPYRIGHT AND LICENSE
66 Copyright 2013 Marius Gavrilescu
68 This file is part of fonbotd.
70 fonbotd is free software: you can redistribute it and/or modify
71 it under the terms of the GNU Affero General Public License as published by
72 the Free Software Foundation, either version 3 of the License, or
73 (at your option) any later version.
75 fonbotd is distributed in the hope that it will be useful,
76 but WITHOUT ANY WARRANTY; without even the implied warranty of
77 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78 GNU Affero General Public License for more details.
80 You should have received a copy of the GNU Affero General Public License
81 along with fonbotd. If not, see <http://www.gnu.org/licenses/>
This page took 0.027508 seconds and 5 git commands to generate.