[RADIATOR] Missing Session Accounting
Christopher Bland
chris at fdu.edu
Wed Sep 10 09:16:31 CDT 2014
Hi All,
I recently change a postauthhook to do cleanup of the RADONLINE session table and have lost users sessions. I added the following
my $username = $p->getAttrByNum($Radius::Radius::USER_NAME);
my $now = &Radius::Util::format_special('%t', $p);
if ($result == $main::ACCEPT) {
my $dbhandler = DBI->connect ($dsn,$dbuser,$dbpasswd) || die "Error opening database: $DBI::errstr\n";
my $yesterday = $now - 86400;
# Build insert sql
$sql = "delete from RADONLINE where USERNAME='$username' and TIME_STAMP < $yesterday";
# Execute RADONLINE cleanup and disconnect from db
my $radonlinecleanup = $dbhandler->prepare($sql);
$radonlinecleanup->execute;
$radonlinecleanup->finish;
$dbhandler->disconnect;
}
Since putting this in user sessions are not being added even though only session older than 24 hours are getting deleted.
-Chris
More information about the radiator
mailing list