%args> $recaptcha_challenge_field => undef $recaptcha_response_field => undef $current => undef $new1 => undef $new2 => undef %args> <%perl> #print "
$current, $new1, $new2\n"; if( ! defined($session{'userid'}) ) { %perl> Bad User!
You can't change your password if you're not logged in!
<%perl> } else { unless( defined($new2) && defined($new1) && defined($current) ) { %perl> Password Change$current_check\n"; if ( $current_check && ($new1 eq $new2) ) { %perl> Password Changed <%perl> # Munge it the same way the login form does my $dbpassword = $new1; $dbpassword =~ y/A-Za-z/N-ZA-Mn-za-m/; $dbh->do("UPDATE users SET password = ? WHERE userid = ?", undef, md5_hex($dbpassword), $current_check ); } else { if( $result->{is_valid} ) { %perl> ReCaptcha correct, but input invalid, sorry. Try again. <%perl> } else { %perl> ReCaptcha failed, sorry. Try again. <%perl> } } } } %perl> <%method title> Password Change %method> <%init> our($dbh,%session); use utils; use Unicode::String; use Digest::MD5 qw(md5_hex); $r->content_type("text/html; charset=utf-8"); use Captcha::reCAPTCHA; my $c = Captcha::reCAPTCHA->new; %init>