Commit ea87834a authored by Clément OUDOT's avatar Clément OUDOT
Browse files

Do not build Captcha Session ID with Captcha Code (#1567)

parent 6ecc36c0
......@@ -6,7 +6,7 @@
package Lemonldap::NG::Common::Captcha;
our $VERSION = '1.9.15';
our $VERSION = '1.9.19';
use strict;
use Lemonldap::NG::Common::Session;
......@@ -44,12 +44,10 @@ sub BUILD {
# Generate code and md5
my $code = $captcha->generate_random_string( $self->size );
my $md5 = md5_hex($code);
$self->code($code);
$self->md5($md5);
# Generate image data
my $data = $captcha->create_image_file( $code, $md5 );
my $data = $captcha->create_image_file($code);
$self->image($$data);
# Save captcha session
......@@ -69,11 +67,12 @@ sub saveSession {
{
storageModule => $self->storageModule,
storageModuleOptions => $self->storageModuleOptions,
id => $self->md5,
id => undef,
force => 1,
kind => "Captcha",
}
);
$self->md5( $session->id );
$session->update(
{ _utime => time, code => $self->code, image => $self->image } );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment