diff options
author | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2007-09-12 18:11:34 +0000 |
---|---|---|
committer | matthewt <matthewt@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7> | 2007-09-12 18:11:34 +0000 |
commit | 7adfd53f17f66ffe93763e944ed1d3fc52a369dc (patch) | |
tree | 19e599e74419b41cbbe651fd226b81e8b73551d3 /lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm | |
parent | c728c97cb1061330e63c7cc048e768ef74988fe6 (diff) | |
download | reaction-7adfd53f17f66ffe93763e944ed1d3fc52a369dc.tar.gz reaction-7adfd53f17f66ffe93763e944ed1d3fc52a369dc.zip |
moved shit to trunk
Diffstat (limited to 'lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm')
-rw-r--r-- | lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm b/lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm new file mode 100644 index 0000000..649f76a --- /dev/null +++ b/lib/Reaction/InterfaceModel/Action/User/Role/ConfirmationCodeSupport.pm @@ -0,0 +1,44 @@ +package Reaction::InterfaceModel::Action::User::Role::ConfirmationCodeSupport; + +use Reaction::Role; +use Digest::MD5; + +role ConfirmationCodeSupport, which{ + + #requires qw/target_model ctx/; + + implements generate_confirmation_code => as { + my $self = shift; + my $ident = $self->target_model->identity_string. + $self->target_model->password; + my $secret = $self->ctx->config->{confirmation_code_secret}; + die "Application config does not define confirmation_code_secret" + unless $secret; + return Digest::MD5::md5_hex($secret.$ident); + }; + +}; + +1; + +=head1 NAME + +Reaction::InterfaceModel::Action::User::Role::ConfirmationCodeSupport + +=head1 DESCRIPTION + +=head2 generate_confirmation_code + +=head2 meta + +Need to define confirmation_code_secret in application config. + +=head1 AUTHORS + +See L<Reaction::Class> for authors. + +=head1 LICENSE + +See L<Reaction::Class> for the license. + +=cut |