<%attr> http_title =>'Admin Widget' widget_title =>'Change Password'
<% $title %>
New Password: Confirm Password:
<%init> if ( $form eq $m->current_comp->name ) { if ( defined $password && defined $password_confirm ) { if ( $password eq $password_confirm ) { $dbh->do( qq{UPDATE users SET "password" = ? WHERE "pkid" = ? }, {}, sha1_base64($password), $S->{'pkid'} ); $title .= " || You have changed your password.", print $S->{pkid}; } else { $title .= " || Passwords do not match."; } } else { $title .= " || Not enough information."; } } <%shared> use Digest::SHA1 q/sha1_base64/; my $title = $m->current_comp->attr('widget_title'); <%args> $S $password_confirm => $m->caller_args(1)->{'password'} || undef $password => $m->caller_args(1)->{'password_confirm'} || undef $form => $m->caller_args(1)->{'form'} || undef