Modified: identity/CatDap/trunk/lib/CatDap/Controller/admin.pm
===================================================================
--- identity/CatDap/trunk/lib/CatDap/Controller/admin.pm 2010-12-16 00:33:50 UTC (rev 169)
+++ identity/CatDap/trunk/lib/CatDap/Controller/admin.pm 2010-12-16 00:34:17 UTC (rev 170)
@@ -47,7 +47,15 @@
my $password;
my $mesg;
my $dn;
- my $keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address );
+ my $keyprefix;
+ if ($c->req->address =~ m/:/) {
+ my $address = $c->req->address;
+ $address =~ s/\[\]://;
+ $keyprefix = sprintf( "%06x", $address >> 104 ); # if we shift right 104 bits from 128 we have 24 bits left or 3 bytes.
+ }
+ else {
+ $keyprefix = sprintf( "%02x%02x%02x", split /\./, $c->req->address );
+ }
if ( !defined $c->user or not $c->req->cookie('key') ) {
$c->detach('/user/login')
if ( not $c->req->param('username')