aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Fripost/Schema/Result
diff options
context:
space:
mode:
authorGustav Eek <gustaveek@student.gu.se>2011-03-14 20:54:34 +0100
committerGustav Eek <gustaveek@student.gu.se>2011-03-14 20:54:34 +0100
commit16ed1260dd2433d9c25cd550a06c175093416f58 (patch)
treec1caa0838e48db7a3b196186e2b8291facf4060f /lib/Fripost/Schema/Result
parent0df2709e4588f653fa680f4820dd2d696749723f (diff)
parent68708cd2430d4da548673fd612c891413448fddf (diff)
Merge branch 'master' of https://github.com/skangas/fripost-tools
Diffstat (limited to 'lib/Fripost/Schema/Result')
-rw-r--r--lib/Fripost/Schema/Result/Mailbox.pm18
1 files changed, 18 insertions, 0 deletions
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 -