Hi,
I was looking for a
way to dynamically set the session-timeout to the end of the month. Since
this does not seem to be standard, I made an attempt to write a
PostAuthHook:
use
Time::Local;
# If
Session-Timeout=EM then set it to the number of seconds left in this
month.
sub
{
my $p = ${$_[1]};
my $SessionTimeout = $p->get_attr('Session-Timeout');
if (defined $SessionTimeout)
{
if( $SessionTimeout eq 'EM')
{
my $sec;
my $min;
my $hour;
my $mday;
my $mon;
my $year;
my $wday;
my $yday;
my $isdst;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
{
my $p = ${$_[1]};
my $SessionTimeout = $p->get_attr('Session-Timeout');
if (defined $SessionTimeout)
{
if( $SessionTimeout eq 'EM')
{
my $sec;
my $min;
my $hour;
my $mday;
my $mon;
my $year;
my $wday;
my $yday;
my $isdst;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$mon++;
$year+=1900;
$year+=1900;
if($mon eq
12)
{
$mon = 0;
$year++;
}
{
$mon = 0;
$year++;
}
my
$Timeout = timelocal(0,0,0,1,$mon,$year) -1 -
time;
$p->change_attr('Session-Timeout',$Timeout);
}
}
}
$p->change_attr('Session-Timeout',$Timeout);
}
}
}
If anybody knows a
better way to do this, please let me know.
Greetings,
Herman verschooten
WebVisie bvba
Een klare kijk op interne en externe
communicatie
_______________________________________________
Oudaan
15 / 33 2000
Antwerpen http://www.webvisie.net
tel
03/206.72.70 fax
03/234.93.82 [EMAIL PROTECTED]
