Index: trunk/kernel/include/usersession.php =================================================================== diff -u -N -r2882 -r2908 --- trunk/kernel/include/usersession.php (.../usersession.php) (revision 2882) +++ trunk/kernel/include/usersession.php (.../usersession.php) (revision 2908) @@ -470,6 +470,13 @@ if( !strlen($this->GetSessionKey()) ) $this->GetNewSession(); $this->Set("PortalUserId", $result->fields["PortalUserId"]); + + if($FrontEnd) + { + $application =& kApplication::Instance(); + $application->setVisitField('PortalUserId', $this->Get('PortalUserId') ); + } + // unset($this->CurrentUser); $this->CurrentUser = null; if( strlen($result->fields['tz']) > 0 ) $this->Set('tz',$result->fields['tz']); @@ -1099,7 +1106,7 @@ function GetNewSession() { - global $sessionId, $objConfig, $objLanguages, $m_var_list; + global $sessionId, $objConfig, $objLanguages, $m_var_list, $FrontEnd; $i=0; @@ -1120,6 +1127,13 @@ $this->UpdateAccessTime(); $this->Set("IpAddress", $_SERVER['REMOTE_ADDR'] ); $this->Create(); + + if($FrontEnd) + { + $application =& kApplication::Instance(); + $application->HandleEvent( new kEvent('visits:OnRegisterVisit') ); + } + } else $this->Set("SessionKey","");