47 |
my $password; |
my $password; |
48 |
my $mesg; |
my $mesg; |
49 |
my $dn; |
my $dn; |
50 |
my $keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address ); |
my $keyprefix; |
51 |
|
if ($c->req->address =~ m/:/) { |
52 |
|
my $address = $c->req->address; |
53 |
|
$address =~ s/\[\]://; |
54 |
|
$keyprefix = sprintf( "%06x", $address >> 104 ); # if we shift right 104 bits from 128 we have 24 bits left or 3 bytes. |
55 |
|
} |
56 |
|
else { |
57 |
|
$keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address ); |
58 |
|
} |
59 |
if ( !defined $c->user or not $c->req->cookie('key') ) { |
if ( !defined $c->user or not $c->req->cookie('key') ) { |
60 |
$c->detach('/user/login') |
$c->detach('/user/login') |
61 |
if ( not $c->req->param('username') |
if ( not $c->req->param('username') |