]> iEval git - gruntmaster-page.git/blame_incremental - lib/Gruntmaster/Page/Passwd.pm
Add ranks to standings and reduce warnings
[gruntmaster-page.git] / lib / Gruntmaster / Page / Passwd.pm
... / ...
CommitLineData
1package Gruntmaster::Page::Passwd;
2
3use 5.014000;
4use strict;
5use warnings;
6use Gruntmaster::Page::Base;
7our @ISA = qw/Gruntmaster::Page::Base/;
8our $VERSION = '0.001';
9
10use Apache2::Authen::Passphrase qw/pwcheck pwset/;
11use Plack::Request;
12
13sub generate{
14 my ($self, $format, $env) = @_;
15 my $r = Plack::Request->new($env);
16 my ($oldpass, $newpass, $confirm) = map {scalar $r->param($_)} 'password', 'new_password', 'confirm_new_password';
17
18 return reply 'Incorrect password' unless eval { pwcheck $r->user, $oldpass; 1 };
19 return reply 'The two passwords do not match' unless $newpass eq $confirm;
20
21 pwset $r->user, $newpass;
22 reply 'Password changed successfully';
23}
24
25sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
26
271
This page took 0.01723 seconds and 4 git commands to generate.