From 68708cd2430d4da548673fd612c891413448fddf Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 14 Mar 2011 20:54:51 +0100 Subject: Send password with credentials mail --- lib/Fripost/Schema/Result/Mailbox.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lib/Fripost/Schema') diff --git a/lib/Fripost/Schema/Result/Mailbox.pm b/lib/Fripost/Schema/Result/Mailbox.pm index f12e1f7..48d81fb 100644 --- a/lib/Fripost/Schema/Result/Mailbox.pm +++ b/lib/Fripost/Schema/Result/Mailbox.pm @@ -6,6 +6,8 @@ use strict; use base qw/DBIx::Class::Core/; +use Fripost::Password; + # mysql> describe mailbox; # +-------------+--------------+------+-----+---------------------+-------+ # | Field | Type | Null | Key | Default | Extra | @@ -32,6 +34,22 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key('username'); +=head2 store_column + +override store_column to encrypt the password when stored + +=cut + +sub store_column { + my ($self, $col, $val) = @_; + + if ($col eq 'password') { + $val = smd5($val); + } + + return $self->next::method($col,$val); +} + =head1 NAME Fripost::Schema::Result::Mailbox - -- cgit v1.2.3