« on: February 07, 2009, 05:32:02 PM »
This bug applies to all releases up to and including karzina 1.04
Instructions of how to patch those versions follows...
Customers On Line Report
This report is showing all of the rows in the table "session". These are supposed to be deleted when they are untouched for more than one hour but the session object will not always clean up in as timely a manner as we want for this report to be accurate. There is no reason to force the delete so we will modify the reporting.
So, to show only "current" records (in the spirit of the existing design, "current" is less than 1 hour old) in the "on line" report, you can make the following modification to the file \admin\controller\report_online.php
replace this
$results = $database->getRows("select value, ip, time, url from session");with this
// show only sessions that have not expired.
$sql = "select `value`, `ip`, `time`, `url` from `session` where `expire` > '?'";
$parsed = $database->parse($sql, time());
$results = $database->getRows($parsed);
//
If you want the values shown in the report to be less than 1 hour old, say up to 20 minutes old instead, then those records will expire in 40 minutes from now. Hence, you would change $parsed to the following
$parsed = $database->parse($sql, time() + 40 * 60);
Administration Home Page
In the file admin\controller\home.php replace
$user_info = $database->getRow("select count(*) as total from session");
with the following
// show only sessions that have not expired.
$sql = "select count(*) as total from `session` where `expire` > '?'";
$parsed = $database->parse($sql, time());
$user_info = $database->getRow($parsed);
//