aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2011-03-14 20:54:51 +0100
committerStefan Kangas <skangas@skangas.se>2011-03-14 20:54:51 +0100
commit68708cd2430d4da548673fd612c891413448fddf (patch)
tree3c0864376422afebb9dc048a113ce4b7839f3dd3 /lib
parentc6d17eebc6f40188a33fa8aca863129ed57868e9 (diff)
Send password with credentials mail
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Fripost/Prompt.pm2
-rw-r--r--lib/Fripost/Schema/Result/Mailbox.pm18
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/Fripost/Prompt.pm b/lib/Fripost/Prompt.pm
index 03c5fc4..b41f806 100755
--- a/lib/Fripost/Prompt.pm
+++ b/lib/Fripost/Prompt.pm
@@ -82,7 +82,7 @@ sub prompt_password {
);
say "Using password: $password";
}
- return smd5($password);
+ return $password;
}
=head1 AUTHOR
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 -