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",