• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/classes/general/user.php
  • Класс: CAllSocNetUser
  • Вызов: CAllSocNetUser::OnUserDelete
static function OnUserDelete($ID)
{
	global $APPLICATION;

	if (!CSocNetGroup::__ValidateID($ID))
	{
		return false;
	}

	$ID = (int)$ID;
	$bSuccess = True;

	if (!CSocNetGroup::DeleteNoDemand($ID))
	{
		if($ex = $APPLICATION->GetException())
		{
			$APPLICATION->ThrowException($ex->GetString());
		}
		$bSuccess = false;
	}

	if ($bSuccess)
	{
		CSocNetUserRelations::DeleteNoDemand($ID);
		CSocNetUserPerms::DeleteNoDemand($ID);
		CSocNetUserEvents::DeleteNoDemand($ID);
		CSocNetMessages::DeleteNoDemand($ID);
		CSocNetUserToGroup::DeleteNoDemand($ID);
		CSocNetLogEvents::DeleteNoDemand($ID);
		CSocNetLog::DeleteNoDemand($ID);
		CSocNetLogComments::DeleteNoDemand($ID);
		CSocNetFeatures::DeleteNoDemand($ID);
		CSocNetSubscription::DeleteEx($ID);
		BitrixSocialnetworkItemUserContentView::deleteNoDemand($ID);
		BitrixSocialnetworkLogRightTable::deleteByGroupCode('U'.$ID);

		CUserOptions::DeleteOption("socialnetwork", "~menu_".SONET_ENTITY_USER."_".$ID, false, 0);
	}

	return $bSuccess;
}