";
print qq{
<< Gallery list };
my @keywords = &IVG::keywords($d,$item);
my $masterkey = $keywords[0];
foreach my $key (@keywords) {
print "
" , $key , " |
";
my $b = &IVG::backnext($d,$item,$key,'<');
print "";
if (defined ($b)) {
print qq{ Back };
}
print " | ";
$b = &IVG::backnext($d,$item,$key,'>');
if (defined ($b)) {
print qq{ Next };
}
print " |
";
}
print "
\n";
# Print login or logout
#use APR::Request::Cookie();
use Apache2::Cookie ();
use Apache2::RequestRec ();
use Apache2::Request ();
#my $rr = shift;
#print $r;
#my $r = Apache2::Request->new;
#<($rr);
my $loggedin = 0;
# fetch existing cookies
my %cookies = fetch Apache2::Cookie;
my $ivgses;
if (defined ($cookies{'IVGSES'})) {
$ivgses = $cookies{'IVGSES'}->value;
}
# print "IVG" . $ivgses . "# ";
# print "EMAIL" . $email . "# ";
# print "PASS" . $password . "# ";
if (defined ($email) && defined ($password)) {
#print "email and pass";
if ($ivgses = &IVG::login($d,Digest::MD5::md5_hex($email) .
Digest::MD5::md5_hex($password))) {
my $cookie = Apache2::Cookie->new($r,
-name => 'IVGSES',
-value => $ivgses,
-expires => '+1h',
-domain => '.helenius.fi'
);
$cookie->bake($r);
$loggedin = 1;
}
} else {
#print "check cookie";
if (&IVG::login($d,$ivgses)) {
$loggedin = 1;
}
}
if ($loggedin) {
print "
LOGGED IN";
if (defined ($comment)) {
&IVG::updatetext ($d,$item . "-text", $comment);
}
} else {
print "
";
}
print "
\n";
print qq{
};
#print '
petri@helenius.fi';
print '
};
$item = &IVG::backnext($d,$item,$keywords[0],'>');
}
&IVG::disconnect($d);
%perl>