Index: branches/RC/kernel/include/portaluser.php =================================================================== diff -u -r8929 -r9465 --- branches/RC/kernel/include/portaluser.php (.../portaluser.php) (revision 8929) +++ branches/RC/kernel/include/portaluser.php (.../portaluser.php) (revision 9465) @@ -52,19 +52,28 @@ function Delete() { - global $objGroups, $objFavorites; + global $objGroups, $objFavorites, $objModules, $objSession; $g = $objGroups->GetPersonalGroup($this->Get("Login")); if (is_object($g)) $g->Delete(); $objFavorites->DeleteUser($this->Get("PortalUserId")); //delete favorites + $user_id = $this->Get("PortalUserId"); + $ret = parent::Delete(); - if($ret && $this->isLiveTable()) - { - $application =& kApplication::Instance(); - $sync_manager =& $application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); - $sync_manager->performAction('deleteUser', $this->Data); + if($ret) { + + if ($objModules->ModuleInstalled('In-Link')) { // clean user visits in LinkVisits table + $sql = 'DELETE FROM '.GetTablePrefix().'LinkVisits WHERE PortalUserId = '.$user_id; + $this->adodbConnection->Execute($sql); + } + + if ($this->isLiveTable()) { + $application =& kApplication::Instance(); + $sync_manager =& $application->recallObjectP('UsersSyncronizeManager', null, Array(), 'InPortalSyncronize'); + $sync_manager->performAction('deleteUser', $this->Data); + } } return $ret;