예제 #1
0
if (CAppUI::conf("readonly") || !CAppUI::conf("log_access")) {
    return;
}
global $m, $action, $dosql;
if (!$action) {
    $action = $dosql;
}
// $action may not defined when the module is inactive
if (!$action) {
    return;
}
// Check prerequisites
$ds = CSQLDataSource::get("std");
// Key initialisation
$log = new CAccessLog();
$log->module_action_id = CModuleAction::getID($m, $action);
// 10-minutes period aggregation
// Don't CMbDT::datetime() to get rid of CAppUI::conf("system_date") if ever used
$period = strftime("%Y-%m-%d %H:%M:00");
$period[15] = "0";
$log->period = $period;
// 10 minutes granularity
$log->aggregate = 10;
// One hit
$log->hits++;
// Keep the scalar conversion
$log->bot = CApp::$is_robot ? 1 : 0;
// Stop chrono if not already done
$chrono = CApp::$chrono;
if ($chrono->step > 0) {
    $chrono->stop();