Modified:
/trunk/lib/Gantry/Plugins/AuthCookie.pm
=======================================
--- /trunk/lib/Gantry/Plugins/AuthCookie.pm Thu Feb 17 12:11:00 2011
+++ /trunk/lib/Gantry/Plugins/AuthCookie.pm Thu Feb 17 12:43:55 2011
@@ -2,6 +2,7 @@
use strict; use warnings;
use Gantry::Utils::HTML qw( :all );
+use Gantry::Utils::Crypt;
use Crypt::CBC;
use MIME::Base64;
@@ -824,10 +825,10 @@
}
else {
eval {
+
my $password_field = $self->auth_password_field();
my $password_to_auth;
- if($self->auth_password_encryption(){
- require Gantry::Utils::Crypt;
+ if($self->auth_password_encryption()){
my $salt = $self->auth_password_salt ||
$self->auth_secret();
my $crypt_obj = Gantry::Utils::Crypt->new(
{ 'secret' => $salt }
@@ -838,7 +839,10 @@
$password_to_auth = $in{'password'};
}
- my $sch = $self->get_auth_schema();
+ my $sch = $self->can( 'get_auth_schema' )
+ ? $self->get_auth_schema()
+ : $self->get_schema();
+
my $row = $sch->resultset( $self->auth_table() )->search( {
$self->auth_user_field() => $in{username},
} )->next;