Index: branches/5.1.x/core/units/visits/visits_event_handler.php =================================================================== diff -u -N -r12127 -r12657 --- branches/5.1.x/core/units/visits/visits_event_handler.php (.../visits_event_handler.php) (revision 12127) +++ branches/5.1.x/core/units/visits/visits_event_handler.php (.../visits_event_handler.php) (revision 12657) @@ -1,6 +1,6 @@ Array('self' => true), ); - + $this->permMapping = array_merge($this->permMapping, $permissions); } - + /** * Registers user visit to site * * @param kEvent $event */ function OnRegisterVisit(&$event) { - if ($this->Application->IsAdmin()) { + if ($this->Application->IsAdmin() || !$this->Application->ConfigValue('UseVisitorTracking')) { // admin logins are not registred in visits list return true; } + if ($this->Application->RecallVar('visit_id')) { return true; } - $object =& $event->getObject( Array('skip_autoload'=>true) ); + + $object =& $event->getObject( Array('skip_autoload' => true) ); $object->SetDBField('VisitDate_date', adodb_mktime() ); $object->SetDBField('VisitDate_time', adodb_mktime() ); $object->SetDBField('Referer', getArrayValue($_SERVER, 'HTTP_REFERER') ); $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR'] ); - if( $object->Create() ) - { + + if ($object->Create()) { $this->Application->StoreVar('visit_id', $object->GetID() ); $this->Application->SetVar('visits_id', $object->GetID() ); } @@ -113,7 +117,7 @@ } } } - + /** * [HOOK] Updates user_id in current visit * @@ -130,6 +134,4 @@ } } - } - -?> \ No newline at end of file + } \ No newline at end of file