From 8f5278dc9bb1d995433b862bfdfcc2fe9d3c1333 Mon Sep 17 00:00:00 2001 From: Lars Dieckow Date: Thu, 23 May 2013 17:03:07 +0200 Subject: [PATCH] manually add component for MD5 hashed passwords --- Build.PL | 1 + lib/NGCP/Schema/billing/Result/admins.pm | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Build.PL b/Build.PL index 42370a37..f4b46917 100644 --- a/Build.PL +++ b/Build.PL @@ -7,6 +7,7 @@ my $builder = Module::Build->new( requires => { 'aliased' => 0, 'DBD::mysql' => 0, + 'DBIx::Class::EncodedColumn' => 0, 'DBIx::Class::Schema::Loader' => 0, 'File::Path' => 0, 'Getopt::Long' => 0, diff --git a/lib/NGCP/Schema/billing/Result/admins.pm b/lib/NGCP/Schema/billing/Result/admins.pm index db07f5c6..f6a37e37 100644 --- a/lib/NGCP/Schema/billing/Result/admins.pm +++ b/lib/NGCP/Schema/billing/Result/admins.pm @@ -11,7 +11,7 @@ our $VERSION = '1.001'; extends 'DBIx::Class::Core'; -__PACKAGE__->load_components("InflateColumn::DateTime"); +__PACKAGE__->load_components("InflateColumn::DateTime", "EncodedColumn"); __PACKAGE__->table("admins"); @@ -35,7 +35,15 @@ __PACKAGE__->add_columns( "login", { data_type => "varchar", is_nullable => 0, size => 31 }, "md5pass", - { data_type => "char", is_nullable => 1, size => 32 }, + { + data_type => "char", + is_nullable => 1, + size => 32, + encode_column => 1, + encode_class => 'Digest', + encode_args => {algorithm => 'MD5', format => 'hex'}, + encode_check_method => 'check_password', + }, "is_master", { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "is_superuser",